Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions client/arg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,7 @@ int analyse_argv(const char * const *argv, CompileJob &job, bool icerun, list<st
bool wunused_macros = false;
bool seen_arch = false;
bool seen_pedantic = false;
bool seen_imacros = false;
bool seen_march_native = false;
bool seen_mcpu_native = false;
bool seen_mtune_native = false;
Expand Down Expand Up @@ -554,6 +555,9 @@ int analyse_argv(const char * const *argv, CompileJob &job, bool icerun, list<st
|| str_equal("-iwithprefixbefore", a)
|| str_equal("--include-with-prefix-before", a)
|| str_equal("-iwithsysroot", a)) {
if (str_equal("-imacros", a)) {
seen_imacros = true;
}
args.append(a, Arg_Local);

assert( is_argument_with_space( a ));
Expand Down Expand Up @@ -888,6 +892,12 @@ int analyse_argv(const char * const *argv, CompileJob &job, bool icerun, list<st
job.setBlockRewriteIncludes(true);
}

// -imacros doesn't define any macros when used with remote preprocessing
if ( seen_imacros ) {
log_warning() << "argument -imacros, forcing local preprocessing" << endl;
job.setBlockRewriteIncludes(true);
}

// -pedantic doesn't work with remote preprocessing, if extensions to a named standard
// are allowed. GCC allows GNU extensions by default, so let's check if a standard
// other than eg gnu11 or gnu++14 was specified.
Expand Down