]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
fix: Ignore CCACHE_NOCPP2=1 with MSVC (#970)
authorLuboš Luňák <l.lunak@centrum.cz>
Tue, 30 Nov 2021 19:47:14 +0000 (20:47 +0100)
committerGitHub <noreply@github.com>
Tue, 30 Nov 2021 19:47:14 +0000 (20:47 +0100)
doc/MANUAL.adoc
src/ccache.cpp

index c63b91c64ba20787ca6f4dbbf1acb5bf50bbca4b..2fef6762bdb3c92ed965afa601e8b3a2603dc260 100644 (file)
@@ -867,6 +867,9 @@ the compiler. This will cause the compiler to leave the macros and other
 preprocessor information, and only process the *#include* directives. When run
 in this way, the preprocessor arguments will be passed to the compiler since it
 still has to do _some_ preprocessing (like macros).
++
+This option is ignored with MSVC, as there is no way to make it compile without
+preprocessing first.
 
 [#config_secondary_storage]
 *secondary_storage* (*CCACHE_SECONDARY_STORAGE*)::
index eca0c91bd0d657598e727d56b11b7735faafda5a..413f17e73e3bacf0c7c884f23a20a7914bdc711b 100644 (file)
@@ -2046,6 +2046,12 @@ do_cache_compilation(Context& ctx, const char* const* argv)
 
   TRY(set_up_uncached_err());
 
+  if (!ctx.config.run_second_cpp()
+      && ctx.config.compiler_type() == CompilerType::cl) {
+    LOG_RAW("Second preprocessor cannot be disabled");
+    ctx.config.set_run_second_cpp(true);
+  }
+
   if (ctx.config.depend_mode()
       && (!ctx.args_info.generating_dependencies
           || ctx.args_info.output_dep == "/dev/null"