mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-11 08:20:18 -06:00
Tests: Test more CMakeTest*Compiler.cmake fallbacks
Extend the test added by commit f891a75d5c (Tests: Test
CMakeTest*Compiler.cmake fallbacks, 2022-09-27) to cover more languages.
This commit is contained in:
@@ -298,7 +298,16 @@ add_RunCMake_test(CompilerNotFound)
|
||||
if (APPLE AND CMAKE_C_COMPILER_ID MATCHES "Clang|GNU")
|
||||
list(APPEND CompilerTest_ARGS -DCMake_TEST_OBJC=1)
|
||||
endif()
|
||||
if(CMAKE_Fortran_COMPILER)
|
||||
list(APPEND CompilerTest_ARGS -DCMake_TEST_Fortran=1)
|
||||
endif()
|
||||
foreach(lang IN ITEMS CUDA HIP ISPC)
|
||||
if(CMake_TEST_${lang})
|
||||
list(APPEND CompilerTest_ARGS -DCMake_TEST_${lang}=1)
|
||||
endif()
|
||||
endforeach()
|
||||
add_RunCMake_test(CompilerTest)
|
||||
set_property(TEST RunCMake.CompilerTest APPEND PROPERTY LABELS "CUDA" "HIP" "ISPC")
|
||||
add_RunCMake_test(Configure -DMSVC_IDE=${MSVC_IDE})
|
||||
add_RunCMake_test(DisallowedCommands)
|
||||
if("${CMAKE_GENERATOR}" MATCHES "Unix Makefiles|Ninja")
|
||||
|
||||
2
Tests/RunCMake/CompilerTest/CUDA-stdout.txt
Normal file
2
Tests/RunCMake/CompilerTest/CUDA-stdout.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
-- Check for working CUDA compiler: [^
|
||||
]* - works
|
||||
3
Tests/RunCMake/CompilerTest/CUDA.cmake
Normal file
3
Tests/RunCMake/CompilerTest/CUDA.cmake
Normal file
@@ -0,0 +1,3 @@
|
||||
# Pretend the ABI check failed in order to force the fall-back test to run.
|
||||
set(CMAKE_CUDA_ABI_COMPILED FALSE)
|
||||
enable_language(CUDA)
|
||||
2
Tests/RunCMake/CompilerTest/Fortran-stdout.txt
Normal file
2
Tests/RunCMake/CompilerTest/Fortran-stdout.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
-- Check for working Fortran compiler: [^
|
||||
]* - works
|
||||
3
Tests/RunCMake/CompilerTest/Fortran.cmake
Normal file
3
Tests/RunCMake/CompilerTest/Fortran.cmake
Normal file
@@ -0,0 +1,3 @@
|
||||
# Pretend the ABI check failed in order to force the fall-back test to run.
|
||||
set(CMAKE_Fortran_ABI_COMPILED FALSE)
|
||||
enable_language(Fortran)
|
||||
2
Tests/RunCMake/CompilerTest/HIP-stdout.txt
Normal file
2
Tests/RunCMake/CompilerTest/HIP-stdout.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
-- Check for working HIP compiler: [^
|
||||
]* - works
|
||||
3
Tests/RunCMake/CompilerTest/HIP.cmake
Normal file
3
Tests/RunCMake/CompilerTest/HIP.cmake
Normal file
@@ -0,0 +1,3 @@
|
||||
# Pretend the ABI check failed in order to force the fall-back test to run.
|
||||
set(CMAKE_HIP_ABI_COMPILED FALSE)
|
||||
enable_language(HIP)
|
||||
3
Tests/RunCMake/CompilerTest/ISPC-stdout.txt
Normal file
3
Tests/RunCMake/CompilerTest/ISPC-stdout.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
-- The ISPC compiler identification is [^
|
||||
]*
|
||||
-- Configuring done
|
||||
3
Tests/RunCMake/CompilerTest/ISPC.cmake
Normal file
3
Tests/RunCMake/CompilerTest/ISPC.cmake
Normal file
@@ -0,0 +1,3 @@
|
||||
# Pretend the ABI check failed in order to force the fall-back test to run.
|
||||
set(CMAKE_ISPC_ABI_COMPILED FALSE)
|
||||
enable_language(ISPC)
|
||||
@@ -3,6 +3,22 @@ include(RunCMake)
|
||||
run_cmake(C)
|
||||
run_cmake(CXX)
|
||||
|
||||
if(CMake_TEST_CUDA)
|
||||
run_cmake(CUDA)
|
||||
endif()
|
||||
|
||||
if(CMake_TEST_Fortran)
|
||||
run_cmake(Fortran)
|
||||
endif()
|
||||
|
||||
if(CMake_TEST_HIP)
|
||||
run_cmake(HIP)
|
||||
endif()
|
||||
|
||||
if(CMake_TEST_ISPC)
|
||||
run_cmake(ISPC)
|
||||
endif()
|
||||
|
||||
if(CMake_TEST_OBJC)
|
||||
run_cmake(OBJC)
|
||||
run_cmake(OBJCXX)
|
||||
|
||||
Reference in New Issue
Block a user