Skip to content

Commit

Permalink
Disable C++20 modules for MSVC
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmarius committed Jun 17, 2023
1 parent ddff781 commit 6dfcf03
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ set(debug_mode "$<OR:${is_debug},${is_rel_with_deb}>")

function(set_custom_stdlib_and_sanitizers target add_apple_asan)
if(MSVC)
target_compile_options(${target} PRIVATE "$<${debug_mode}:/fsanitize=address>")
# see https://gitlab.kitware.com/cmake/cmake/-/issues/24922
set_target_properties(${target} PROPERTIES VS_USER_PROPS "${CMAKE_SOURCE_DIR}/disable_modules.props")
target_compile_options(${target} PRIVATE "$<${debug_mode}:/fsanitize=address>" /experimental:module-)
return()
endif()

Expand Down
7 changes: 7 additions & 0 deletions disable_modules.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<Project>
<ItemDefinitionGroup>
<ClCompile>
<BuildStlModules>false</BuildStlModules>
</ClCompile>
</ItemDefinitionGroup>
</Project>

0 comments on commit 6dfcf03

Please sign in to comment.