summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-07-13 13:26:33 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2016-07-13 13:26:33 (GMT)
commit40f24f0ec266c15f8e887cb7e2be957b23d32c6a (patch)
treece34ee18e51424d6e5240bff92a27c09510fdcae /Tests
parent43875ca59ce4084bd1bd857e4d3e1c18b682a466 (diff)
parent9da725cb00d25c7d3f45e8ee8c943ec5241d6227 (diff)
downloadCMake-40f24f0ec266c15f8e887cb7e2be957b23d32c6a.zip
CMake-40f24f0ec266c15f8e887cb7e2be957b23d32c6a.tar.gz
CMake-40f24f0ec266c15f8e887cb7e2be957b23d32c6a.tar.bz2
Merge topic 'windows-export-all-from-exe'
9da725cb Windows: Honor WINDOWS_EXPORT_ALL_SYMBOLS for executables with exports 2005b960 Makefile: Factor out WINDOWS_EXPORT_ALL_SYMBOLS helper
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/AutoExportDll/AutoExport.cmake6
-rw-r--r--Tests/RunCMake/AutoExportDll/hello2.c8
-rw-r--r--Tests/RunCMake/AutoExportDll/say.cxx8
3 files changed, 22 insertions, 0 deletions
diff --git a/Tests/RunCMake/AutoExportDll/AutoExport.cmake b/Tests/RunCMake/AutoExportDll/AutoExport.cmake
index 3b2b2c5..bdddb38 100644
--- a/Tests/RunCMake/AutoExportDll/AutoExport.cmake
+++ b/Tests/RunCMake/AutoExportDll/AutoExport.cmake
@@ -3,5 +3,11 @@ 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_executable(say say.cxx)
+if(MSVC)
+ set_target_properties(say PROPERTIES ENABLE_EXPORTS ON)
+ add_library(autoexport_for_exec SHARED hello2.c)
+ target_link_libraries(autoexport_for_exec say)
+endif()
target_link_libraries(say autoexport autoexport2)
diff --git a/Tests/RunCMake/AutoExportDll/hello2.c b/Tests/RunCMake/AutoExportDll/hello2.c
new file mode 100644
index 0000000..d4d6b72
--- /dev/null
+++ b/Tests/RunCMake/AutoExportDll/hello2.c
@@ -0,0 +1,8 @@
+#include <stdio.h>
+
+extern int own_auto_export_function(int i);
+
+void hello2()
+{
+ printf("hello exec:%i", own_auto_export_function(41));
+}
diff --git a/Tests/RunCMake/AutoExportDll/say.cxx b/Tests/RunCMake/AutoExportDll/say.cxx
index 0178688..9ca8d31 100644
--- a/Tests/RunCMake/AutoExportDll/say.cxx
+++ b/Tests/RunCMake/AutoExportDll/say.cxx
@@ -18,6 +18,14 @@ int bar();
void hello();
void world();
+// test exports for executable target
+extern "C" {
+int own_auto_export_function(int i)
+{
+ return i + 1;
+}
+}
+
int main()
{
// test static data (needs declspec to work)