Merge pull request #77 from sradigan/FixLinuxClangSupport

Fixed build options to allow compilation on linux using clang
This commit is contained in:
Kjell Hedström 2016-02-02 16:02:35 -07:00
commit 579579962c

View File

@ -23,7 +23,12 @@ SET(ACTIVE_CPP0xx_DIR "Release")
IF ("${CMAKE_CXX_COMPILER_ID}" MATCHES ".*Clang")
MESSAGE("")
MESSAGE("cmake for Clang ")
SET(CMAKE_CXX_FLAGS "-Wall -std=c++11 -stdlib=libc++ -Wunused -D_GLIBCXX_USE_NANOSLEEP")
SET(CMAKE_CXX_FLAGS "-Wall -std=c++11 -Wunused -D_GLIBCXX_USE_NANOSLEEP")
IF (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libstdc++ -pthread")
ELSE()
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
ENDIF()
IF (${CMAKE_SYSTEM} MATCHES "FreeBSD-([0-9]*)\\.(.*)")
IF (${CMAKE_MATCH_1} GREATER 9)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
@ -31,8 +36,10 @@ IF ("${CMAKE_CXX_COMPILER_ID}" MATCHES ".*Clang")
ENDIF()
ELSEIF (APPLE)
set(PLATFORM_LINK_LIBRIES c++abi)
ELSE()
ELSEIF (NOT (${CMAKE_SYSTEM_NAME} STREQUAL "Linux"))
set(PLATFORM_LINK_LIBRIES rt c++abi)
ELSE()
set(PLATFORM_LINK_LIBRIES rt)
ENDIF()