Update Build.cmake (support for FreeBSD 10+)

Proposed fix for building on FreeBSD 10+ systems:
- c++abi and rt libs are not required
- pthread flag and execinfo lib is required
This commit is contained in:
Robert Ayrapetyan 2015-09-20 19:23:38 -07:00
parent 35cdf42b05
commit 8f109ec131

View File

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