aboutsummaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2025-08-11 10:22:56 +0200
committerSebastiano Tronto <sebastiano@tronto.net>2025-08-11 11:48:40 +0200
commitd25f23805c6d7128b508a359d47af136dd2fd0db (patch)
treef0fa7998db9f58a475d8e54f17239aa7822be254 /build
parent9c5c7af7abe9e444210ac86b903eee775fc76a84 (diff)
downloadnissy-core-d25f23805c6d7128b508a359d47af136dd2fd0db.tar.gz
nissy-core-d25f23805c6d7128b508a359d47af136dd2fd0db.zip
Wrapped pthread use in custom API
Diffstat (limited to '')
-rwxr-xr-xbuild18
1 files changed, 13 insertions, 5 deletions
diff --git a/build b/build
index 310bd28..e689b19 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

Generated with cgit - Back to sebastiano.tronto.net