SVN commit 1288518 by lunakl: Find the compiler that should be actually used. Jobs already know what the compiler should be, so no need to search for it again (which may find a different one if ICECC_CC/CXX is not set). I think this change in practice makes ICECC_CC/CXX unnecessary. M +1 -0 client.h M +1 -1 cpp.cpp M +6 -5 local.cpp --- trunk/icecream/client/client.h #1288517:1288518 @@ -48,6 +48,7 @@ /* In local.cpp. */ extern int build_local (CompileJob& job, MsgChannel *daemon, struct rusage *usage =0); extern std::string find_compiler( CompileJob::Language lang ); +extern std::string find_compiler( const CompileJob& job ); /* In remote.cpp - permill is the probability it will be compiled three times */ extern int build_remote (CompileJob &job, MsgChannel *scheduler, const Environments &envs, int permill); --- trunk/icecream/client/cpp.cpp #1288517:1288518 @@ -117,7 +117,7 @@ argc++; // the program argc += 2; // -E file.i argv = new char*[argc + 1]; - argv[0] = strdup( find_compiler( job.language() ).c_str() ); + argv[0] = strdup( find_compiler( job ).c_str() ); int i = 1; for ( list::const_iterator it = flags.begin(); it != flags.end(); ++it) { --- trunk/icecream/client/local.cpp #1288517:1288518 @@ -123,6 +123,11 @@ return best_match; } +string find_compiler( const CompileJob& job ) +{ + return path_lookup(job.compilerName()); +} + string find_compiler( CompileJob::Language lang ) { string compiler = get_compiler_name( lang ); @@ -166,11 +171,7 @@ { list arguments; - string compiler_name; - if (job.language() != CompileJob::Lang_Custom ) - compiler_name = find_compiler( job.language() ); - else - compiler_name = path_lookup(job.compilerName()); + string compiler_name = find_compiler( job ); trace() << "invoking: " << compiler_name << endl;