summaryrefslogtreecommitdiff
path: root/Tests/RunCMake/GenEx-DEVICE_LINK/try_compile.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/RunCMake/GenEx-DEVICE_LINK/try_compile.cmake')
-rw-r--r--Tests/RunCMake/GenEx-DEVICE_LINK/try_compile.cmake9
1 files changed, 9 insertions, 0 deletions
diff --git a/Tests/RunCMake/GenEx-DEVICE_LINK/try_compile.cmake b/Tests/RunCMake/GenEx-DEVICE_LINK/try_compile.cmake
new file mode 100644
index 000000000..281f8aa3a
--- /dev/null
+++ b/Tests/RunCMake/GenEx-DEVICE_LINK/try_compile.cmake
@@ -0,0 +1,9 @@
+
+enable_language(C)
+
+add_library(demo INTERFACE IMPORTED)
+set_property(TARGET demo PROPERTY INTERFACE_LINK_OPTIONS "$<DEVICE_LINK:>")
+
+set(CMAKE_TRY_COMPILE_TARGET_TYPE EXECUTABLE)
+try_compile(result "${CMAKE_CURRENT_BINARY_DIR}/tc" "${CMAKE_CURRENT_SOURCE_DIR}/empty.c"
+ LINK_LIBRARIES demo)