Skip to content

Commit 019efa8

Browse files
zcbenzUlisesGascon
authored andcommitted
build: fix GN configuration for deps/base64
PR-URL: #50696 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
1 parent 3c79e3c commit 019efa8

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

deps/base64/unofficial.gni

+18
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ template("base64_gn_build") {
3232
"HAVE_SSE42=1",
3333
"HAVE_AVX=1",
3434
"HAVE_AVX2=1",
35+
"HAVE_AVX512=1",
3536
]
3637
}
3738
if (target_cpu == "arm") {
@@ -65,6 +66,7 @@ template("base64_gn_build") {
6566
":base64_sse42",
6667
":base64_avx",
6768
":base64_avx2",
69+
":base64_avx512",
6870
":base64_neon32",
6971
":base64_neon64",
7072
]
@@ -111,6 +113,7 @@ template("base64_gn_build") {
111113
}
112114
}
113115
}
116+
114117
source_set("base64_avx2") {
115118
configs += [ ":base64_internal_config" ]
116119
sources = [ "base64/lib/arch/avx2/codec.c" ]
@@ -123,6 +126,21 @@ template("base64_gn_build") {
123126
}
124127
}
125128

129+
source_set("base64_avx512") {
130+
configs += [ ":base64_internal_config" ]
131+
sources = [ "base64/lib/arch/avx512/codec.c" ]
132+
if (target_cpu == "x86" || target_cpu == "x64") {
133+
if (is_clang || !is_win) {
134+
cflags_c = [
135+
"-mavx512vl",
136+
"-mavx512vbmi",
137+
]
138+
} else if (is_win) {
139+
cflags_c = [ "/arch:AVX512" ]
140+
}
141+
}
142+
}
143+
126144
source_set("base64_neon32") {
127145
configs += [ ":base64_internal_config" ]
128146
sources = [ "base64/lib/arch/neon32/codec.c" ]

0 commit comments

Comments
 (0)