mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-05 13:50:10 -05:00
Merge topic 'executables-are-consoled'
b06f4c8a74 Swift: disallow WIN32_EXECUTABLE properties
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3410
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
@@ -609,6 +609,7 @@ private:
|
||||
virtual void ForceLinkerLanguages();
|
||||
|
||||
bool CheckTargetsForMissingSources() const;
|
||||
bool CheckTargetsForType() const;
|
||||
|
||||
void CreateLocalGenerators();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user