summaryrefslogtreecommitdiffstats
path: root/Source/cmNinjaTargetGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-03-13 15:54:30 (GMT)
committerBrad King <brad.king@kitware.com>2017-03-21 14:02:34 (GMT)
commit075f6454092ae058add228eda8220a3680b2f9e4 (patch)
treec0bff4ce5eaf25b8e38d904f3cfb64ebfc13265b /Source/cmNinjaTargetGenerator.cxx
parent21c4ec4ffe1c40382f6b435ff49eade31e1137f2 (diff)
downloadCMake-075f6454092ae058add228eda8220a3680b2f9e4.zip
CMake-075f6454092ae058add228eda8220a3680b2f9e4.tar.gz
CMake-075f6454092ae058add228eda8220a3680b2f9e4.tar.bz2
Support WINDOWS_EXPORT_ALL_SYMBOLS with `.def` files
The `WINDOWS_EXPORT_ALL_SYMBOLS` target property exports all symbols found in object files explicitly given to the linker. However, the linker may also find additional symbols in dependencies and copy them into the linked binary (e.g. from `msvcrt.lib`). Provide a way to export an explicit list of such symbols by adding a `.def` file as a source file. Fixes: #16473
Diffstat (limited to 'Source/cmNinjaTargetGenerator.cxx')
-rw-r--r--Source/cmNinjaTargetGenerator.cxx12
1 files changed, 8 insertions, 4 deletions
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index 917383d..5866950 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -212,10 +212,14 @@ cmNinjaDeps cmNinjaTargetGenerator::ComputeLinkDeps() const
std::transform(deps.begin(), deps.end(), result.begin(), MapToNinjaPath());
// Add a dependency on the link definitions file, if any.
- cmGeneratorTarget::ModuleDefinitionInfo const* mdi =
- this->GeneratorTarget->GetModuleDefinitionInfo(this->GetConfigName());
- if (mdi && !mdi->WindowsExportAllSymbols && !mdi->DefFile.empty()) {
- result.push_back(this->ConvertToNinjaPath(mdi->DefFile));
+ if (cmGeneratorTarget::ModuleDefinitionInfo const* mdi =
+ this->GeneratorTarget->GetModuleDefinitionInfo(
+ this->GetConfigName())) {
+ for (std::vector<cmSourceFile const*>::const_iterator i =
+ mdi->Sources.begin();
+ i != mdi->Sources.end(); ++i) {
+ result.push_back(this->ConvertToNinjaPath((*i)->GetFullPath()));
+ }
}
// Add a dependency on user-specified manifest files, if any.