Skip to content

Commit 055a782

Browse files
committed
Merge branch 'swift-with-interface-libs' into release-3.15
Merge-request: !3624
2 parents f43a7d7 + 601fe84 commit 055a782

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

Source/cmGlobalGenerator.cxx

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -339,15 +339,16 @@ bool cmGlobalGenerator::CheckTargetsForType() const
339339
bool failed = false;
340340
for (cmLocalGenerator* generator : this->LocalGenerators) {
341341
for (cmGeneratorTarget* target : generator->GetGeneratorTargets()) {
342-
std::vector<std::string> configs;
343-
target->Makefile->GetConfigurations(configs);
344-
if (configs.empty()) {
345-
configs.emplace_back();
346-
}
342+
if (target->GetType() == cmStateEnums::EXECUTABLE &&
343+
target->GetPropertyAsBool("WIN32_EXECUTABLE")) {
344+
std::vector<std::string> configs;
345+
target->Makefile->GetConfigurations(configs);
346+
if (configs.empty()) {
347+
configs.emplace_back();
348+
}
347349

348-
for (std::string const& config : configs) {
349-
if (target->GetLinkerLanguage(config) == "Swift") {
350-
if (target->GetPropertyAsBool("WIN32_EXECUTABLE")) {
350+
for (std::string const& config : configs) {
351+
if (target->GetLinkerLanguage(config) == "Swift") {
351352
this->GetCMakeInstance()->IssueMessage(
352353
MessageType::FATAL_ERROR,
353354
"WIN32_EXECUTABLE property is not supported on Swift "

Tests/SwiftOnly/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,6 @@ elseif(NOT XCODE_VERSION VERSION_LESS 8.0)
88
endif()
99

1010
add_executable(SwiftOnly main.swift)
11+
12+
# Dummy to make sure generation works with such targets.
13+
add_library(SwiftIface INTERFACE)

0 commit comments

Comments
 (0)