summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalVisualStudioGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-03-09 20:56:30 (GMT)
committerBrad King <brad.king@kitware.com>2017-03-09 21:25:15 (GMT)
commitf36eaf6a6eb8a7ef1127ad43e419896be89f0e39 (patch)
treed51a6a1ab0d1c894137b71f2c2b732cb7f238a32 /Source/cmGlobalVisualStudioGenerator.cxx
parent25d261efa7c80ce7d9cbcb8b94d5d4a77cb12aaf (diff)
downloadCMake-f36eaf6a6eb8a7ef1127ad43e419896be89f0e39.zip
CMake-f36eaf6a6eb8a7ef1127ad43e419896be89f0e39.tar.gz
CMake-f36eaf6a6eb8a7ef1127ad43e419896be89f0e39.tar.bz2
Refactor WINDOWS_EXPORT_ALL_SYMBOLS implementation
Use `cmGeneratorTarget::ModuleDefinitionInfo` to combine the implementation of `WINDOWS_EXPORT_ALL_SYMBOLS` with that of using a `.def` file as a source. Only one of these could be used within a single target before anyway.
Diffstat (limited to 'Source/cmGlobalVisualStudioGenerator.cxx')
-rw-r--r--Source/cmGlobalVisualStudioGenerator.cxx12
1 files changed, 8 insertions, 4 deletions
diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx
index ced0c26..a073426 100644
--- a/Source/cmGlobalVisualStudioGenerator.cxx
+++ b/Source/cmGlobalVisualStudioGenerator.cxx
@@ -814,10 +814,14 @@ void cmGlobalVisualStudioGenerator::AddSymbolExportCommand(
cmGeneratorTarget* gt, std::vector<cmCustomCommand>& commands,
std::string const& configName)
{
+ cmGeneratorTarget::ModuleDefinitionInfo const* mdi =
+ gt->GetModuleDefinitionInfo(configName);
+ if (!mdi || !mdi->WindowsExportAllSymbols) {
+ return;
+ }
+
std::vector<std::string> outputs;
- std::string deffile = gt->ObjectDirectory;
- deffile += "/exportall.def";
- outputs.push_back(deffile);
+ outputs.push_back(mdi->DefFile);
std::vector<std::string> empty;
std::vector<cmSourceFile const*> objectSources;
gt->GetObjectSources(objectSources, configName);
@@ -835,7 +839,7 @@ void cmGlobalVisualStudioGenerator::AddSymbolExportCommand(
cmdl.push_back(cmakeCommand);
cmdl.push_back("-E");
cmdl.push_back("__create_def");
- cmdl.push_back(deffile);
+ cmdl.push_back(mdi->DefFile);
std::string obj_dir_expanded = obj_dir;
cmSystemTools::ReplaceString(obj_dir_expanded, this->GetCMakeCFGIntDir(),
configName.c_str());