summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-07-22 13:17:48 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2016-07-22 13:17:48 (GMT)
commit1fc340f0d4d9450d82631c876ab0f85bae220242 (patch)
treec6ea90ba4612f1ff6a1c83cd7acbad31ce79fdaa /Tests/RunCMake
parent3e7689ec392e6e22f60f9568181629077f74c4b6 (diff)
parent13a6ff31becea16d567b23abc68bfa8aa75365ce (diff)
downloadCMake-1fc340f0d4d9450d82631c876ab0f85bae220242.zip
CMake-1fc340f0d4d9450d82631c876ab0f85bae220242.tar.gz
CMake-1fc340f0d4d9450d82631c876ab0f85bae220242.tar.bz2
Merge topic 'windows-export-all-fix-objlib'
13a6ff31 VS: Fix WINDOWS_EXPORT_ALL_SYMBOLS for object libraries
Diffstat (limited to 'Tests/RunCMake')
-rw-r--r--Tests/RunCMake/AutoExportDll/AutoExport.cmake4
-rw-r--r--Tests/RunCMake/AutoExportDll/objlib.c4
-rw-r--r--Tests/RunCMake/AutoExportDll/say.cxx2
3 files changed, 9 insertions, 1 deletions
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;
}