summaryrefslogtreecommitdiffstats
path: root/Tests/ExportImport/Import
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/ExportImport/Import')
-rw-r--r--Tests/ExportImport/Import/Interface/CMakeLists.txt21
1 files changed, 21 insertions, 0 deletions
diff --git a/Tests/ExportImport/Import/Interface/CMakeLists.txt b/Tests/ExportImport/Import/Interface/CMakeLists.txt
index 18d9b76..4028405 100644
--- a/Tests/ExportImport/Import/Interface/CMakeLists.txt
+++ b/Tests/ExportImport/Import/Interface/CMakeLists.txt
@@ -17,6 +17,7 @@ set_property(TARGET bld::sharediface APPEND PROPERTY INTERFACE_LINK_LIBRARIES de
add_executable(interfacetest_bld interfacetest.cpp)
target_link_libraries(interfacetest_bld bld::sharediface)
+include(CheckCSourceCompiles)
include(CheckCXXSourceCompiles)
macro(do_try_compile prefix)
@@ -41,6 +42,26 @@ macro(do_try_compile prefix)
message(SEND_ERROR "${prefix} try_compile with IMPORTED INTERFACE target failed!\n\n${OUTPUT}")
endif()
+ if (";${CMAKE_C_COMPILE_FEATURES};" MATCHES ";c_restrict;")
+ set(CMAKE_REQUIRED_LIBRARIES ${prefix}::use_c_restrict)
+ check_c_source_compiles(
+ "
+ int foo(int * restrict a, int * restrict b)
+ {
+ (void)a;
+ (void)b;
+ return 0;
+ }
+ int main()
+ {
+ return 0;
+ }
+ " ${prefix}IMPORTED_IFACE_C_RESTRICT)
+
+ if(NOT ${prefix}IMPORTED_IFACE_C_RESTRICT)
+ message(SEND_ERROR "${prefix} try_compile with IMPORTED INTERFACE target failed!\n\n${OUTPUT}")
+ endif()
+ endif()
if (";${CMAKE_CXX_COMPILE_FEATURES};" MATCHES ";cxx_auto_type;")
set(CMAKE_REQUIRED_LIBRARIES ${prefix}::use_auto_type)
check_cxx_source_compiles(