summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-11-22 17:19:03 (GMT)
committerBrad King <brad.king@kitware.com>2021-11-22 17:50:42 (GMT)
commit5b1ed2a64650405127d434f6267fb10baf1401d4 (patch)
treefdea7d216b5f6b4d8f9b13cea1d816b4770a7445 /Source/cmGlobalGenerator.cxx
parentdeb9b076368512c1c7c391706f6f9e21cfb473f3 (diff)
downloadCMake-5b1ed2a64650405127d434f6267fb10baf1401d4.zip
CMake-5b1ed2a64650405127d434f6267fb10baf1401d4.tar.gz
CMake-5b1ed2a64650405127d434f6267fb10baf1401d4.tar.bz2
try_compile: Do not use CMAKE_BUILD_TYPE or CMAKE_CONFIGURATION_TYPES env vars
Since: * commit e216b9bbd3 (cmake: Allow CMAKE_BUILD_TYPE to be set by environment variable, 2021-06-29, v3.22.0-rc1~503^2~1) * commit ef56eefc9b (cmake: Allow CMAKE_CONFIGURATION_TYPES to be set by environment variable, 2021-06-29, v3.22.0-rc1~503^2) the environment variables are supposed to provide defaults for settings the user otherwise can control via cache entries. However, they accidentally affect `try_compile` projects too, which are supposed to be programmatically controlled. Fixes: #22935
Diffstat (limited to 'Source/cmGlobalGenerator.cxx')
-rw-r--r--Source/cmGlobalGenerator.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 9914902..97ad7ab 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -498,7 +498,8 @@ bool cmGlobalGenerator::CheckLanguages(
void cmGlobalGenerator::EnableLanguage(
std::vector<std::string> const& languages, cmMakefile* mf, bool optional)
{
- if (!this->IsMultiConfig()) {
+ if (!this->IsMultiConfig() &&
+ !this->GetCMakeInstance()->GetIsInTryCompile()) {
std::string envBuildType;
if (!mf->GetDefinition("CMAKE_BUILD_TYPE") &&
cmSystemTools::GetEnv("CMAKE_BUILD_TYPE", envBuildType)) {