Skip to content

Commit

Permalink
build: fix GN configuration for deps/base64
Browse files Browse the repository at this point in the history
PR-URL: nodejs#50696
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
  • Loading branch information
zcbenz authored and martenrichter committed Nov 26, 2023
1 parent 2df5f42 commit 32df748
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions deps/base64/unofficial.gni
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ template("base64_gn_build") {
"HAVE_SSE42=1",
"HAVE_AVX=1",
"HAVE_AVX2=1",
"HAVE_AVX512=1",
]
}
if (target_cpu == "arm") {
Expand Down Expand Up @@ -65,6 +66,7 @@ template("base64_gn_build") {
":base64_sse42",
":base64_avx",
":base64_avx2",
":base64_avx512",
":base64_neon32",
":base64_neon64",
]
Expand Down Expand Up @@ -111,6 +113,7 @@ template("base64_gn_build") {
}
}
}

source_set("base64_avx2") {
configs += [ ":base64_internal_config" ]
sources = [ "base64/lib/arch/avx2/codec.c" ]
Expand All @@ -123,6 +126,21 @@ template("base64_gn_build") {
}
}

source_set("base64_avx512") {
configs += [ ":base64_internal_config" ]
sources = [ "base64/lib/arch/avx512/codec.c" ]
if (target_cpu == "x86" || target_cpu == "x64") {
if (is_clang || !is_win) {
cflags_c = [
"-mavx512vl",
"-mavx512vbmi",
]
} else if (is_win) {
cflags_c = [ "/arch:AVX512" ]
}
}
}

source_set("base64_neon32") {
configs += [ ":base64_internal_config" ]
sources = [ "base64/lib/arch/neon32/codec.c" ]
Expand Down

0 comments on commit 32df748

Please sign in to comment.