diff options
Diffstat (limited to 'src/CMakeLists.txt')
-rw-r--r-- | src/CMakeLists.txt | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 7bb88c8ea..a9f68a8f2 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -105,6 +105,8 @@ if (MSVC) set(CMAKE_EXE_LINKER_FLAGS_RELEASE "/DEBUG /MANIFEST:NO /INCREMENTAL:NO /OPT:REF,ICF" CACHE STRING "" FORCE) else() add_compile_options( + -fwrapv + -Werror=all -Werror=extra -Werror=missing-declarations @@ -114,19 +116,21 @@ else() -Wno-attributes -Wno-invalid-offsetof -Wno-unused-parameter - - $<$<CXX_COMPILER_ID:Clang>:-Wno-braced-scalar-init> - $<$<CXX_COMPILER_ID:Clang>:-Wno-unused-private-field> - $<$<CXX_COMPILER_ID:Clang>:-Werror=shadow-uncaptured-local> - $<$<CXX_COMPILER_ID:Clang>:-Werror=implicit-fallthrough> - $<$<CXX_COMPILER_ID:Clang>:-Werror=type-limits> - $<$<CXX_COMPILER_ID:AppleClang>:-Wno-braced-scalar-init> - $<$<CXX_COMPILER_ID:AppleClang>:-Wno-unused-private-field> ) + if (CMAKE_CXX_COMPILER_ID MATCHES Clang) # Clang or AppleClang + add_compile_options( + -Wno-braced-scalar-init + -Wno-unused-private-field + -Wno-nullability-completeness + -Werror=shadow-uncaptured-local + -Werror=implicit-fallthrough + -Werror=type-limits + ) + endif() + if (ARCHITECTURE_x86_64) add_compile_options("-mcx16") - add_compile_options("-fwrapv") endif() if (APPLE AND CMAKE_CXX_COMPILER_ID STREQUAL Clang) |