From: Luboš Luňák Date: Tue, 30 Nov 2021 19:47:14 +0000 (+0100) Subject: fix: Ignore CCACHE_NOCPP2=1 with MSVC (#970) X-Git-Tag: v4.6~71 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=543a919a4cbe641bfce0927609d767bc5fc8ea31;p=thirdparty%2Fccache.git fix: Ignore CCACHE_NOCPP2=1 with MSVC (#970) --- diff --git a/doc/MANUAL.adoc b/doc/MANUAL.adoc index c63b91c64..2fef6762b 100644 --- a/doc/MANUAL.adoc +++ b/doc/MANUAL.adoc @@ -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*):: diff --git a/src/ccache.cpp b/src/ccache.cpp index eca0c91bd..413f17e73 100644 --- a/src/ccache.cpp +++ b/src/ccache.cpp @@ -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"