summaryrefslogtreecommitdiffstats
path: root/Source/cmake.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmake.cxx')
-rw-r--r--Source/cmake.cxx9
1 files changed, 6 insertions, 3 deletions
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 315bd20..840a9d9 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -1751,17 +1751,20 @@ void cmake::SetGlobalGenerator(std::unique_ptr<cmGlobalGenerator> gg)
}
if (this->GlobalGenerator) {
// restore the original environment variables CXX and CC
- // Restore CC
std::string env = "CC=";
if (!this->CCEnvironment.empty()) {
env += this->CCEnvironment;
+ cmSystemTools::PutEnv(env);
+ } else {
+ cmSystemTools::UnPutEnv(env);
}
- cmSystemTools::PutEnv(env);
env = "CXX=";
if (!this->CXXEnvironment.empty()) {
env += this->CXXEnvironment;
+ cmSystemTools::PutEnv(env);
+ } else {
+ cmSystemTools::UnPutEnv(env);
}
- cmSystemTools::PutEnv(env);
}
// set the new