From 8f109ec13103750589dc1aaf01ee11759423d6b2 Mon Sep 17 00:00:00 2001 From: Robert Ayrapetyan Date: Sun, 20 Sep 2015 19:23:38 -0700 Subject: [PATCH] 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 --- Build.cmake | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Build.cmake b/Build.cmake index 89874c8..3af80cf 100644 --- a/Build.cmake +++ b/Build.cmake @@ -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")