Skip to content

Commit

Permalink
fix(build): enable experimental <stdatomic> on MSVC
Browse files Browse the repository at this point in the history
  • Loading branch information
lmichaelis committed May 4, 2024
1 parent 726c829 commit 603b123
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion support/BuildSupport.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ function(bs_select_cflags SANITIZERS COMPILE LINK)
endfunction()

## Compute the compile and link play_mode_flags for MSVC
## See: https://devblogs.microsoft.com/cppblog/c11-atomics-in-visual-studio-2022-version-17-5-preview-2/
##
## Args:
## SANITIZERS(bool): Whether to enable sanitizers or not.
Expand All @@ -37,7 +38,7 @@ endfunction()
## COMPILE(list): A list containing the compiler play_mode_flags
## LINK(list): A list containing the linker play_mode_flags
function(bs_internal_select_cflags_msvc SANITIZERS COMPILE LINK)
list(APPEND _INTERNAL_COMPILE_FLAGS "/Wall")
list(APPEND _INTERNAL_COMPILE_FLAGS "/Wall" "/experimental:c11atomics")

if (CMAKE_BUILD_TYPE MATCHES "^Debug" AND ${SANITIZERS})
list(APPEND _INTERNAL_COMPILE_FLAGS "/fsanitize=address")
Expand Down

0 comments on commit 603b123

Please sign in to comment.