mirror of
https://github.com/Kitware/CMake.git
synced 2026-08-07 00:00:57 +00:00
Tests: Enable missing Objective C/C++ tests
Some test cases added by commit 80f120a85f (Languages: Add support for
Objective-C, 2019-09-13, v3.16.0-rc1~44^2~3) have never actually been
run because the condition to enable them is never true. Fix the
condition and fix the tests to pass.
This commit is contained in:
@@ -31,12 +31,9 @@ add_CMakeOnly_test(CheckStructHasMember)
|
|||||||
add_CMakeOnly_test(CompilerIdC)
|
add_CMakeOnly_test(CompilerIdC)
|
||||||
add_CMakeOnly_test(CompilerIdCXX)
|
add_CMakeOnly_test(CompilerIdCXX)
|
||||||
|
|
||||||
if(CMAKE_OBJC_COMPILER)
|
if (APPLE AND CMAKE_C_COMPILER_ID MATCHES "Clang|GNU")
|
||||||
add_CMakeOnly_test(CompilerIdOBJC)
|
add_CMakeOnly_test(CompilerIdOBJC)
|
||||||
add_CMakeOnly_test(CheckOBJCCompilerFlag)
|
add_CMakeOnly_test(CheckOBJCCompilerFlag)
|
||||||
endif()
|
|
||||||
|
|
||||||
if(CMAKE_OBJCXX_COMPILER)
|
|
||||||
add_CMakeOnly_test(CompilerIdOBJCXX)
|
add_CMakeOnly_test(CompilerIdOBJCXX)
|
||||||
add_CMakeOnly_test(CheckOBJCXXCompilerFlag)
|
add_CMakeOnly_test(CheckOBJCXXCompilerFlag)
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
@@ -1,17 +1,7 @@
|
|||||||
cmake_minimum_required(VERSION 2.8.12)
|
cmake_minimum_required(VERSION 3.16)
|
||||||
|
project(CheckOBJCCompilerFlag OBJC)
|
||||||
project(CheckOBJCCompilerFlag)
|
|
||||||
|
|
||||||
include(CheckOBJCCompilerFlag)
|
include(CheckOBJCCompilerFlag)
|
||||||
|
check_objc_compiler_flag(-DFOO HAS_COMPILER_FLAG)
|
||||||
if(CMAKE_COMPILER_IS_GNUOBJC)
|
|
||||||
set(COMPILER_FLAG -fobjc-direct-dispatch)
|
|
||||||
else()
|
|
||||||
set(COMPILER_FLAG -fobjc-gc)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
CHECK_OBJC_COMPILER_FLAGS(${COMPILER_FLAG} HAS_COMPILER_FLAG)
|
|
||||||
|
|
||||||
if(NOT HAS_COMPILER_FLAG)
|
if(NOT HAS_COMPILER_FLAG)
|
||||||
message(SEND_ERROR "Test fail: HAS_COMPILER_FLAG: ${COMPILER_FLAG}")
|
message(SEND_ERROR "Test fail: HAS_COMPILER_FLAG: ${COMPILER_FLAG}")
|
||||||
endif
|
endif()
|
||||||
|
|||||||
@@ -1,17 +1,7 @@
|
|||||||
cmake_minimum_required(VERSION 2.8.12)
|
cmake_minimum_required(VERSION 3.16)
|
||||||
|
project(CheckOBJCXXCompilerFlag OBJCXX)
|
||||||
project(CheckOBJCXXCompilerFlag)
|
|
||||||
|
|
||||||
include(CheckOBJCXXCompilerFlag)
|
include(CheckOBJCXXCompilerFlag)
|
||||||
|
check_objcxx_compiler_flag(-DFOO HAS_COMPILER_FLAG)
|
||||||
if(CMAKE_COMPILER_IS_GNUOBJCXX)
|
|
||||||
set(COMPILER_FLAG -fobjc-direct-dispatch)
|
|
||||||
else()
|
|
||||||
set(COMPILER_FLAG -fobjc-gc)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
CHECK_OBJCXX_COMPILER_FLAGS(${COMPILER_FLAG} HAS_COMPILER_FLAG)
|
|
||||||
|
|
||||||
if(NOT HAS_COMPILER_FLAG)
|
if(NOT HAS_COMPILER_FLAG)
|
||||||
message(SEND_ERROR "Test fail: HAS_COMPILER_FLAG: ${COMPILER_FLAG}")
|
message(SEND_ERROR "Test fail: HAS_COMPILER_FLAG: ${COMPILER_FLAG}")
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
Reference in New Issue
Block a user