summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalCommonGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-05-15 15:51:57 (GMT)
committerBrad King <brad.king@kitware.com>2017-05-15 15:51:57 (GMT)
commiteeb47fbeb203117111bee8f6690a5f272209d104 (patch)
treedc35ca28c9f5c1f8c7e9de944cc8c681c8de7dd3 /Source/cmLocalCommonGenerator.cxx
parent471779764757a3a6e4b5fb1db9b8943630b18f3d (diff)
downloadCMake-eeb47fbeb203117111bee8f6690a5f272209d104.zip
CMake-eeb47fbeb203117111bee8f6690a5f272209d104.tar.gz
CMake-eeb47fbeb203117111bee8f6690a5f272209d104.tar.bz2
cmLocalCommonGenerator: Save CMAKE_BUILD_TYPE on construction
Copy the value to our `ConfigName` member on construction to ensure it is available even to code paths that run before `Generate`. We once needed to delay this lookup until `Generate` because the local generators were at one time created before `Configure`. Now they are created at generate time which is late enough to expect `CMAKE_BUILD_TYPE` to be available. Without this, `cmGlobalUnixMakefileGenerator3::WriteConvenienceRules` causes use of `ConfigName` before it is populated which breaks use of source files that depend on the `$<CONFIG>` generator expression. Fixes: #16889
Diffstat (limited to 'Source/cmLocalCommonGenerator.cxx')
-rw-r--r--Source/cmLocalCommonGenerator.cxx12
1 files changed, 4 insertions, 8 deletions
diff --git a/Source/cmLocalCommonGenerator.cxx b/Source/cmLocalCommonGenerator.cxx
index d5f9d27..6524db4 100644
--- a/Source/cmLocalCommonGenerator.cxx
+++ b/Source/cmLocalCommonGenerator.cxx
@@ -16,14 +16,6 @@ cmLocalCommonGenerator::cmLocalCommonGenerator(cmGlobalGenerator* gg,
: cmLocalGenerator(gg, mf)
, WorkingDirectory(wd)
{
-}
-
-cmLocalCommonGenerator::~cmLocalCommonGenerator()
-{
-}
-
-void cmLocalCommonGenerator::SetConfigName()
-{
// Store the configuration name that will be generated.
if (const char* config = this->Makefile->GetDefinition("CMAKE_BUILD_TYPE")) {
// Use the build type given by the user.
@@ -34,6 +26,10 @@ void cmLocalCommonGenerator::SetConfigName()
}
}
+cmLocalCommonGenerator::~cmLocalCommonGenerator()
+{
+}
+
std::string cmLocalCommonGenerator::GetTargetFortranFlags(
cmGeneratorTarget const* target, std::string const& config)
{