try_compile: Improve error message consistency

Tweak some error messages from try_compile (and try_run) to be more
consistent with each other.
This commit is contained in:
Matthew Woehlke
2022-09-16 15:29:35 -04:00
parent 3436858697
commit 30a234d275
3 changed files with 5 additions and 5 deletions

View File

@@ -403,19 +403,19 @@ bool cmCoreTryCompile::TryCompileCode(Arguments& arguments,
this->Makefile->IssueMessage(
MessageType::FATAL_ERROR,
cmStrCat(arguments.LangProps.begin()->first,
" allowed only in source file signature."));
" allowed only in source file signature"));
return false;
}
if (!arguments.CompileDefs.empty()) {
this->Makefile->IssueMessage(
MessageType::FATAL_ERROR,
"COMPILE_DEFINITIONS specified on a srcdir type TRY_COMPILE");
"COMPILE_DEFINITIONS allowed only in source file signature");
return false;
}
if (arguments.CopyFileTo) {
this->Makefile->IssueMessage(
MessageType::FATAL_ERROR,
"COPY_FILE specified on a srcdir type TRY_COMPILE");
"COPY_FILE allowed only in source file signature");
return false;
}
}

View File

@@ -1,4 +1,4 @@
CMake Error at NonSourceCompileDefinitions.cmake:[0-9]+ \(try_compile\):
COMPILE_DEFINITIONS specified on a srcdir type TRY_COMPILE
COMPILE_DEFINITIONS allowed only in source file signature
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)

View File

@@ -1,4 +1,4 @@
CMake Error at NonSourceCopyFile.cmake:[0-9]+ \(try_compile\):
COPY_FILE specified on a srcdir type TRY_COMPILE
COPY_FILE allowed only in source file signature
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)