diff options
author | Saleem Abdulrasool <compnerd@compnerd.org> | 2020-02-01 21:33:38 (GMT) |
---|---|---|
committer | Saleem Abdulrasool <compnerd@compnerd.org> | 2020-02-02 01:25:57 (GMT) |
commit | 1e26d57188d5cd4be6869a0602e6021c4b2bd3e3 (patch) | |
tree | d055578c66f059525c4ced395dccf9acd969773e /Source/cmNinjaNormalTargetGenerator.cxx | |
parent | 7edad7bfa2e74044cc6430ba796d1fbfefb8d0d2 (diff) | |
download | CMake-1e26d57188d5cd4be6869a0602e6021c4b2bd3e3.zip CMake-1e26d57188d5cd4be6869a0602e6021c4b2bd3e3.tar.gz CMake-1e26d57188d5cd4be6869a0602e6021c4b2bd3e3.tar.bz2 |
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.cxx | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx index 437548a..3126d5f 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( |