]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
build: Only inject config.h for C and C++, not assembler
authorJoel Rosdahl <joel@rosdahl.net>
Sun, 1 Mar 2026 14:45:46 +0000 (15:45 +0100)
committerJoel Rosdahl <joel@rosdahl.net>
Sun, 1 Mar 2026 15:16:33 +0000 (16:16 +0100)
Fixes #1599.

cmake/StandardSettings.cmake

index 430c237d674d70b9b35a2b8efaa4cc9783f3cd80..d1c6a4c1483621b37c2315bc7c0fec8fb6356aaa 100644 (file)
@@ -4,11 +4,18 @@
 add_library(standard_settings INTERFACE)
 
 if(MSVC)
-  target_compile_options(standard_settings INTERFACE "/FI${CMAKE_BINARY_DIR}/config.h")
+  target_compile_options(
+    standard_settings
+    INTERFACE
+      $<$<COMPILE_LANGUAGE:C>:-include /FI${CMAKE_BINARY_DIR}/config.h>
+      $<$<COMPILE_LANGUAGE:CXX>:-include /FI${CMAKE_BINARY_DIR}/config.h>
+  )
 else()
   target_compile_options(
     standard_settings
-    INTERFACE -include ${CMAKE_BINARY_DIR}/config.h
+    INTERFACE
+      $<$<COMPILE_LANGUAGE:C>:-include ${CMAKE_BINARY_DIR}/config.h>
+      $<$<COMPILE_LANGUAGE:CXX>:-include ${CMAKE_BINARY_DIR}/config.h>
   )
 endif()