CMake: fix CHECK_OBJC_SOURCE_COMPILES to work with GCC (thanks, Ivan!).
authorRyan C. Gordon <icculus@icculus.org>
Tue, 07 Apr 2015 20:01:43 -0400
changeset 9465bf1da29c9509
parent 9464 ae7a6c8cc189
child 9466 510c9a2f0951
CMake: fix CHECK_OBJC_SOURCE_COMPILES to work with GCC (thanks, Ivan!).

Apparently -ObjC works with Clang, but -x objective-c works with both.

Fixes Bugzilla #2392.
cmake/macros.cmake
     1.1 --- a/cmake/macros.cmake	Tue Apr 07 23:00:56 2015 +0200
     1.2 +++ b/cmake/macros.cmake	Tue Apr 07 20:01:43 2015 -0400
     1.3 @@ -66,7 +66,7 @@
     1.4  
     1.5  macro(CHECK_OBJC_SOURCE_COMPILES SOURCE VAR)
     1.6    set(PREV_REQUIRED_DEFS "${CMAKE_REQUIRED_DEFINITIONS}")
     1.7 -  set(CMAKE_REQUIRED_DEFINITIONS "-ObjC ${PREV_REQUIRED_DEFS}")
     1.8 +  set(CMAKE_REQUIRED_DEFINITIONS "-x objective-c ${PREV_REQUIRED_DEFS}")
     1.9    CHECK_C_SOURCE_COMPILES(${SOURCE} ${VAR})
    1.10    set(CMAKE_REQUIRED_DEFINITIONS "${PREV_REQUIRED_DEFS}")
    1.11  endmacro()