summaryrefslogtreecommitdiffstats
path: root/Modules/FindOpenACC.cmake
diff options
context:
space:
mode:
authorMatthew Woehlke <matthew.woehlke@kitware.com>2022-09-13 14:07:56 (GMT)
committerBrad King <brad.king@kitware.com>2022-09-14 11:52:16 (GMT)
commit2edf0fc6d73510f4e93e2750bc0dbc8c6c376633 (patch)
treec7d5a791ae4cce38b9dd68e07deeaf2486b83455 /Modules/FindOpenACC.cmake
parent83686df1d63e7d2c922de19489ea2bab42e98a4a (diff)
downloadCMake-2edf0fc6d73510f4e93e2750bc0dbc8c6c376633.zip
CMake-2edf0fc6d73510f4e93e2750bc0dbc8c6c376633.tar.gz
CMake-2edf0fc6d73510f4e93e2750bc0dbc8c6c376633.tar.bz2
Modules: Use new keyword-dispatched try_compile signature
Modify most of the modules that ship with CMake to use the new try_compile / try_run signatures added by commit aa9220d3a0 (try_compile: Add keyword-dispatched signature, 2022-09-02). This improves debugging by each invocation using its own directory so that the results of multiple invocations can be retained. This does not cover any invocations which provide an entire project, as that flavor of try_compile has not yet been updated.
Diffstat (limited to 'Modules/FindOpenACC.cmake')
-rw-r--r--Modules/FindOpenACC.cmake4
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/FindOpenACC.cmake b/Modules/FindOpenACC.cmake
index 71bd84f..e05d0c6 100644
--- a/Modules/FindOpenACC.cmake
+++ b/Modules/FindOpenACC.cmake
@@ -187,7 +187,7 @@ function(_OPENACC_GET_FLAGS LANG FLAG_VAR)
_OPENACC_WRITE_SOURCE_FILE("${LANG}" "TEST_SOURCE" OpenACCTryFlag _OPENACC_TEST_SRC)
foreach(FLAG IN LISTS FLAG_CANDIDATES)
- try_compile(OpenACC_FLAG_TEST_RESULT ${CMAKE_BINARY_DIR} ${_OPENACC_TEST_SRC}
+ try_compile(OpenACC_FLAG_TEST_RESULT SOURCES ${_OPENACC_TEST_SRC}
CMAKE_FLAGS "-DCOMPILE_DEFINITIONS:STRING=${FLAG}"
OUTPUT_VARIABLE OpenACC_TRY_COMPILE_OUTPUT
)
@@ -215,7 +215,7 @@ function(_OPENACC_GET_SPEC_DATE LANG SPEC_DATE)
_OPENACC_WRITE_SOURCE_FILE("${LANG}" "CHECK_VERSION_SOURCE" OpenACCCheckVersion _OPENACC_TEST_SRC)
set(BIN_FILE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/FindOpenACC/accver_${LANG}.bin")
- try_compile(OpenACC_SPECTEST_${LANG} "${CMAKE_BINARY_DIR}" "${_OPENACC_TEST_SRC}"
+ try_compile(OpenACC_SPECTEST_${LANG} SOURCES "${_OPENACC_TEST_SRC}"
CMAKE_FLAGS "-DCOMPILE_DEFINITIONS:STRING=${OpenACC_${LANG}_FLAGS}"
COPY_FILE ${BIN_FILE}
OUTPUT_VARIABLE OUTPUT)