]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
build: Fix build arguments to clang-cl (#1054)
authorjacobly0 <jacobly0@users.noreply.github.com>
Sun, 1 May 2022 19:23:32 +0000 (21:23 +0200)
committerGitHub <noreply@github.com>
Sun, 1 May 2022 19:23:32 +0000 (21:23 +0200)
cmake/StandardSettings.cmake

index 4dfc7e1d35ef0d53d96e4b0ebd8e4895ceeeb647..83871af82e2e465d98e8bcbb55aaa77e4236d7e5 100644 (file)
@@ -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