Merge topic 'compiler-tests'

f891a75d5c Tests: Test CMakeTest*Compiler.cmake fallbacks

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !7722
This commit is contained in:
Brad King
2022-09-29 11:50:34 +00:00
committed by Kitware Robot
11 changed files with 36 additions and 0 deletions

View File

@@ -295,6 +295,10 @@ if(UNIX AND "${CMAKE_GENERATOR}" MATCHES "Unix Makefiles|Ninja")
add_RunCMake_test(CompilerChange)
endif()
add_RunCMake_test(CompilerNotFound)
if (APPLE AND CMAKE_C_COMPILER_ID MATCHES "Clang|GNU")
list(APPEND CompilerTest_ARGS -DCMake_TEST_OBJC=1)
endif()
add_RunCMake_test(CompilerTest)
add_RunCMake_test(Configure -DMSVC_IDE=${MSVC_IDE})
add_RunCMake_test(DisallowedCommands)
if("${CMAKE_GENERATOR}" MATCHES "Unix Makefiles|Ninja")

View File

@@ -0,0 +1,2 @@
-- Check for working C compiler: [^
]* - works

View File

@@ -0,0 +1,3 @@
# Pretend the ABI check failed in order to force the fall-back test to run.
set(CMAKE_C_ABI_COMPILED FALSE)
enable_language(C)

View File

@@ -0,0 +1,3 @@
cmake_minimum_required(VERSION 3.24)
project(${RunCMake_TEST} NONE)
include(${RunCMake_TEST}.cmake)

View File

@@ -0,0 +1,2 @@
-- Check for working CXX compiler: [^
]* - works

View File

@@ -0,0 +1,3 @@
# Pretend the ABI check failed in order to force the fall-back test to run.
set(CMAKE_CXX_ABI_COMPILED FALSE)
enable_language(CXX)

View File

@@ -0,0 +1,2 @@
-- Check for working OBJC compiler: [^
]* - works

View File

@@ -0,0 +1,3 @@
# Pretend the ABI check failed in order to force the fall-back test to run.
set(CMAKE_OBJC_ABI_COMPILED FALSE)
enable_language(OBJC)

View File

@@ -0,0 +1,2 @@
-- Check for working OBJCXX compiler: [^
]* - works

View File

@@ -0,0 +1,3 @@
# Pretend the ABI check failed in order to force the fall-back test to run.
set(CMAKE_OBJCXX_ABI_COMPILED FALSE)
enable_language(OBJCXX)

View File

@@ -0,0 +1,9 @@
include(RunCMake)
run_cmake(C)
run_cmake(CXX)
if(CMake_TEST_OBJC)
run_cmake(OBJC)
run_cmake(OBJCXX)
endif()