summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--SetFlags.cmake5
-rw-r--r--lib/sqlite/CMakeLists.txt2
-rw-r--r--lib/tolua++/CMakeLists.txt4
-rw-r--r--src/CMakeLists.txt5
-rw-r--r--src/OSSupport/Errors.cpp2
5 files changed, 16 insertions, 2 deletions
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)
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)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 25de24c91..1b721100d 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -332,4 +332,9 @@ endif ()
if (WIN32)
target_link_libraries(${EXECUTABLE} expat tolualib ws2_32.lib Psapi.lib)
endif()
+
+if (${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD")
+ add_flags_lnk(-L/usr/local/lib)
+endif()
+
target_link_libraries(${EXECUTABLE} luaexpat jsoncpp mbedtls zlib sqlite lua SQLiteCpp event_core event_extra)
diff --git a/src/OSSupport/Errors.cpp b/src/OSSupport/Errors.cpp
index a5361e1a6..407799495 100644
--- a/src/OSSupport/Errors.cpp
+++ b/src/OSSupport/Errors.cpp
@@ -22,7 +22,7 @@ AString GetOSErrorString( int a_ErrNo)
// According to http://linux.die.net/man/3/strerror_r there are two versions of strerror_r():
- #if !defined(__APPLE__) && ( _GNU_SOURCE) && !defined(ANDROID_NDK) // GNU version of strerror_r()
+ #if !defined(__APPLE__) && defined( _GNU_SOURCE) && !defined(ANDROID_NDK) // GNU version of strerror_r()
char * res = strerror_r( errno, buffer, ARRAYCOUNT(buffer));
if (res != nullptr)