summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
Diffstat (limited to 'Tests')
-rw-r--r--Tests/ExportImport/Export/CMakeLists.txt15
-rw-r--r--Tests/ExportImport/Export/testLib3Imp.c5
-rw-r--r--Tests/ExportImport/Export/testLib3ImpDep.c7
-rw-r--r--Tests/Fortran/CMakeLists.txt12
4 files changed, 27 insertions, 12 deletions
diff --git a/Tests/ExportImport/Export/CMakeLists.txt b/Tests/ExportImport/Export/CMakeLists.txt
index 235a1d2..f06a465 100644
--- a/Tests/ExportImport/Export/CMakeLists.txt
+++ b/Tests/ExportImport/Export/CMakeLists.txt
@@ -23,8 +23,13 @@ add_library(testLib1 STATIC testLib1.c)
add_library(testLib2 STATIC testLib2.c)
target_link_libraries(testLib2 testLib1)
+# Test library with empty link interface. Link it to an implementation
+# dependency that itself links to dependencies publicly.
+add_library(testLib3ImpDep SHARED testLib3ImpDep.c)
+set_property(TARGET testLib3ImpDep PROPERTY LIBRARY_OUTPUT_DIRECTORY impl/dep)
add_library(testLib3Imp SHARED testLib3Imp.c)
set_property(TARGET testLib3Imp PROPERTY LIBRARY_OUTPUT_DIRECTORY impl)
+target_link_libraries(testLib3Imp testLib3ImpDep)
add_library(testLib3 SHARED testLib3.c)
target_link_libraries(testLib3 testLib3Imp)
set_property(TARGET testLib3 PROPERTY LINK_INTERFACE_LIBRARIES "")
@@ -105,6 +110,14 @@ install(
ARCHIVE DESTINATION lib/impl
)
install(
+ TARGETS
+ testLib3ImpDep
+ EXPORT exp
+ RUNTIME DESTINATION bin
+ LIBRARY DESTINATION lib/impl/dep
+ ARCHIVE DESTINATION lib/impl/dep
+ )
+install(
TARGETS testLib5
EXPORT exp
# Leave out RUNTIME DESTINATION to test implib-only export.
@@ -120,7 +133,7 @@ endif(WIN32)
# Export from build tree.
export(TARGETS testExe1 testLib1 testLib2 testLib3
- testExe2libImp testLib3Imp
+ testExe2libImp testLib3Imp testLib3ImpDep
NAMESPACE bld_
FILE ExportBuildTree.cmake
)
diff --git a/Tests/ExportImport/Export/testLib3Imp.c b/Tests/ExportImport/Export/testLib3Imp.c
index fb4c13f..c27bccd 100644
--- a/Tests/ExportImport/Export/testLib3Imp.c
+++ b/Tests/ExportImport/Export/testLib3Imp.c
@@ -1,7 +1,10 @@
#if defined(_WIN32) || defined(__CYGWIN__)
# define testLib3Imp_EXPORT __declspec(dllexport)
+# define testLib3ImpDep_IMPORT __declspec(dllimport)
#else
# define testLib3Imp_EXPORT
+# define testLib3ImpDep_IMPORT
#endif
-testLib3Imp_EXPORT int testLib3Imp(void) { return 0; }
+testLib3ImpDep_IMPORT int testLib3ImpDep(void);
+testLib3Imp_EXPORT int testLib3Imp(void) { return testLib3ImpDep(); }
diff --git a/Tests/ExportImport/Export/testLib3ImpDep.c b/Tests/ExportImport/Export/testLib3ImpDep.c
new file mode 100644
index 0000000..578ac30
--- /dev/null
+++ b/Tests/ExportImport/Export/testLib3ImpDep.c
@@ -0,0 +1,7 @@
+#if defined(_WIN32) || defined(__CYGWIN__)
+# define testLib3ImpDep_EXPORT __declspec(dllexport)
+#else
+# define testLib3ImpDep_EXPORT
+#endif
+
+testLib3ImpDep_EXPORT int testLib3ImpDep(void) { return 0; }
diff --git a/Tests/Fortran/CMakeLists.txt b/Tests/Fortran/CMakeLists.txt
index ba0bdcc..a995f68 100644
--- a/Tests/Fortran/CMakeLists.txt
+++ b/Tests/Fortran/CMakeLists.txt
@@ -113,16 +113,8 @@ endfunction()
# if the id's match or the compilers are compatible, then
# call the test_fortran_c_interface_module function
-if(("${CMAKE_Fortran_COMPILER_ID}" MATCHES "Intel")
- AND
- ("${CMAKE_C_COMPILER_ID}" MATCHES "MSVC")
- )
- set(COMPATABLE_COMPILERS TRUE)
-endif()
-if("${CMAKE_Fortran_COMPILER_ID}:${CMAKE_C_COMPILER_ID}" MATCHES "Absoft:GNU")
- set(COMPATABLE_COMPILERS TRUE)
-endif()
-if(COMPATABLE_COMPILERS
+if("${CMAKE_Fortran_COMPILER_ID}:${CMAKE_C_COMPILER_ID}" MATCHES
+ "(Intel:MSVC|Absoft:GNU)"
OR ("${CMAKE_Fortran_COMPILER_ID}" MATCHES "${CMAKE_C_COMPILER_ID}" ))
test_fortran_c_interface_module()
else()