diff options
Diffstat (limited to 'Tests/ExportImport')
-rw-r--r-- | Tests/ExportImport/Export/Interface/CMakeLists.txt | 5 | ||||
-rw-r--r-- | Tests/ExportImport/Import/CMakeLists.txt | 1 | ||||
-rw-r--r-- | Tests/ExportImport/Import/Interface/CMakeLists.txt | 17 |
3 files changed, 22 insertions, 1 deletions
diff --git a/Tests/ExportImport/Export/Interface/CMakeLists.txt b/Tests/ExportImport/Export/Interface/CMakeLists.txt index 9d4793d..1b653eb 100644 --- a/Tests/ExportImport/Export/Interface/CMakeLists.txt +++ b/Tests/ExportImport/Export/Interface/CMakeLists.txt @@ -23,7 +23,10 @@ set_property(TARGET sharedlib PROPERTY INTERFACE_COMPILE_DEFINITIONS "SHAREDLIB_ add_library(sharediface INTERFACE) target_link_libraries(sharediface INTERFACE sharedlib) -install(TARGETS headeronly sharediface +add_library(use_auto_type INTERFACE) +target_compile_features(use_auto_type INTERFACE cxx_auto_type) + +install(TARGETS headeronly sharediface use_auto_type EXPORT expInterface ) install(TARGETS sharedlib diff --git a/Tests/ExportImport/Import/CMakeLists.txt b/Tests/ExportImport/Import/CMakeLists.txt index 5e809a2..189f7a2 100644 --- a/Tests/ExportImport/Import/CMakeLists.txt +++ b/Tests/ExportImport/Import/CMakeLists.txt @@ -1,4 +1,5 @@ cmake_minimum_required (VERSION 2.7.20090711) +cmake_policy(SET CMP0025 NEW) project(Import C CXX) # Import everything in a subdirectory. diff --git a/Tests/ExportImport/Import/Interface/CMakeLists.txt b/Tests/ExportImport/Import/Interface/CMakeLists.txt index cf7e2bc..1f30c67 100644 --- a/Tests/ExportImport/Import/Interface/CMakeLists.txt +++ b/Tests/ExportImport/Import/Interface/CMakeLists.txt @@ -40,6 +40,23 @@ macro(do_try_compile prefix) if(NOT ${prefix}IFACE_TRY_COMPILE) message(SEND_ERROR "${prefix} try_compile with IMPORTED INTERFACE target failed!\n\n${OUTPUT}") endif() + + if (";${CMAKE_CXX_COMPILE_FEATURES};" MATCHES ";cxx_auto_type;") + set(CMAKE_REQUIRED_LIBRARIES ${prefix}::use_auto_type) + check_cxx_source_compiles( + " + int main(int,char**) + { + auto value = 0; + return value; + } + " ${prefix}IMPORTED_IFACE_CONSTEXPR) + + if(NOT ${prefix}IMPORTED_IFACE_CONSTEXPR) + message(SEND_ERROR "${prefix} try_compile with IMPORTED INTERFACE target failed!\n\n${OUTPUT}") + endif() + endif() + endmacro() do_try_compile(bld) |