[offload] [test] Use test compiler ID rather than host (#124408)

Use the test compiler ID to verify whether tests can be run rather than
the host compiler. This makes it possible to run tests (with Clang)
while the library itself was built with GCC.

(cherry picked from commit 689ef5fda0ab07dfc452cb16d3646d53e612cb75)
This commit is contained in:
Michał Górny 2025-02-02 16:55:39 +01:00 committed by Tom Stellard
parent 091c11f29e
commit 28e563c238

View File

@ -1,6 +1,6 @@
# CMakeLists.txt file for unit testing OpenMP offloading runtime library.
if(NOT CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR
CMAKE_CXX_COMPILER_VERSION VERSION_LESS 6.0.0)
if(NOT OPENMP_TEST_COMPILER_ID STREQUAL "Clang" OR
OPENMP_TEST_COMPILER_VERSION VERSION_LESS 6.0.0)
message(STATUS "Can only test with Clang compiler in version 6.0.0 or later.")
message(WARNING "The check-offload target will not be available!")
return()