[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: icecream/client
From: Luboš Luňák <l.lunak () kde ! org>
Date: 2012-03-30 11:47:34
Message-ID: 20120330114734.CA2C9AC899 () svn ! kde ! org
[Download RAW message or body]
SVN commit 1287631 by lunakl:
recognize compiler in 'icecc <compiler> <args>'
M +21 -1 main.cpp
--- trunk/icecream/client/main.cpp #1287630:1287631
@@ -224,9 +224,29 @@
}
if ( arg == "--build-native" )
return create_native();
- if ( arg.size() > 0 && arg.at(0) == '/' )
+ if ( arg.size() > 0 ) {
+ if ( arg.at(0) == '/' )
job.setCompilerName(arg);
+ else {
+ const char* env;
+ if ( (env = getenv( "ICECC_CC" )) && env == arg )
+ job.setCompilerName(arg);
+ if ( (env = getenv( "ICECC_CXX" )) && env == arg )
+ job.setCompilerName(arg);
+ if ( arg.at(0) != '-' && arg.find( '/' ) == string::npos ) {
+ char* path = getenv( "PATH" );
+ for( char* dir = strtok( path, ":" ); dir;
+ dir = strtok( NULL, ":" )) {
+ if ( access(( string( dir ) + "/" + arg ).c_str(),
+ X_OK ) == 0 ) {
+ job.setCompilerName( arg );
+ break;
}
+ }
+ }
+ }
+ }
+ }
} else if ( find_basename( compiler_name ) == "icerun") {
icerun = true;
if ( argc > 1 ) {
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic