]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Use single command line arg for /FI (#869)
authorMichael Kruse <github@meinersbur.de>
Sun, 20 Jun 2021 19:20:40 +0000 (14:20 -0500)
committerGitHub <noreply@github.com>
Sun, 20 Jun 2021 19:20:40 +0000 (21:20 +0200)
CMake seems to interpret /FI and its argument as two separate options.
For instance, CMake de-duplicates arguments, leading any to non-first
/FI flag to be removed. This might be the reason why the option is not
honored with Visual Studio 16.10.2 / CMake 3.20.3.

Fix by combining /FI and its argument into a single command line option.

cmake/StandardSettings.cmake

index b0fa8b5f7dc95d640a88a62fb403d62a35e118e4..8742be0bb8b22aa2009fd77648ccdc40c6fb05e4 100644 (file)
@@ -52,7 +52,7 @@ 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 "/FI${CMAKE_BINARY_DIR}/config.h")
 
   target_compile_options(
     standard_settings