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.
parent
684f9e9603
commit
5b6e064acd
|
@ -66,7 +66,7 @@ endmacro()
|
||||||
|
|
||||||
macro(CHECK_OBJC_SOURCE_COMPILES SOURCE VAR)
|
macro(CHECK_OBJC_SOURCE_COMPILES SOURCE VAR)
|
||||||
set(PREV_REQUIRED_DEFS "${CMAKE_REQUIRED_DEFINITIONS}")
|
set(PREV_REQUIRED_DEFS "${CMAKE_REQUIRED_DEFINITIONS}")
|
||||||
set(CMAKE_REQUIRED_DEFINITIONS "-ObjC ${PREV_REQUIRED_DEFS}")
|
set(CMAKE_REQUIRED_DEFINITIONS "-x objective-c ${PREV_REQUIRED_DEFS}")
|
||||||
CHECK_C_SOURCE_COMPILES(${SOURCE} ${VAR})
|
CHECK_C_SOURCE_COMPILES(${SOURCE} ${VAR})
|
||||||
set(CMAKE_REQUIRED_DEFINITIONS "${PREV_REQUIRED_DEFS}")
|
set(CMAKE_REQUIRED_DEFINITIONS "${PREV_REQUIRED_DEFS}")
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
Loading…
Reference in New Issue