From 7c3c20161bf576d1d7e373734598876cc0e58130 Mon Sep 17 00:00:00 2001 From: whitequark Date: Sat, 26 Dec 2015 00:06:59 +0800 Subject: [PATCH] Allow building on FreeBSD. --- CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index c99d9765..fbfb586a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -56,6 +56,11 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux") set(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed ${CMAKE_EXE_LINKER_FLAGS}") endif() +if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") + set(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed ${CMAKE_EXE_LINKER_FLAGS}") +endif() + # dependencies CHECK_INCLUDE_FILE("stdint.h" HAVE_STDINT_H)