Skip to content

Commit

Permalink
[misc] Fix segfault on windows due to vcruntime conflicts.
Browse files Browse the repository at this point in the history
  • Loading branch information
duburcqa committed Jun 10, 2024
1 parent 3e0c745 commit 4fe5ad3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ if(MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /fp:contract")
endif()
endif()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP /EHsc /bigobj /Gy /Zc:inline /Zc:preprocessor /Zc:__cplusplus /permissive- /DWIN32 /D_USE_MATH_DEFINES /DNOMINMAX")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} \
/MP /EHsc /bigobj /Gy /Zc:inline /Zc:preprocessor /Zc:__cplusplus /permissive- /DWIN32 \
/D_USE_MATH_DEFINES /D_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR /DNOMINMAX")
set(CMAKE_CXX_FLAGS_DEBUG "/Zi /Od")
set(CMAKE_CXX_FLAGS_RELEASE "/DNDEBUG /O2 /Ob3")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELEASE} /Zi")
Expand Down
7 changes: 6 additions & 1 deletion build_tools/build_install_deps_windows.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,12 @@ if (-not (Test-Path env:GENERATOR)) {
}

### Set common CMAKE_C/CXX_FLAGS
${CMAKE_CXX_FLAGS} = "${env:CMAKE_CXX_FLAGS} /MP2 /EHsc /bigobj /Gy /Zc:inline /Zc:preprocessor /Zc:__cplusplus /permissive- /DWIN32 /D_USE_MATH_DEFINES /DNOMINMAX"
# * Flag "DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR" is a dirty workaround to deal with VC runtime
# conflict related to different search path ordering at compile-time / run-time causing segfault:
# https://github.com/actions/runner-images/issues/10004
${CMAKE_CXX_FLAGS} = "${env:CMAKE_CXX_FLAGS} $(
) /MP2 /EHsc /bigobj /Gy /Zc:inline /Zc:preprocessor /Zc:__cplusplus /permissive- $(
) /DWIN32 /D_USE_MATH_DEFINES /D_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR /DNOMINMAX"
if (${BUILD_TYPE} -eq "Debug") {
${CMAKE_CXX_FLAGS} = "${CMAKE_CXX_FLAGS} /Zi /Od"
} else {
Expand Down

0 comments on commit 4fe5ad3

Please sign in to comment.