summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-04-01 14:21:37 (GMT)
committerKitware Robot <kwrobot@kitware.com>2021-04-01 14:22:15 (GMT)
commit049757b8a8aae5471fe9a8421fc588e82d46bd02 (patch)
treeb18877e6c498d79747b1c7c0ebbb5a8d9f672c4f /Tests/RunCMake
parentfca5aa8b330b20be87468fdd9b1e93c144caa75b (diff)
parent6cf81efe7d95e3cf43028ef5122a814d8d7f3aa0 (diff)
downloadCMake-049757b8a8aae5471fe9a8421fc588e82d46bd02.zip
CMake-049757b8a8aae5471fe9a8421fc588e82d46bd02.tar.gz
CMake-049757b8a8aae5471fe9a8421fc588e82d46bd02.tar.bz2
Merge topic 'genex-HOST_LINK-in-try_compile' into release-3.20
6cf81efe7d Genex: $<HOST_LINK:> and $<DEVICE_LINK:> must be usable in try_compile Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5964
Diffstat (limited to 'Tests/RunCMake')
-rw-r--r--Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-try_compile.cmake9
-rw-r--r--Tests/RunCMake/GenEx-DEVICE_LINK/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-try_compile.cmake9
-rw-r--r--Tests/RunCMake/GenEx-HOST_LINK/RunCMakeTest.cmake1
4 files changed, 20 insertions, 0 deletions
diff --git a/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-try_compile.cmake b/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-try_compile.cmake
new file mode 100644
index 0000000..281f8aa
--- /dev/null
+++ b/Tests/RunCMake/GenEx-DEVICE_LINK/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)
diff --git a/Tests/RunCMake/GenEx-DEVICE_LINK/RunCMakeTest.cmake b/Tests/RunCMake/GenEx-DEVICE_LINK/RunCMakeTest.cmake
index 1e44601..80633e2 100644
--- a/Tests/RunCMake/GenEx-DEVICE_LINK/RunCMakeTest.cmake
+++ b/Tests/RunCMake/GenEx-DEVICE_LINK/RunCMakeTest.cmake
@@ -12,6 +12,7 @@ run_cmake(DEVICE_LINK-target_compile_options)
run_cmake(DEVICE_LINK-target_include_directories)
run_cmake(DEVICE_LINK-target_link_libraries)
run_cmake(DEVICE_LINK-target_link_directories)
+run_cmake(DEVICE_LINK-try_compile)
if(RunCMake_GENERATOR MATCHES "(Ninja|Makefile)")
run_cmake(DEVICE_LINK-link_depends)
endif()
diff --git a/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-try_compile.cmake b/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-try_compile.cmake
new file mode 100644
index 0000000..f221ff1
--- /dev/null
+++ b/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-try_compile.cmake
@@ -0,0 +1,9 @@
+
+enable_language(C)
+
+add_library(demo INTERFACE IMPORTED)
+set_property(TARGET demo PROPERTY INTERFACE_LINK_OPTIONS "$<HOST_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)
diff --git a/Tests/RunCMake/GenEx-HOST_LINK/RunCMakeTest.cmake b/Tests/RunCMake/GenEx-HOST_LINK/RunCMakeTest.cmake
index 329a7c6..9e3eeec 100644
--- a/Tests/RunCMake/GenEx-HOST_LINK/RunCMakeTest.cmake
+++ b/Tests/RunCMake/GenEx-HOST_LINK/RunCMakeTest.cmake
@@ -12,6 +12,7 @@ run_cmake(HOST_LINK-target_compile_options)
run_cmake(HOST_LINK-target_include_directories)
run_cmake(HOST_LINK-target_link_libraries)
run_cmake(HOST_LINK-target_link_directories)
+run_cmake(HOST_LINK-try_compile)
if(RunCMake_GENERATOR MATCHES "(Ninja|Makefile)")
run_cmake(HOST_LINK-link_depends)
endif()