nim-wasm-test/config.nims
Mahlon E. Smith 0d70fefc8b
Experiment with resource loading (in the form of a config file).
Change compile time checks from "if" to "when", for proper type definitions.
2025-08-20 11:13:51 -07:00

36 lines
1.1 KiB
Nim

when defined( emscripten ):
--define:GraphicsApiOpenGlEs2
# --define:NaylibWebResources
# switch("define", "NaylibWebResourcesPath=resources")
# switch("define", "NaylibWebPthreadPoolSize=2")
# --define:NaylibWebAsyncify
--os:linux
--cpu:wasm32
--cc:clang
when defined( windows ):
--clang.exe:emcc.bat # Replace C
--clang.linkerexe:emcc.bat # Replace C linker
--clang.cpp.exe:emcc.bat # Replace C++
--clang.cpp.linkerexe:emcc.bat # Replace C++ linker.
else:
--clang.exe:emcc
--clang.linkerexe:emcc
--clang.cpp.exe:emcc
--clang.cpp.linkerexe:emcc
--mm:arc
--threads:on
--panics:on
--exceptions:goto
--define:noSignalHandler
# --passL:"-Oz" # Production bu ld
# --passL:"-O0 -gDebug -gsource-map" # Debug build
--passL:"-s EXPORT_ES6"
--passL:"-s EXPORT_NAME=NimTest"
--passL:"-s ASYNCIFY" # async support
# --passL:"-s EXPORT_ALL=1" # make all public methods available to JS
# --passL:"-s JSPI" # async support (new)
# --passL:"-s ALLOW_MEMORY_GROWTH=1"
--passL:"--preload-file resources"
--passL:"-o build/nimtest.js"