Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/cpp/cmake/ScadCompile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ function(scad_apply_compile_options target)
target_compile_definitions(${target} PRIVATE
$<$<CONFIG:Debug>:_GLIBCXX_ASSERTIONS>
$<$<CONFIG:Debug>:_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE>)
# MinGW: OCCT headers (gp_Dir.hxx & co.) use M_PI, which MinGW's math.h hides under
# -std=c++20 (strict ANSI) unless _USE_MATH_DEFINES is set; MSVC already gets it above.
if(MINGW)
target_compile_definitions(${target} PRIVATE _USE_MATH_DEFINES)
endif()
if(SCAD_SANITIZE)
target_compile_options(${target} PRIVATE -fsanitize=address,undefined -fno-omit-frame-pointer)
target_link_options(${target} PRIVATE -fsanitize=address,undefined)
Expand Down
8 changes: 4 additions & 4 deletions src/cpp/tools/build_occt.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,10 @@ def main() -> int:
"INSTALL_DIR_LAYOUT": "Unix",
}
cmd = ["cmake", "-S", str(src), "-B", str(build)]
# Ninja where a compiler is already on the path (Linux, macOS). On Windows only when the MSVC environment is active
# (`cl` on the path: the release workflow activates it); otherwise the default Visual Studio generator finds MSVC by
# itself, which a bare Ninja would not.
ninja = shutil.which("ninja") is not None and (sys.platform != "win32" or shutil.which("cl") is not None)
# Ninja where a compiler is already on the path (Linux, macOS). On Windows when the MSVC environment is active
# (`cl` on the path: the release workflow activates it) or a MinGW g++ is (with cl absent CMake falls back to
# gcc); otherwise the default Visual Studio generator finds MSVC by itself, which a bare Ninja would not.
ninja = shutil.which("ninja") is not None and (sys.platform != "win32" or shutil.which("cl") is not None or shutil.which("g++") is not None)
if ninja:
cmd += ["-G", "Ninja"]
cmd += [f"-D{k}={v}" for k, v in options.items()]
Expand Down
Loading