| 2242 | } |
| 2243 | |
| 2244 | void 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 | |
| 2264 | cmSystemTools::SaveRestoreEnvironment::SaveRestoreEnvironment() |
| 2265 | { |