/* can we safely use the unification hashing backend? */
static bool enable_unify;
-/*
- * Whether we should use the optimization of passing the already existing
- * preprocessed source code to the compiler.
- */
-static bool compile_preprocessed_source_code;
-
/* Whether the output is a precompiled header */
static bool output_is_precompiled_header = false;
* unsetenv() is on BSD and Linux but not portable. */
putenv("DEPENDENCIES_OUTPUT");
- if (compile_preprocessed_source_code) {
- args_add(args, i_tmpfile);
- } else {
+ if (conf->run_second_cpp) {
args_add(args, input_file);
+ } else {
+ args_add(args, i_tmpfile);
}
cc_log("Running real compiler");
i_tmpfile = path_stdout;
- if (compile_preprocessed_source_code) {
+ if (conf->run_second_cpp) {
+ tmp_unlink(path_stderr);
+ free(path_stderr);
+ } else {
/*
* If we are using the CPP trick, we need to remember this
* stderr data and output it just before the main stderr from
* the compiler pass.
*/
cpp_stderr = path_stderr;
- } else {
- tmp_unlink(path_stderr);
- free(path_stderr);
}
result = x_malloc(sizeof(*result));
* have non-zero lineno when using -g3").
*/
cc_log("%s used; not compiling preprocessed code", argv[i]);
- compile_preprocessed_source_code = false;
+ conf->run_second_cpp = true;
}
continue;
}
if (output_is_precompiled_header) {
/* It doesn't work to create the .gch from preprocessed source. */
cc_log("Creating precompiled header; not compiling preprocessed code");
- compile_preprocessed_source_code = false;
+ conf->run_second_cpp = true;
}
if (str_eq(conf->cpp_extension, "")) {
}
}
- if (compile_preprocessed_source_code) {
+ if (conf->run_second_cpp) {
+ *compiler_args = args_copy(*preprocessor_args);
+ } else {
*compiler_args = args_copy(stripped_args);
if (explicit_language) {
/*
args_add(*compiler_args, "-x");
args_add(*compiler_args, p_language_for_language(explicit_language));
}
- } else {
- *compiler_args = args_copy(*preprocessor_args);
}
if (found_c_opt) {
free(cpp_stderr); cpp_stderr = NULL;
free(stats_file); stats_file = NULL;
enable_unify = false;
- compile_preprocessed_source_code = false;
output_is_precompiled_header = false;
initialize();
failed();
}
- compile_preprocessed_source_code = !getenv("CCACHE_CPP2");
-
setup_uncached_err();
find_compiler(argc, argv);