From: jacobly0 Date: Sun, 1 May 2022 19:23:32 +0000 (+0200) Subject: build: Fix build arguments to clang-cl (#1054) X-Git-Tag: v4.6.1~27 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=62f024f351ce55b46bbe7d7a5eb89b5d93772747;p=thirdparty%2Fccache.git build: Fix build arguments to clang-cl (#1054) --- diff --git a/cmake/StandardSettings.cmake b/cmake/StandardSettings.cmake index 4dfc7e1d3..83871af82 100644 --- a/cmake/StandardSettings.cmake +++ b/cmake/StandardSettings.cmake @@ -3,12 +3,16 @@ add_library(standard_settings INTERFACE) -if(CMAKE_CXX_COMPILER_ID MATCHES "^GNU|(Apple)?Clang$") +if(MSVC) + target_compile_options(standard_settings INTERFACE "/FI${CMAKE_BINARY_DIR}/config.h") +else() target_compile_options( standard_settings INTERFACE -include ${CMAKE_BINARY_DIR}/config.h ) +endif() +if(CMAKE_CXX_COMPILER_ID MATCHES "^GNU|(Apple)?Clang$") option(ENABLE_COVERAGE "Enable coverage reporting for GCC/Clang" FALSE) if(ENABLE_COVERAGE) target_compile_options(standard_settings INTERFACE --coverage -O0 -g) @@ -52,8 +56,6 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "^GNU|(Apple)?Clang$") include(StdAtomic) elseif(MSVC) - target_compile_options(standard_settings INTERFACE "/FI${CMAKE_BINARY_DIR}/config.h") - target_compile_options( standard_settings INTERFACE /Zc:preprocessor /Zc:__cplusplus /D_CRT_SECURE_NO_WARNINGS