Imported Upstream version 3.25.0
[platform/upstream/cmake.git] / Tests / RunCMake / CheckCompilerFlag / CheckCompilerFlagOBJCXX.cmake
1 enable_language (OBJCXX)
2 include(CheckCompilerFlag)
3
4 set(OBJCXX 1) # test that this is tolerated
5
6 check_compiler_flag(OBJCXX "-_this_is_not_a_flag_" SHOULD_FAIL)
7 if(SHOULD_FAIL)
8   message(SEND_ERROR "invalid OBJCXX compile flag didn't fail.")
9 endif()
10
11 check_compiler_flag(OBJCXX "-Wall" SHOULD_WORK)
12 if(NOT SHOULD_WORK)
13   message(SEND_ERROR "${CMAKE_OBJCXX_COMPILER_ID} compiler flag '-Wall' check failed")
14 endif()