summaryrefslogtreecommitdiffstats
path: root/Tests/ExportImport/Export
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/ExportImport/Export')
-rw-r--r--Tests/ExportImport/Export/Interface/CMakeLists.txt12
-rw-r--r--Tests/ExportImport/Export/Interface/source_target.cpp13
-rw-r--r--Tests/ExportImport/Export/Interface/source_target_for_install.cpp13
3 files changed, 37 insertions, 1 deletions
diff --git a/Tests/ExportImport/Export/Interface/CMakeLists.txt b/Tests/ExportImport/Export/Interface/CMakeLists.txt
index 523fc29..00a5375 100644
--- a/Tests/ExportImport/Export/Interface/CMakeLists.txt
+++ b/Tests/ExportImport/Export/Interface/CMakeLists.txt
@@ -29,7 +29,17 @@ target_compile_features(use_auto_type INTERFACE cxx_auto_type)
add_library(use_c_restrict INTERFACE)
target_compile_features(use_c_restrict INTERFACE c_restrict)
-install(TARGETS headeronly sharediface use_auto_type use_c_restrict
+add_library(source_target INTERFACE)
+target_sources(source_target INTERFACE
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/source_target.cpp>
+ $<INSTALL_INTERFACE:$<INSTALL_PREFIX>/src/source_target_for_install.cpp>
+)
+install(FILES
+ source_target_for_install.cpp
+ DESTINATION src
+)
+
+install(TARGETS headeronly sharediface use_auto_type use_c_restrict source_target
EXPORT expInterface
)
install(TARGETS sharedlib
diff --git a/Tests/ExportImport/Export/Interface/source_target.cpp b/Tests/ExportImport/Export/Interface/source_target.cpp
new file mode 100644
index 0000000..037191c
--- /dev/null
+++ b/Tests/ExportImport/Export/Interface/source_target.cpp
@@ -0,0 +1,13 @@
+
+#ifndef USE_FROM_BUILD_DIR
+#error Expected define USE_FROM_BUILD_DIR
+#endif
+
+#ifdef USE_FROM_INSTALL_DIR
+#error Unexpected define USE_FROM_INSTALL_DIR
+#endif
+
+int source_symbol()
+{
+ return 42;
+}
diff --git a/Tests/ExportImport/Export/Interface/source_target_for_install.cpp b/Tests/ExportImport/Export/Interface/source_target_for_install.cpp
new file mode 100644
index 0000000..64514ed
--- /dev/null
+++ b/Tests/ExportImport/Export/Interface/source_target_for_install.cpp
@@ -0,0 +1,13 @@
+
+#ifdef USE_FROM_BUILD_DIR
+#error Unexpected define USE_FROM_BUILD_DIR
+#endif
+
+#ifndef USE_FROM_INSTALL_DIR
+#error Expected define USE_FROM_INSTALL_DIR
+#endif
+
+int source_symbol()
+{
+ return 42;
+}