diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2025-08-11 10:22:56 +0200 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2025-08-11 11:48:40 +0200 |
| commit | d25f23805c6d7128b508a359d47af136dd2fd0db (patch) | |
| tree | f0fa7998db9f58a475d8e54f17239aa7822be254 /build | |
| parent | 9c5c7af7abe9e444210ac86b903eee775fc76a84 (diff) | |
| download | nissy-core-d25f23805c6d7128b508a359d47af136dd2fd0db.tar.gz nissy-core-d25f23805c6d7128b508a359d47af136dd2fd0db.zip | |
Wrapped pthread use in custom API
Diffstat (limited to 'build')
| -rwxr-xr-x | build | 18 |
1 files changed, 13 insertions, 5 deletions
| @@ -117,15 +117,23 @@ parsesanitize() { | |||
| 117 | done | 117 | done |
| 118 | } | 118 | } |
| 119 | 119 | ||
| 120 | maybe_pthread() { | ||
| 121 | if [ "$THREADS" -gt 1 ]; then | ||
| 122 | echo "-pthread" | ||
| 123 | else | ||
| 124 | echo "" | ||
| 125 | fi | ||
| 126 | } | ||
| 127 | |||
| 120 | # Build flags | 128 | # Build flags |
| 121 | CFLAGS="-std=c11 -fPIC -D_POSIX_C_SOURCE=199309L -pthread" | 129 | CFLAGS="-std=c11 -fPIC -D_POSIX_C_SOURCE=199309L $(maybe_pthread)" |
| 122 | PYCFLAGS="-std=c11 -fPIC -pthread" | 130 | PYCFLAGS="-std=c11 -fPIC $(maybe_pthread)" |
| 123 | [ "$ARCH" = "AVX2" ] && CFLAGS="$CFLAGS -mavx2" | 131 | [ "$ARCH" = "AVX2" ] && CFLAGS="$CFLAGS -mavx2" |
| 124 | WFLAGS="-pedantic -Wall -Wextra -Wno-unused-parameter -Wno-unused-function" | 132 | WFLAGS="-pedantic -Wall -Wextra -Wno-unused-parameter -Wno-unused-function" |
| 125 | OFLAGS="$OPTIMIZE" | 133 | OFLAGS="$OPTIMIZE" |
| 126 | DFLAGS="-DDEBUG -g3 $(parsesanitize "$SANITIZE")" | 134 | DFLAGS="-DDEBUG -g3 $(parsesanitize "$SANITIZE")" |
| 127 | MFLAGS="-DTHREADS=$THREADS -D$ARCH" | 135 | MFLAGS="-DTHREADS=$THREADS -D$ARCH" |
| 128 | CPPFLAGS="-std=c++20 -pthread" | 136 | CPPFLAGS="-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) |
| 143 | WASMCFLAGS="-std=c11 -fPIC -D_POSIX_C_SOURCE=199309L -pthread | 151 | WASMCFLAGS="-std=c11 -fPIC -D_POSIX_C_SOURCE=199309L $(maybe_pthread) |
| 144 | -mfpu=neon -mrelaxed-simd" | 152 | -mfpu=neon -mrelaxed-simd" |
| 145 | WASMCPPFLAGS="-std=c++20 -pthread" | 153 | WASMCPPFLAGS="-std=c++20 $(maybe_pthread)" |
| 146 | WASMDBGFLAGS="-sASSERTIONS" | 154 | WASMDBGFLAGS="-sASSERTIONS" |
| 147 | WASMMFLAGS="-DTHREADS=$THREADS -DNEON" | 155 | WASMMFLAGS="-DTHREADS=$THREADS -DNEON" |
| 148 | WASMLINKFLAGS="--no-entry -sEXPORT_NAME='Nissy' -sMODULARIZE | 156 | WASMLINKFLAGS="--no-entry -sEXPORT_NAME='Nissy' -sMODULARIZE |
