summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-06-04 12:33:32 (GMT)
committerKitware Robot <kwrobot@kitware.com>2019-06-04 12:34:21 (GMT)
commit65f5df7d08f2c96d551f578ec509271888ecb7be (patch)
treef510f31963ce9b23b0aeaa5545f7355450131159 /Source
parent9ba901eb3c6579baaf2fec9996e0cbf7b5514fa7 (diff)
parentb06f4c8a745c96f19a9e9a7c7eb0ac22250472a2 (diff)
downloadCMake-65f5df7d08f2c96d551f578ec509271888ecb7be.zip
CMake-65f5df7d08f2c96d551f578ec509271888ecb7be.tar.gz
CMake-65f5df7d08f2c96d551f578ec509271888ecb7be.tar.bz2
Merge topic 'executables-are-consoled'
b06f4c8a74 Swift: disallow WIN32_EXECUTABLE properties Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3410
Diffstat (limited to 'Source')
-rw-r--r--Source/cmGlobalGenerator.cxx35
-rw-r--r--Source/cmGlobalGenerator.h1
2 files changed, 36 insertions, 0 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 26886f5..df0f33f 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -331,6 +331,37 @@ bool cmGlobalGenerator::CheckTargetsForMissingSources() const
return failed;
}
+bool cmGlobalGenerator::CheckTargetsForType() const
+{
+ if (!this->GetLanguageEnabled("Swift")) {
+ return false;
+ }
+ bool failed = false;
+ for (cmLocalGenerator* generator : this->LocalGenerators) {
+ for (cmGeneratorTarget* target : generator->GetGeneratorTargets()) {
+ std::vector<std::string> configs;
+ target->Makefile->GetConfigurations(configs);
+ if (configs.empty()) {
+ configs.emplace_back();
+ }
+
+ for (std::string const& config : configs) {
+ if (target->GetLinkerLanguage(config) == "Swift") {
+ if (target->GetPropertyAsBool("WIN32_EXECUTABLE")) {
+ this->GetCMakeInstance()->IssueMessage(
+ MessageType::FATAL_ERROR,
+ "WIN32_EXECUTABLE property is not supported on Swift "
+ "executables",
+ target->GetBacktrace());
+ failed = true;
+ }
+ }
+ }
+ }
+ }
+ return failed;
+}
+
bool cmGlobalGenerator::IsExportedTargetsFile(
const std::string& filename) const
{
@@ -1414,6 +1445,10 @@ bool cmGlobalGenerator::Compute()
return false;
}
+ if (this->CheckTargetsForType()) {
+ return false;
+ }
+
for (cmLocalGenerator* localGen : this->LocalGenerators) {
localGen->ComputeHomeRelativeOutputPath();
}
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h
index dcd8c5f..db96489 100644
--- a/Source/cmGlobalGenerator.h
+++ b/Source/cmGlobalGenerator.h
@@ -609,6 +609,7 @@ private:
virtual void ForceLinkerLanguages();
bool CheckTargetsForMissingSources() const;
+ bool CheckTargetsForType() const;
void CreateLocalGenerators();