Skip to content

Commit

Permalink
Enforce /permissive- option for MSVC compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
Mi-La committed Sep 13, 2024
1 parent e0a7087 commit 224a0b7
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cmake/toolchain-windows64-msvc.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,11 @@ set(COMPILER_MP_FLAG "/MP${PROCESS_MAX}")
# set big-obj flag
set(COMPILER_BIG_OBJ_FLAG "/bigobj")

# set /permissive- mode to enable "Standards conformance"
set(COMPILER_PERMISSIVE_FLAG "/permissive-")

# set C flags (CMake adds /EHsc by default)
set(CMAKE_C_FLAGS_INIT "${COMPILER_MP_FLAG} ${COMPILER_BIG_OBJ_FLAG}")
set(CMAKE_C_FLAGS_INIT "${COMPILER_MP_FLAG} ${COMPILER_BIG_OBJ_FLAG} ${COMPILER_PERMISSIVE_FLAG}")

# set CXX flags (CMake adds /EHsc by default)
set(CMAKE_CXX_FLAGS_INIT "${COMPILER_MP_FLAG} ${COMPILER_BIG_OBJ_FLAG}")
set(CMAKE_CXX_FLAGS_INIT "${COMPILER_MP_FLAG} ${COMPILER_BIG_OBJ_FLAG} ${COMPILER_PERMISSIVE_FLAG}")

0 comments on commit 224a0b7

Please sign in to comment.