Add Zig build for WhipLib (Phase 1)#9
Draft
deevus wants to merge 1 commit into
Draft
Conversation
Bring the project under a single Zig-driven build system, mirroring the ROLLER repo's mise + build.zig pattern. WhipLib compiles cleanly for macOS arm64 (native), aarch64-linux-gnu (cross), and x86_64-windows-gnu (cross) from a Mac, replacing the per-platform Makefile / vcxproj split for this library. Build configuration: - mise.toml pins Zig 0.15.2 (matches ROLLER) with build/clean/test tasks - GLEW_NO_GLU is defined globally (codebase has zero GLU calls; avoids needing libGLU on cross-compiles) - WHIPLIB_LIB is defined so the static archive's WLFUNC declarations don't accidentally become __declspec(dllimport) on Windows - FBXExporter.cpp is gated behind -Dfbx=true. FBX SDK 2020.3.7 headers have known clang compatibility issues (deprecated vsprintf, internal typo mLefttChild); resolving those is Phase 2 work along with adding the CLI tools that link FBX Out of scope here: ModelExporter / TrackAnalyzer / CarPlansParser binaries, and TrackEditor (Qt5 GUI, needs moc/uic/rcc orchestration).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
mise+build.zigpattern.zig buildinvocation on a Mac, replacing the per-platform Makefile / vcxproj split for this library.What's in this PR
mise.tomlpins Zig 0.15.2 (matches ROLLER) withbuild/clean/testtasks.build.zig+build.zig.zonproducezig-out/lib/libWhipLib.afor any supported target.external/glew/external/glm/external/stbheaders — no Homebrew dependency required for Phase 1..gitignoreupdated forzig-out/and.zig-cache/.Build configuration choices worth flagging for review
GLEW_NO_GLU=1defined globally. GLEW's header includes<GL/glu.h>by default; codebase has zero GLU calls (verified by grep), so this avoids needing libGLU on every cross target.WHIPLIB_LIB=1defined.WhipLib.h'sWLFUNCmacro defaults to__declspec(dllimport)on Windows when neitherWHIPLIB_LIBnorWHIPLIB_DLLis set — that broke the Windows static-lib build. DefiningWHIPLIB_LIBkeeps the implementations linkable.FBXExporter.cppgated behind-Dfbx=true. FBX SDK 2020.3.7 headers don't compile cleanly with modern clang (typomLefttChildinfbxredblacktree.h, deprecatedvsprintf, non-trivially-copyablememcpy). Resolving that is Phase 2 along with the CLI tools that actually link FBX.Out of scope (future phases)
moc/uic/rccorchestration over Homebrew'sqt@5).Test plan
mise exec -- zig buildon macOS arm64 produceszig-out/lib/libWhipLib.a(~11 MB)mise exec -- zig build -Dtarget=aarch64-linux-gnusucceedsmise exec -- zig build -Dtarget=x86_64-windows-gnusucceedsmise exec -- zig build -Doptimize=ReleaseFastsucceeds