summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-09-24 14:46:13 (GMT)
committerBrad King <brad.king@kitware.com>2019-09-24 14:46:13 (GMT)
commit5a35a9c70d1dc92ec70a6ff454bc9441fa410968 (patch)
tree8a84197f29d61f8138766e5a0cf80ac315043a42
parent2f702beca1768292b3ecfc54cefde85cf44d1e61 (diff)
parent0578239d3a62ffb01a9b8cdb58f704b29725a1ee (diff)
downloadCMake-5a35a9c70d1dc92ec70a6ff454bc9441fa410968.zip
CMake-5a35a9c70d1dc92ec70a6ff454bc9441fa410968.tar.gz
CMake-5a35a9c70d1dc92ec70a6ff454bc9441fa410968.tar.bz2
Merge branch 'vs-16.4-custom-commands' into release-3.15
Merge-request: !3860
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx18
-rw-r--r--Source/cmVisualStudio10TargetGenerator.h2
2 files changed, 17 insertions, 3 deletions
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 7d25713..7a90176 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -1438,6 +1438,7 @@ void cmVisualStudio10TargetGenerator::WriteCustomRule(
}
// output files for custom command
std::stringstream outputs;
+ bool symbolic = false;
{
const char* sep = "";
for (std::string const& o : ccg.GetOutputs()) {
@@ -1445,6 +1446,12 @@ void cmVisualStudio10TargetGenerator::WriteCustomRule(
ConvertToWindowsSlash(out);
outputs << sep << out;
sep = ";";
+ if (!symbolic) {
+ if (cmSourceFile* sf = this->Makefile->GetSource(
+ o, cmSourceFileLocationKind::Known)) {
+ symbolic = sf->GetPropertyAsBool("SYMBOLIC");
+ }
+ }
}
}
if (this->ProjectType == csproj) {
@@ -1454,7 +1461,7 @@ void cmVisualStudio10TargetGenerator::WriteCustomRule(
outputs.str(), comment);
} else {
this->WriteCustomRuleCpp(*spe2, c, script, additional_inputs.str(),
- outputs.str(), comment);
+ outputs.str(), comment, symbolic);
}
}
}
@@ -1462,7 +1469,7 @@ void cmVisualStudio10TargetGenerator::WriteCustomRule(
void cmVisualStudio10TargetGenerator::WriteCustomRuleCpp(
Elem& e2, std::string const& config, std::string const& script,
std::string const& additional_inputs, std::string const& outputs,
- std::string const& comment)
+ std::string const& comment, bool symbolic)
{
const std::string cond = this->CalcCondition(config);
e2.WritePlatformConfigTag("Message", cond, comment);
@@ -1474,6 +1481,13 @@ void cmVisualStudio10TargetGenerator::WriteCustomRuleCpp(
// VS >= 11 let us turn off linking of custom command outputs.
e2.WritePlatformConfigTag("LinkObjects", cond, "false");
}
+ if (symbolic &&
+ this->LocalGenerator->GetVersion() >=
+ cmGlobalVisualStudioGenerator::VS16) {
+ // VS >= 16.4 warn if outputs are not created, but one of our
+ // outputs is marked SYMBOLIC and not expected to be created.
+ e2.WritePlatformConfigTag("VerifyInputsAndOutputsExist", cond, "false");
+ }
}
void cmVisualStudio10TargetGenerator::WriteCustomRuleCSharp(
diff --git a/Source/cmVisualStudio10TargetGenerator.h b/Source/cmVisualStudio10TargetGenerator.h
index 6607e77..d453d1a 100644
--- a/Source/cmVisualStudio10TargetGenerator.h
+++ b/Source/cmVisualStudio10TargetGenerator.h
@@ -142,7 +142,7 @@ private:
std::string const& script,
std::string const& additional_inputs,
std::string const& outputs,
- std::string const& comment);
+ std::string const& comment, bool symbolic);
void WriteCustomRuleCSharp(Elem& e0, std::string const& config,
std::string const& commandName,
std::string const& script,