diff options
author | Alexey Rusakov <Kitsune-Ral@users.sf.net> | 2022-09-10 10:43:59 +0200 |
---|---|---|
committer | Alexey Rusakov <Kitsune-Ral@users.sf.net> | 2022-09-10 10:43:59 +0200 |
commit | d890cc09dd6cd096423271ce47ca4ac86d2e9e41 (patch) | |
tree | b45fff9e2a9b58e11b5c2444a072c2f0d2e0792b | |
parent | 06d2ddafd856af68f39aa701570443a033e24643 (diff) | |
download | libquotient-d890cc09dd6cd096423271ce47ca4ac86d2e9e41.tar.gz libquotient-d890cc09dd6cd096423271ce47ca4ac86d2e9e41.zip |
CMakeLists, MSVC: require new preprocessor in public
The new MSVC preprocessor is needed to correctly deal with variadic
macros defined in .h files, so the respective compiler switch has to be
added when building depending projects too.
-rw-r--r-- | CMakeLists.txt | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index f3149a19..0fbb4ef1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,7 +32,7 @@ endif(CMAKE_BUILD_TYPE) message(STATUS "Using compiler: ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION}" ) include(CheckCXXCompilerFlag) if (MSVC) - add_compile_options(/Zc:preprocessor /EHsc /W4 + add_compile_options(/EHsc /W4 /wd4100 /wd4127 /wd4242 /wd4244 /wd4245 /wd4267 /wd4365 /wd4456 /wd4459 /wd4464 /wd4505 /wd4514 /wd4571 /wd4619 /wd4623 /wd4625 /wd4626 /wd4706 /wd4710 /wd4774 /wd4820 /wd4946 /wd5026 /wd5027) @@ -298,6 +298,9 @@ set_property(TARGET ${PROJECT_NAME} APPEND PROPERTY COMPATIBLE_INTERFACE_STRING ${PROJECT_NAME}_MAJOR_VERSION) target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_20) +if (MSVC) + target_compile_options(${PROJECT_NAME} PUBLIC /Zc:preprocessor) +endif() # Don't use PCH w/GCC (https://bugzilla.redhat.com/show_bug.cgi?id=1721553#c34) if (NOT CMAKE_CXX_COMPILER_ID STREQUAL GNU) |