summaryrefslogtreecommitdiffstats
path: root/Source/cmCoreTryCompile.cxx
diff options
context:
space:
mode:
authorMatthew Woehlke <matthew.woehlke@kitware.com>2022-09-30 18:50:25 (GMT)
committerMatthew Woehlke <matthew.woehlke@kitware.com>2022-09-30 18:50:25 (GMT)
commit0f28653ba9dea36564dbd41388536982c56a96eb (patch)
treef1655de6a7ed6c16a41eec3eb918a42ab9f9f006 /Source/cmCoreTryCompile.cxx
parentcadcb6a5f0e1ebaefd74f8c52151e410c57cfa96 (diff)
downloadCMake-0f28653ba9dea36564dbd41388536982c56a96eb.zip
CMake-0f28653ba9dea36564dbd41388536982c56a96eb.tar.gz
CMake-0f28653ba9dea36564dbd41388536982c56a96eb.tar.bz2
try_compile: Rename SOURCE_FROM_ARG -> SOURCE_FROM_CONTENT
Change the SOURCE_FROM_ARG keyword to try_compile to SOURCE_FROM_CONTENT (which we can do because it was recently added and hasn't been in a release yet). The new name should be clearer as to what it does, and also more consistent with the CONTENT arguments to some other commands. Also, fix a typo in an error message.
Diffstat (limited to 'Source/cmCoreTryCompile.cxx')
-rw-r--r--Source/cmCoreTryCompile.cxx19
1 files changed, 10 insertions, 9 deletions
diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx
index 323790e..cdf8efa 100644
--- a/Source/cmCoreTryCompile.cxx
+++ b/Source/cmCoreTryCompile.cxx
@@ -173,7 +173,7 @@ auto const TryCompileBaseSourcesArgParser =
auto const TryCompileBaseNewSourcesArgParser =
cmArgumentParser<Arguments>{ TryCompileBaseSourcesArgParser }
- .Bind("SOURCE_FROM_ARG"_s, &Arguments::SourceFromArg)
+ .Bind("SOURCE_FROM_CONTENT"_s, &Arguments::SourceFromContent)
.Bind("SOURCE_FROM_VAR"_s, &Arguments::SourceFromVar)
.Bind("SOURCE_FROM_FILE"_s, &Arguments::SourceFromFile)
/* keep semicolon on own line */;
@@ -402,10 +402,11 @@ bool cmCoreTryCompile::TryCompileCode(Arguments& arguments,
}
if (this->SrcFileSignature) {
- if (arguments.SourceFromArg && arguments.SourceFromArg->size() % 2) {
+ if (arguments.SourceFromContent &&
+ arguments.SourceFromContent->size() % 2) {
this->Makefile->IssueMessage(
MessageType::FATAL_ERROR,
- "SOURCE_FROM_ARG requires exactly two arguments");
+ "SOURCE_FROM_CONTENT requires exactly two arguments");
return false;
}
if (arguments.SourceFromVar && arguments.SourceFromVar->size() % 2) {
@@ -476,12 +477,12 @@ bool cmCoreTryCompile::TryCompileCode(Arguments& arguments,
} else if (arguments.SourceDirectoryOrFile) {
sources.emplace_back(*arguments.SourceDirectoryOrFile);
}
- if (arguments.SourceFromArg) {
- auto const k = arguments.SourceFromArg->size();
+ if (arguments.SourceFromContent) {
+ auto const k = arguments.SourceFromContent->size();
for (auto i = decltype(k){ 0 }; i < k; i += 2) {
- const auto& name = (*arguments.SourceFromArg)[i + 0];
- const auto& content = (*arguments.SourceFromArg)[i + 1];
- auto out = this->WriteSource(name, content, "SOURCES_FROM_ARG");
+ const auto& name = (*arguments.SourceFromContent)[i + 0];
+ const auto& content = (*arguments.SourceFromContent)[i + 1];
+ auto out = this->WriteSource(name, content, "SOURCE_FROM_CONTENT");
if (out.empty()) {
return false;
}
@@ -494,7 +495,7 @@ bool cmCoreTryCompile::TryCompileCode(Arguments& arguments,
const auto& name = (*arguments.SourceFromVar)[i + 0];
const auto& var = (*arguments.SourceFromVar)[i + 1];
const auto& content = this->Makefile->GetDefinition(var);
- auto out = this->WriteSource(name, content, "SOURCES_FROM_VAR");
+ auto out = this->WriteSource(name, content, "SOURCE_FROM_VAR");
if (out.empty()) {
return false;
}