Work around check_libs failing on OS X due to -x objective-c.

This commit is contained in:
comex 2015-06-02 18:27:50 -04:00
parent fd855758cc
commit 599e42c562

View File

@ -240,12 +240,6 @@ if(APPLE)
set(CMAKE_PREFIX_PATH "${CMAKE_PREFIX_PATH};/usr")
endif()
# Some of our code contains Objective C constructs.
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -x objective-c -stdlib=libc++")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -x objective-c++ -stdlib=libc++")
# Avoid mistaking an object file for a source file on the link command line.
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -x none")
# Identify the target system:
# Ask for 64-bit binary.
set(TARGET_FLAGS "-arch x86_64")
@ -838,6 +832,15 @@ add_definitions(-std=gnu++0x)
# but some dependencies require them (LLVM, libav).
add_definitions(-D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS)
# Do this at the last minute because try_compile ignores linker flags. Yay...
if(APPLE)
# Some of our code contains Objective C constructs.
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -x objective-c -stdlib=libc++")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -x objective-c++ -stdlib=libc++")
# Avoid mistaking an object file for a source file on the link command line.
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -x none")
endif()
add_subdirectory(Source)
@ -883,4 +886,3 @@ list(APPEND CPACK_SOURCE_IGNORE_FILES "${CMAKE_BINARY_DIR}")
# CPack must be included after the CPACK_* variables are set in order for those
# variables to take effect.
Include(CPack)