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 --- lib/sqlite/CMakeLists.txt | 2 +- lib/tolua++/CMakeLists.txt | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/sqlite/CMakeLists.txt b/lib/sqlite/CMakeLists.txt index 993dac146..b9471c1f2 100644 --- a/lib/sqlite/CMakeLists.txt +++ b/lib/sqlite/CMakeLists.txt @@ -25,7 +25,7 @@ endif() # FreeBSD requires us to define this to get POSIX 2001 standard if (${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD") - add_flags_cxx(-D__POSIX_VISIBLE=200112) + add_flags_cxx("-D_XOPEN_SOURCE=600") endif() add_library(sqlite ${SOURCE}) diff --git a/lib/tolua++/CMakeLists.txt b/lib/tolua++/CMakeLists.txt index 12054323b..02883397e 100644 --- a/lib/tolua++/CMakeLists.txt +++ b/lib/tolua++/CMakeLists.txt @@ -53,4 +53,8 @@ if(UNIX) target_link_libraries(tolua m ${DYNAMIC_LOADER}) endif() +if (${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD") + add_flags_lnk(-L/usr/local/lib) +endif() + target_link_libraries(tolua tolualib lua) -- cgit v1.2.3