From 8b0ee799e4cefd4aa008e6f251504eb541773a70 Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 28 Jun 2022 11:37:19 -0400 Subject: cmCoreTryCompile: Compute src-file signature build directory earlier --- Source/cmCoreTryCompile.cxx | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx index 63184a0..8d41f00 100644 --- a/Source/cmCoreTryCompile.cxx +++ b/Source/cmCoreTryCompile.cxx @@ -408,6 +408,11 @@ int cmCoreTryCompile::TryCompileCode(std::vector const& argv, this->BinaryDirectory.clear(); return -1; } + // compute the binary dir when TRY_COMPILE is called with a src file + // signature + if (this->SrcFileSignature) { + this->BinaryDirectory += "/CMakeFiles/CMakeTmp"; + } } else { this->Makefile->IssueMessage(MessageType::FATAL_ERROR, "No specified."); @@ -448,6 +453,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector const& argv, return -1; } + // only valid for srcfile signatures if (!this->SrcFileSignature) { if (!cState.Validate(this->Makefile)) { return -1; @@ -467,14 +473,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector const& argv, if (!objcxxState.Validate(this->Makefile)) { return -1; } - } - // compute the binary dir when TRY_COMPILE is called with a src file - // signature - if (this->SrcFileSignature) { - this->BinaryDirectory += "/CMakeFiles/CMakeTmp"; - } else { - // only valid for srcfile signatures if (!compileDefs.empty()) { this->Makefile->IssueMessage( MessageType::FATAL_ERROR, -- cgit v0.12