From kde-commits Thu Aug 02 06:16:25 2012 From: =?utf-8?q?Lubo=C5=A1=20Lu=C5=88=C3=A1k?= Date: Thu, 02 Aug 2012 06:16:25 +0000 To: kde-commits Subject: icecream/client Message-Id: <20120802061625.CB665AC7A9 () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=134388846329733 SVN commit 1308923 by lunakl: ICECC_EXTRAFILES, extra files to include in the environment Modelled after CCACHE_EXTRAFILES. To be used e.g. when a compiler plugin needs some extra file that would not be found by icecream otherwise. M +22 -0 main.cpp --- trunk/icecream/client/main.cpp #1308922:1308923 @@ -92,6 +92,7 @@ " ICECC_CLANG_REMOTE_CPP set to 1 or 0 to override remote precompiling with clang\n" " (requires clang -frewrite-includes option).\n" " ICECC_IGNORE_UNVERIFIED if set, hosts where environment cannot be verified are not used.\n" +" ICECC_EXTRAFILES additional files used in the compilation.\n" "\n"); } @@ -308,6 +309,27 @@ if ( icecc && !strcasecmp(icecc, "no") ) return build_local( job, 0 ); + if (const char *extrafilesenv = getenv("ICECC_EXTRAFILES")) { + for(;;) { + const char *colon = strchr(extrafilesenv, ':'); + string file; + if (colon == NULL) + file = extrafilesenv; + else + file = string( extrafilesenv, colon - extrafilesenv ); + struct stat st; + if (stat( file.c_str(), &st) == 0) + extrafiles.push_back( file ); + else { + log_warning() << "File in ICECC_EXTRAFILES not found: " << file << endl; + return build_local( job, 0 ); + } + if (colon == NULL) + break; + extrafilesenv = colon + 1; + } + } + /* try several options to reach the local daemon - 2 sockets, one TCP */ MsgChannel *local_daemon = Service::createChannel( "/var/run/iceccd.socket" ); if (!local_daemon) {