summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalVisualStudioGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-03-22 12:48:56 (GMT)
committerKitware Robot <kwrobot@kitware.com>2017-03-22 12:49:09 (GMT)
commit989484d51fa78f0fc0014212148b52c90872f57e (patch)
tree8cceb3ea36d2478386c9b31ffd6dfd415c9c1e93 /Source/cmGlobalVisualStudioGenerator.cxx
parent053317480a12464d405490502dfde75c5fc17b1f (diff)
parent075f6454092ae058add228eda8220a3680b2f9e4 (diff)
downloadCMake-989484d51fa78f0fc0014212148b52c90872f57e.zip
CMake-989484d51fa78f0fc0014212148b52c90872f57e.tar.gz
CMake-989484d51fa78f0fc0014212148b52c90872f57e.tar.bz2
Merge topic 'module-def-and-WINDOWS_EXPORT_ALL_SYMBOLS'
075f6454 Support WINDOWS_EXPORT_ALL_SYMBOLS with `.def` files 21c4ec4f cmGlobalVisualStudioGenerator: Simplify __create_def command generation 24361a45 bindexplib: Add support for parsing and integrating `.def` files 845c4824 bindexplib: Add method for parsing and integrating `.def` files 4f90e793 bindexplib: Revise coding style of CMake-specific methods Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !581
Diffstat (limited to 'Source/cmGlobalVisualStudioGenerator.cxx')
-rw-r--r--Source/cmGlobalVisualStudioGenerator.cxx73
1 files changed, 41 insertions, 32 deletions
diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx
index 81d9765..32579aa 100644
--- a/Source/cmGlobalVisualStudioGenerator.cxx
+++ b/Source/cmGlobalVisualStudioGenerator.cxx
@@ -815,7 +815,7 @@ void cmGlobalVisualStudioGenerator::AddSymbolExportCommand(
{
cmGeneratorTarget::ModuleDefinitionInfo const* mdi =
gt->GetModuleDefinitionInfo(configName);
- if (!mdi || !mdi->WindowsExportAllSymbols) {
+ if (!mdi || !mdi->DefFileGenerated) {
return;
}
@@ -842,46 +842,55 @@ void cmGlobalVisualStudioGenerator::AddSymbolExportCommand(
std::string obj_dir_expanded = obj_dir;
cmSystemTools::ReplaceString(obj_dir_expanded, this->GetCMakeCFGIntDir(),
configName.c_str());
- std::string objs_file = obj_dir_expanded;
- cmSystemTools::MakeDirectory(objs_file.c_str());
- objs_file += "/objects.txt";
+ cmSystemTools::MakeDirectory(obj_dir_expanded);
+ std::string const objs_file = obj_dir_expanded + "/objects.txt";
cmdl.push_back(objs_file);
cmGeneratedFileStream fout(objs_file.c_str());
if (!fout) {
cmSystemTools::Error("could not open ", objs_file.c_str());
return;
}
- std::vector<std::string> objs;
- for (std::vector<cmSourceFile const*>::const_iterator it =
- objectSources.begin();
- it != objectSources.end(); ++it) {
- // Find the object file name corresponding to this source file.
- std::map<cmSourceFile const*, std::string>::const_iterator map_it =
- mapping.find(*it);
- // It must exist because we populated the mapping just above.
- assert(!map_it->second.empty());
- std::string objFile = obj_dir + map_it->second;
- objs.push_back(objFile);
- }
- std::vector<cmSourceFile const*> externalObjectSources;
- gt->GetExternalObjects(externalObjectSources, configName);
- for (std::vector<cmSourceFile const*>::const_iterator it =
- externalObjectSources.begin();
- it != externalObjectSources.end(); ++it) {
- objs.push_back((*it)->GetFullPath());
- }
- gt->UseObjectLibraries(objs, configName);
- for (std::vector<std::string>::iterator it = objs.begin(); it != objs.end();
- ++it) {
- std::string objFile = *it;
- // replace $(ConfigurationName) in the object names
- cmSystemTools::ReplaceString(objFile, this->GetCMakeCFGIntDir(),
- configName.c_str());
- if (cmHasLiteralSuffix(objFile, ".obj")) {
- fout << objFile << "\n";
+ if (mdi->WindowsExportAllSymbols) {
+ std::vector<std::string> objs;
+ for (std::vector<cmSourceFile const*>::const_iterator it =
+ objectSources.begin();
+ it != objectSources.end(); ++it) {
+ // Find the object file name corresponding to this source file.
+ std::map<cmSourceFile const*, std::string>::const_iterator map_it =
+ mapping.find(*it);
+ // It must exist because we populated the mapping just above.
+ assert(!map_it->second.empty());
+ std::string objFile = obj_dir + map_it->second;
+ objs.push_back(objFile);
+ }
+ std::vector<cmSourceFile const*> externalObjectSources;
+ gt->GetExternalObjects(externalObjectSources, configName);
+ for (std::vector<cmSourceFile const*>::const_iterator it =
+ externalObjectSources.begin();
+ it != externalObjectSources.end(); ++it) {
+ objs.push_back((*it)->GetFullPath());
+ }
+
+ gt->UseObjectLibraries(objs, configName);
+ for (std::vector<std::string>::iterator it = objs.begin();
+ it != objs.end(); ++it) {
+ std::string objFile = *it;
+ // replace $(ConfigurationName) in the object names
+ cmSystemTools::ReplaceString(objFile, this->GetCMakeCFGIntDir(),
+ configName.c_str());
+ if (cmHasLiteralSuffix(objFile, ".obj")) {
+ fout << objFile << "\n";
+ }
}
}
+
+ for (std::vector<cmSourceFile const*>::const_iterator i =
+ mdi->Sources.begin();
+ i != mdi->Sources.end(); ++i) {
+ fout << (*i)->GetFullPath() << "\n";
+ }
+
cmCustomCommandLines commandLines;
commandLines.push_back(cmdl);
cmCustomCommand command(gt->Target->GetMakefile(), outputs, empty, empty,