From 30a234d275be3947a14e5e109f66b83877730e23 Mon Sep 17 00:00:00 2001 From: Matthew Woehlke Date: Fri, 16 Sep 2022 15:29:35 -0400 Subject: try_compile: Improve error message consistency Tweak some error messages from try_compile (and try_run) to be more consistent with each other. --- Source/cmCoreTryCompile.cxx | 6 +++--- Tests/RunCMake/try_compile/NonSourceCompileDefinitions-stderr.txt | 2 +- Tests/RunCMake/try_compile/NonSourceCopyFile-stderr.txt | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx index 2f63b3c..3ef62a0 100644 --- a/Source/cmCoreTryCompile.cxx +++ b/Source/cmCoreTryCompile.cxx @@ -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; } } diff --git a/Tests/RunCMake/try_compile/NonSourceCompileDefinitions-stderr.txt b/Tests/RunCMake/try_compile/NonSourceCompileDefinitions-stderr.txt index 3e48411..dcd5c7a 100644 --- a/Tests/RunCMake/try_compile/NonSourceCompileDefinitions-stderr.txt +++ b/Tests/RunCMake/try_compile/NonSourceCompileDefinitions-stderr.txt @@ -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\) diff --git a/Tests/RunCMake/try_compile/NonSourceCopyFile-stderr.txt b/Tests/RunCMake/try_compile/NonSourceCopyFile-stderr.txt index 7de8c92..1b7dfeb 100644 --- a/Tests/RunCMake/try_compile/NonSourceCopyFile-stderr.txt +++ b/Tests/RunCMake/try_compile/NonSourceCopyFile-stderr.txt @@ -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\) -- cgit v0.12