feat(build): add cross-platform support and validation #66
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
npm run build
instead ofnode run build
npx
for tsc, detect platform for math-lib flags and wasm compilergetMathLibFlag()
,getWasmCompiler()
andgetPackerOutput()
build/pack.h
, throwing a clear error if missingI believe we are down to c3 issues; too much for my recreational session today.
PingMessage
via struct initializer and callplatform::send_message(&ping_msg)
other_players
tovar other_players: HashMap(uint, Player)
os::native_fwrite_fn
lambda signatureHere’s a summary of what we did to get your build working:
Cross-Platform Build Fixes:
npx
for TypeScript compilation in a way that works on both Windows and Unix.packer.exe
on Windows andpacker
elsewhere, and all references use the correct name.Math Library Linking:
-lm
flag (math library) on non-Windows platforms, preventing linker errors on Windows.Wasm Compilation on Windows:
emcc
(Emscripten) on Windows, since standard clang does not supportwasm32
out of the box.Build Order and File Generation:
C3 Source Code Fixes:
I used the following:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser Invoke-RestMethod -Uri https://get.scoop.sh | Invoke-Expression1
scoop install c3
you need to install and do a emsdk_env before building. https://emscripten.org/docs/getting_started/downloads.html I installed via choco; I'm not sure I suggest it.
we're closer to a working build for windows.