Skip to content

Build System Improvements#663

Merged
FakeByte merged 1 commit into
masterfrom
build-system-improvements
May 12, 2026
Merged

Build System Improvements#663
FakeByte merged 1 commit into
masterfrom
build-system-improvements

Conversation

@FakeByte
Copy link
Copy Markdown
Contributor

This adds:
Adds CRT aware file suffix
Per config build dir
Out-of source build dir
Variant only CPPPATH
Precompiled header for MSVC

This improves the build time a lot.
The following steps were ran in order once before and after this PR:

Clean project:
scons | Original 842.9s | PR 773.4s

No-op:
scons | Original 26.3s | PR 27.7s

Touch one file (Get-Item extension\src\openvic-extension\singletons\MenuSingleton.cpp).LastWriteTime = Get-Date
scons | Original 891.8s | PR 29.2s

Release Build
scons target=template_release | Original 814.6s | PR 774.0s

Rerun Debug Build
scons | Original 850.5s | PR 32.7s

Iterative builds are way faster, saving up to 96% on incremental builds.
It stores object files not next to source files anymore but stores them in a separate build directory which different directories for different build configurations. This means if you compile a debug build, then a release build and then a debug build the second debug build is fast now because the object files of the last debug build were still kept.

On Windows one issue was that obj files did not have the CRT (MD/MT) in their file names which is now added. On windows if you build and run the simulations tests they build with MT, the GDExtension builds with MD though. Building the extension after the tests causes a compile error as it tries to reuse the object files that were built with the wrong CRT instead of rebuilding them.

This pull request requires the following PRs to be merged first:
OpenVicProject/lexy-vdf#30
OpenVicProject/OpenVic-Dataloader#105
OpenVicProject/scripts#33
OpenVicProject/OpenVic-Simulation#722

wvpm
wvpm previously approved these changes May 11, 2026
Added Variant-dir-aware glob
Added deterministic platform option order
Added deterministic build module resolution
Added Precompiled Header for MSVC
@FakeByte FakeByte merged commit 8f0b55f into master May 12, 2026
20 checks passed
@Spartan322 Spartan322 deleted the build-system-improvements branch May 12, 2026 21:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants