[Cmake-commits] CMake branch, next, updated. v3.6.0-954-ge5ec5ab
Brad King
brad.king at kitware.com
Thu Jul 21 11:05:29 EDT 2016
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, next has been updated
via e5ec5abd9bc13ee4b6a780e36e14887bb582d542 (commit)
via 13a6ff31becea16d567b23abc68bfa8aa75365ce (commit)
from 88ffcdd31eb075e4ae6f21a2af33e73a5520c570 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e5ec5abd9bc13ee4b6a780e36e14887bb582d542
commit e5ec5abd9bc13ee4b6a780e36e14887bb582d542
Merge: 88ffcdd 13a6ff3
Author: Brad King <brad.king at kitware.com>
AuthorDate: Thu Jul 21 11:05:28 2016 -0400
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Thu Jul 21 11:05:28 2016 -0400
Merge topic 'windows-export-all-fix-objlib' into next
13a6ff31 VS: Fix WINDOWS_EXPORT_ALL_SYMBOLS for object libraries
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=13a6ff31becea16d567b23abc68bfa8aa75365ce
commit 13a6ff31becea16d567b23abc68bfa8aa75365ce
Author: Brad King <brad.king at kitware.com>
AuthorDate: Wed Jul 20 11:26:55 2016 -0400
Commit: Brad King <brad.king at kitware.com>
CommitDate: Thu Jul 21 11:05:22 2016 -0400
VS: Fix WINDOWS_EXPORT_ALL_SYMBOLS for object libraries
Teach Visual Studio generators to include object files from object
libraries in the list of objects whose symbols are to be exported.
The Makefile and Ninja generators already did this. Update the
test to cover this case.
Reported-by: Bertrand Bellenot <Bertrand.Bellenot at cern.ch>
diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx
index 1bec581..7bdd74d 100644
--- a/Source/cmGlobalVisualStudioGenerator.cxx
+++ b/Source/cmGlobalVisualStudioGenerator.cxx
@@ -827,6 +827,7 @@ void cmGlobalVisualStudioGenerator::AddSymbolExportCommand(
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) {
@@ -836,6 +837,12 @@ void cmGlobalVisualStudioGenerator::AddSymbolExportCommand(
// 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);
+ }
+ 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());
diff --git a/Tests/RunCMake/AutoExportDll/AutoExport.cmake b/Tests/RunCMake/AutoExportDll/AutoExport.cmake
index bdddb38..d37e896 100644
--- a/Tests/RunCMake/AutoExportDll/AutoExport.cmake
+++ b/Tests/RunCMake/AutoExportDll/AutoExport.cmake
@@ -2,7 +2,9 @@ project(autoexport)
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${autoexport_BINARY_DIR}/bin)
add_subdirectory(sub)
-add_library(autoexport SHARED hello.cxx world.cxx foo.c)
+add_library(objlib OBJECT objlib.c)
+set_property(TARGET objlib PROPERTY POSITION_INDEPENDENT_CODE 1)
+add_library(autoexport SHARED hello.cxx world.cxx foo.c $<TARGET_OBJECTS:objlib>)
add_executable(say say.cxx)
if(MSVC)
diff --git a/Tests/RunCMake/AutoExportDll/objlib.c b/Tests/RunCMake/AutoExportDll/objlib.c
new file mode 100644
index 0000000..54a9658
--- /dev/null
+++ b/Tests/RunCMake/AutoExportDll/objlib.c
@@ -0,0 +1,4 @@
+int objlib()
+{
+ return 7;
+}
diff --git a/Tests/RunCMake/AutoExportDll/say.cxx b/Tests/RunCMake/AutoExportDll/say.cxx
index 9ca8d31..e966b1f 100644
--- a/Tests/RunCMake/AutoExportDll/say.cxx
+++ b/Tests/RunCMake/AutoExportDll/say.cxx
@@ -11,6 +11,7 @@ extern "C" {
int WINAPI foo();
// test regular C
int bar();
+int objlib();
}
// test c++ functions
@@ -39,6 +40,7 @@ int main()
foo();
printf("\n");
bar();
+ objlib();
printf("\n");
return 0;
}
-----------------------------------------------------------------------
Summary of changes:
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list