Skip to content

Commit

Permalink
cmake: add check_c_compiler_flag for atomic-implicit-seq-cst warning
Browse files Browse the repository at this point in the history
  • Loading branch information
sreimers committed Dec 12, 2022
1 parent c9bceee commit b5c6311
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/cmake)
# Module/Package Includes
#
include(GNUInstallDirs)
include(CheckCCompilerFlag)

##############################################################################
#
Expand Down Expand Up @@ -76,7 +77,12 @@ else()
endif()

if(CMAKE_C_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wshorten-64-to-32 -Watomic-implicit-seq-cst)
add_compile_options(-Wshorten-64-to-32)
endif()

check_c_compiler_flag("-Watomic-implicit-seq-cst" COMPILER_SUPPORTS_WATOMIC)
if(COMPILER_SUPPORTS_WATOMIC)
add_compile_options(-Watomic-implicit-seq-cst)
endif()

if(CMAKE_C_COMPILER_ID MATCHES "Clang")
Expand Down

0 comments on commit b5c6311

Please sign in to comment.