Merge topic 'swift-with-interface-libs'

601fe84bd1 Swift: Restore support for enabling with INTERFACE libraries

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Wanderley Guimarães da Silva <wanderley.guimaraes@gmail.com>
Acked-by: Guillaume Egles <gegles@gmail.com>
Merge-request: !3624
This commit is contained in:
Brad King 2019-07-30 15:38:05 +00:00 committed by Kitware Robot
commit e4193adf29
2 changed files with 12 additions and 8 deletions

View File

@ -337,15 +337,16 @@ bool cmGlobalGenerator::CheckTargetsForType() const
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();
}
if (target->GetType() == cmStateEnums::EXECUTABLE &&
target->GetPropertyAsBool("WIN32_EXECUTABLE")) {
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")) {
for (std::string const& config : configs) {
if (target->GetLinkerLanguage(config) == "Swift") {
this->GetCMakeInstance()->IssueMessage(
MessageType::FATAL_ERROR,
"WIN32_EXECUTABLE property is not supported on Swift "

View File

@ -8,3 +8,6 @@ elseif(NOT XCODE_VERSION VERSION_LESS 8.0)
endif()
add_executable(SwiftOnly main.swift)
# Dummy to make sure generation works with such targets.
add_library(SwiftIface INTERFACE)