summaryrefslogtreecommitdiff
path: root/Source/cmNinjaNormalTargetGenerator.cxx
diff options
context:
space:
mode:
authorSaleem Abdulrasool <compnerd@compnerd.org>2020-02-01 13:33:38 -0800
committerSaleem Abdulrasool <compnerd@compnerd.org>2020-02-01 17:25:57 -0800
commit1e26d57188d5cd4be6869a0602e6021c4b2bd3e3 (patch)
treed055578c66f059525c4ced395dccf9acd969773e /Source/cmNinjaNormalTargetGenerator.cxx
parent7edad7bfa2e74044cc6430ba796d1fbfefb8d0d2 (diff)
downloadcmake-1e26d57188d5cd4be6869a0602e6021c4b2bd3e3.tar.gz
Ninja: properly handle exports from Swift exes
This adds logic to properly handle Swift executables. Only executables marked as exporting symbols will now generate module interfaces for the executable.
Diffstat (limited to 'Source/cmNinjaNormalTargetGenerator.cxx')
-rw-r--r--Source/cmNinjaNormalTargetGenerator.cxx13
1 files changed, 10 insertions, 3 deletions
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index 437548a364..3126d5f65a 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -550,16 +550,23 @@ std::vector<std::string> cmNinjaNormalTargetGenerator::ComputeLinkCmd(
linkCmds.push_back(cmakeCommand + " -E touch $TARGET_FILE");
}
#endif
- return linkCmds;
- }
+ } break;
case cmStateEnums::SHARED_LIBRARY:
case cmStateEnums::MODULE_LIBRARY:
+ break;
case cmStateEnums::EXECUTABLE:
+ if (this->TargetLinkLanguage(config) == "Swift") {
+ if (this->GeneratorTarget->IsExecutableWithExports()) {
+ const std::string flags =
+ this->Makefile->GetSafeDefinition("CMAKE_EXE_EXPORTS_Swift_FLAG");
+ cmExpandList(flags, linkCmds);
+ }
+ }
break;
default:
assert(false && "Unexpected target type");
}
- return std::vector<std::string>();
+ return linkCmds;
}
void cmNinjaNormalTargetGenerator::WriteDeviceLinkStatement(