diff options
Diffstat (limited to 'build.bat')
| -rw-r--r-- | build.bat | 27 |
1 files changed, 15 insertions, 12 deletions
| @@ -1,18 +1,21 @@ | |||
| 1 | SET CFLAGS=-std=c11 -fPIC -D_POSIX_C_SOURCE=199309L -pthread -O3 -pedantic -Wall -Wextra -Wno-unused-parameter -Wno-unused-function -DTHREADS=16 -DPORTABLE | 1 | SET COMPILER=clang |
| 2 | 2 | ||
| 3 | :: Build the core library and the shell. | 3 | SET ARCH= |
| 4 | :: Requires WinLibs - https://winlibs.com/ | 4 | SET WARNINGS=-Wno-deprecated-declarations |
| 5 | SET VARIABLES=-DTHREADS=1 -DPORTABLE | ||
| 6 | SET OFLAGS=-O3 | ||
| 7 | SET DFLAGS=-g -fsanitize=address | ||
| 8 | SET CFLAGS=-std=c11 %OFLAGS% %ARCH% %WARNINGS% %VARIABLES% | ||
| 5 | 9 | ||
| 6 | gcc %CFLAGS% -c src/nissy.c | 10 | SET STACKSIZE=-Wl,-stack:16777216 |
| 7 | gcc %CFLAGS% nissy.o shell/shell.c -o run | 11 | SET LFLAGS=%STACKSIZE% |
| 8 | 12 | ||
| 9 | :: Currently, building the Python module is not supported. | 13 | %COMPILER% %CFLAGS% -c src\nissy.c || exit /b |
| 10 | :: There are probably some issues related to using GCC + MINGW instead | 14 | %COMPILER% %CFLAGS% %LFLAGS% nissy.o shell\shell.c -o run.exe || exit /b |
| 11 | :: of a more native Windows compiler. | ||
| 12 | 15 | ||
| 13 | :: Python libraries - change to mathc your local installation | 16 | :: Python libraries - change to mathc your local installation |
| 14 | ::SET PYPATH=%userprofile%\AppData\Local\Programs\Python\Python313 | 17 | SET PYPATH=%userprofile%\AppData\Local\Programs\Python\Python313 |
| 15 | ::SET PYINCLUDE=%PYPATH%\include | 18 | SET PYINCLUDE=%PYPATH%\include |
| 16 | ::SET PYDLL=%PYPATH%\python313.dll | 19 | SET PYLIBS=%PYPATH%\libs |
| 17 | 20 | ||
| 18 | ::gcc %CFLAGS% -I%PYINCLUDE% -shared %PYDLL% python/nissy_module.c nissy.o -o nissy_python_module.pyd | 21 | %COMPILER% %CFLAGS% -I%PYINCLUDE% -L%PYLIBS% -shared -lpython3 python/nissy_module.c nissy.o -o nissy.pyd \ No newline at end of file |
