Repository navigation
Conversation
…. use M_PI; MinGW's math.h hides it under -std=c++20 / strict ANSI, and until now only MSVC got the define in ScadCompile)
…ompiler (with no cl on the path the default generator fell through to NMake, which a source build without MSVC does not have)
Collaborator
Author
|
Superseded by #81 (same two commits, flowing through dev per the usual release path). |
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.
Building from source on Windows without MSVC, with MinGW-w64 gcc (gcc 15.2.0, CMake 4.5, ninja 1.13, Python 3.10 from uv), two things break; this PR fixes both.
1.
_USE_MATH_DEFINESfor MinGW (ScadCompile.cmake)The scad targets compile with
-std=c++20(strict ANSI,CMAKE_CXX_EXTENSIONS OFF). OCCT's geometry headers (gp_Dir.hxx,gp_Vec.hxx,gp_Dir2d.hxx,gp_Vec2d.hxx, …) useM_PI/M_PI_2, and MinGW'smath.hexposes those under strict ANSI only when_USE_MATH_DEFINESis defined. MSVC already gets the define in the MSVC branch ofscad_apply_compile_options, which is why MSVC and Linux/macOS gcc builds never see this — MinGW was the one case left out, so every TU that includes an OCCT geometry header fails with'M_PI' was not declared in this scope. The fix adds the same define in aMINGWbranch.2. Ninja in
build_occt.pywhen g++ is the compilerOn Windows the script only selects Ninja when
clis on the PATH; without MSVC it leaves the generator to CMake, which falls back to NMake and dies with'nmake' '-?' failed with: no such file or directory. With a MinGW g++ on the PATH, CMake's Ninja generator detects gcc/g++ on its own, so the condition now also acceptsg++. Behaviour withclpresent (the release workflow) is unchanged.Not changed here (environment note)
scikit-build-core 1.1.2 under
uv syncbuild isolation did not pick Ninja by itself on this setup, so a MinGW source build currently still needsCMAKE_GENERATOR=Ninjaexported. The local recipe that now works end to end:Verification
Full
uv sync --group deveditable build with gcc 15.2.0 (MinGW-w64) against a static OCCT V7_9_3 built bytools/build_occt.py; smoke test:MSVC, Linux and macOS are untouched: the compile definition is
MINGW-scoped, and the script's generator choice is identical wheneverclis present.