aboutsummaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
Diffstat (limited to 'build')
-rwxr-xr-xbuild20
1 files changed, 14 insertions, 6 deletions
diff --git a/build b/build
index 310bd28..cdf0c79 100755
--- a/build
+++ b/build
@@ -117,15 +117,23 @@ parsesanitize() {
117 done 117 done
118} 118}
119 119
120maybe_pthread() {
121 if [ "$THREADS" -gt 1 ]; then
122 echo "-pthread"
123 else
124 echo ""
125 fi
126}
127
120# Build flags 128# Build flags
121CFLAGS="-std=c11 -fPIC -D_POSIX_C_SOURCE=199309L -pthread" 129CFLAGS="-std=c11 -fPIC -D_POSIX_C_SOURCE=199309L $(maybe_pthread)"
122PYCFLAGS="-std=c11 -fPIC -pthread" 130PYCFLAGS="-std=c11 -fPIC $(maybe_pthread)"
123[ "$ARCH" = "AVX2" ] && CFLAGS="$CFLAGS -mavx2" 131[ "$ARCH" = "AVX2" ] && CFLAGS="$CFLAGS -mavx2"
124WFLAGS="-pedantic -Wall -Wextra -Wno-unused-parameter -Wno-unused-function" 132WFLAGS="-pedantic -Wall -Wextra -Wno-unused-parameter -Wno-unused-function"
125OFLAGS="$OPTIMIZE" 133OFLAGS="$OPTIMIZE"
126DFLAGS="-DDEBUG -g3 $(parsesanitize "$SANITIZE")" 134DFLAGS="-DDEBUG -g3 $(parsesanitize "$SANITIZE")"
127MFLAGS="-DTHREADS=$THREADS -D$ARCH" 135MFLAGS="-DTHREADS=$THREADS -D$ARCH"
128CPPFLAGS="-std=c++20 -pthread" 136CPPFLAGS="-std=c++20 $(maybe_pthread)"
129 137
130# TODO: 138# TODO:
131# MEMORY64 is supported on Firefox (from version 134) and Chrome (from 133), 139# MEMORY64 is supported on Firefox (from version 134) and Chrome (from 133),
@@ -140,9 +148,9 @@ CPPFLAGS="-std=c++20 -pthread"
140# The options below have to be adjusted when native WASM_SIMD is implemented. 148# The options below have to be adjusted when native WASM_SIMD is implemented.
141 149
142# Build flags for emscripten (WASM target) 150# Build flags for emscripten (WASM target)
143WASMCFLAGS="-std=c11 -fPIC -D_POSIX_C_SOURCE=199309L -pthread 151WASMCFLAGS="-std=c11 -fPIC -D_POSIX_C_SOURCE=199309L $(maybe_pthread)
144 -mfpu=neon -mrelaxed-simd" 152 -mfpu=neon -mrelaxed-simd"
145WASMCPPFLAGS="-std=c++20 -pthread" 153WASMCPPFLAGS="-std=c++20 $(maybe_pthread)"
146WASMDBGFLAGS="-sASSERTIONS" 154WASMDBGFLAGS="-sASSERTIONS"
147WASMMFLAGS="-DTHREADS=$THREADS -DNEON" 155WASMMFLAGS="-DTHREADS=$THREADS -DNEON"
148WASMLINKFLAGS="--no-entry -sEXPORT_NAME='Nissy' -sMODULARIZE 156WASMLINKFLAGS="--no-entry -sEXPORT_NAME='Nissy' -sMODULARIZE
@@ -272,7 +280,7 @@ build_python() {
272 fi 280 fi
273 build_nissy || exit 1 281 build_nissy || exit 1
274 run $CC $PYCFLAGS $WFLAGS $PYTHON3_INCLUDES $OFLAGS -shared \ 282 run $CC $PYCFLAGS $WFLAGS $PYTHON3_INCLUDES $OFLAGS -shared \
275 -o nissy_python_module.so nissy.o python/nissy_module.c 283 -o python/nissy.so nissy.o python/nissy_module.c
276} 284}
277 285
278build_cpp() { 286build_cpp() {

Generated with cgit - Back to sebastiano.tronto.net