MCPcopy Create free account
hub / github.com/Kitware/CMake / ApplyToCurrentEnv

Method ApplyToCurrentEnv

Source/cmSystemTools.cxx:2244–2262  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2242}
2243
2244void cmSystemTools::EnvDiff::ApplyToCurrentEnv(std::ostringstream* measurement)
2245{
2246 for (auto const& env_apply : diff) {
2247 if (env_apply.second) {
2248 auto const env_update =
2249 cmStrCat(env_apply.first, '=', *env_apply.second);
2250 cmSystemTools::PutEnv(env_update);
2251 if (measurement) {
2252 *measurement << env_update << std::endl;
2253 }
2254 } else {
2255 cmSystemTools::UnsetEnv(env_apply.first.c_str());
2256 if (measurement) {
2257 // Signify that this variable is being actively unset
2258 *measurement << '#' << env_apply.first << "=\n";
2259 }
2260 }
2261 }
2262}
2263
2264cmSystemTools::SaveRestoreEnvironment::SaveRestoreEnvironment()
2265{

Callers 2

ExecuteCMakeCommandMethod · 0.80
ForkProcessMethod · 0.80

Calls 2

c_strMethod · 0.80
cmStrCatFunction · 0.70

Tested by 1

ForkProcessMethod · 0.64