Skip to content

Commit

Permalink
CMake: fix CHECK_OBJC_SOURCE_COMPILES to work with GCC (thanks, Ivan!).
Browse files Browse the repository at this point in the history
Apparently -ObjC works with Clang, but -x objective-c works with both.

Fixes Bugzilla #2392.
  • Loading branch information
icculus committed Apr 8, 2015
1 parent 684f9e9 commit 5b6e064
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmake/macros.cmake
Expand Up @@ -66,7 +66,7 @@ endmacro()

macro(CHECK_OBJC_SOURCE_COMPILES SOURCE VAR)
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})
set(CMAKE_REQUIRED_DEFINITIONS "${PREV_REQUIRED_DEFS}")
endmacro()
Expand Down

0 comments on commit 5b6e064

Please sign in to comment.