aboutsummaryrefslogtreecommitdiff
path: root/build.bat
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2026-03-01 18:09:44 +0100
committerSebastiano Tronto <sebastiano@tronto.net>2026-03-01 18:09:44 +0100
commit2c291aed4bb80f07e8557284d3399cf1e2a4ccb9 (patch)
tree2c009a3ad206842b07b1cd758b8192e2154231e9 /build.bat
parentdff3a040637f2985b5b5e369148a993183964096 (diff)
downloadnissy-core-2c291aed4bb80f07e8557284d3399cf1e2a4ccb9.tar.gz
nissy-core-2c291aed4bb80f07e8557284d3399cf1e2a4ccb9.zip
Improve Windows build support.
- Use multithreading (works with a sufficiently recent version of the Microsoft developer tools / C SDK). - Detect CPU architecture and use AVX2 or NEON when appropriate. - Automatically detect python installation path.
Diffstat (limited to 'build.bat')
-rw-r--r--build.bat26
1 files changed, 19 insertions, 7 deletions
diff --git a/build.bat b/build.bat
index 909ff01..9f9f5f1 100644
--- a/build.bat
+++ b/build.bat
@@ -9,15 +9,25 @@ if [%1]==[/d] (
9 9
10SET CC=clang 10SET CC=clang
11SET CXX=clang++ 11SET CXX=clang++
12SET ARCH=PORTABLE 12SET THREADS=16
13SET THREADS=1
14SET SANITIZE= 13SET SANITIZE=
15 14
16:: TODO depends on ARCH variable 15SET ARCH=PORTABLE
17SET ARCHOPTS= 16clang -march=native -dM -E - < NUL | findstr /C:"__AVX2__" >NUL 2>&1
18:: TODO depends on SANITIZE variable 17if %ERRORLEVEL% EQU 0 (
19SET DFLAGS=-g3 -DDEBUG 18 SET ARCH=AVX2
19 SET ARCHOPTS=-mavx2
20 goto :ArchDone
21)
22clang -march=native -dM -E - < NUL | findstr /C:"__ARM_NEON" >NUL 2>&1
23if %ERRORLEVEL% EQU 0 (
24 SET ARCH=NEON
25 goto :ArchDone
26)
27:ArchDone
28
20 29
30SET DFLAGS=-g3 -DDEBUG
21SET WARNINGS=-Wno-deprecated-declarations 31SET WARNINGS=-Wno-deprecated-declarations
22SET VARIABLES=-DTHREADS=%THREADS% -D%ARCH% 32SET VARIABLES=-DTHREADS=%THREADS% -D%ARCH%
23SET OFLAGS=-O3 33SET OFLAGS=-O3
@@ -28,7 +38,9 @@ SET STACKSIZE=-Wl,-stack:16777216
28SET LFLAGS=%STACKSIZE% 38SET LFLAGS=%STACKSIZE%
29 39
30:: Python libraries - change to match your local installation 40:: Python libraries - change to match your local installation
31SET PYPATH=%userprofile%\AppData\Local\Programs\Python\Python313 41for /f "delims=" %%i in ('python -c "import sys; print(sys.base_prefix)"') do set PYPATH=%%i
42::SET PYPATH=%userprofile%\AppData\Local\Programs\Python\Python313
43
32SET PYINCLUDE=%PYPATH%\include 44SET PYINCLUDE=%PYPATH%\include
33SET PYLIBS=%PYPATH%\libs 45SET PYLIBS=%PYPATH%\libs
34 46

Generated with cgit - Back to sebastiano.tronto.net