From 5049fd0fbf2fe2e54d86d9d0f704d5daa301f819 Mon Sep 17 00:00:00 2001 From: linnemannr Date: Sun, 24 May 2015 20:07:31 -0600 Subject: Support building on FreeBSD SetFlags.cmake Add -lexecinfo to linker flags for FreeBSD to resolve backtrace() lib/sqlite/CMakeLists.txt Define _XOPEN_SOURCE to 600 instead of __POSIX_VISIBLE to 200112 for POSIX 1-2001 support. For POSIX standards, the _XOPEN_SOURCE define controls the eventual value of __POSIX_VISIBLE. _XOPEN_SOURCE is defined to 500 in sqlite.c if not already defined, which sets up _POSIX_C_SOURCE and __POSIX_VISIBLE to the 199506 for POSIX.1c lib/tolua++/CMakeLists.txt src/CMakeLists.txt Add /usr/local/lib to the library search path for FreeBSD builds src/OSSupport/Errors.cpp Correct the strerror_r() implementation determination to check whether _GNU_SOURCE is defined, not what it evaluates to --- SetFlags.cmake | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'SetFlags.cmake') diff --git a/SetFlags.cmake b/SetFlags.cmake index b05585f7d..92046b688 100644 --- a/SetFlags.cmake +++ b/SetFlags.cmake @@ -240,6 +240,11 @@ macro(set_exe_flags) # we support non-IEEE 754 fpus so can make no guarentees about error add_flags_cxx("-ffast-math") + if(${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD") + # backtrace() and friends are in libexecinfo + add_flags_lnk("-lexecinfo") + endif() + if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") get_clang_version() if ("${CLANG_VERSION}" VERSION_LESS 3.0) -- cgit v1.2.3