diff options
author | Brad King <brad.king@kitware.com> | 2021-05-25 14:03:32 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2021-05-25 14:04:00 (GMT) |
commit | 909b7a3eca08e3c558012000055f8c1676eb8e50 (patch) | |
tree | 9b1c3a8f4c0c55b740f7a5d6ebbe509432ae0167 /Source | |
parent | bf2717e436ff2fceaaaf3a9e032d5f10c7dc8d06 (diff) | |
parent | c3bd5a6a2cb0f08d125655967a2f52bdd551ae6b (diff) | |
download | CMake-909b7a3eca08e3c558012000055f8c1676eb8e50.zip CMake-909b7a3eca08e3c558012000055f8c1676eb8e50.tar.gz CMake-909b7a3eca08e3c558012000055f8c1676eb8e50.tar.bz2 |
Merge topic 'cmake-gui-cc-cxx-env'
c3bd5a6a2c cmake-gui: Unset empty CC,CXX on global generator change
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6151
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmake.cxx | 9 |
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 |