diff options
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 64b9f3e62..c032bbee0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -139,12 +139,15 @@ elseif(CMAKE_SYSTEM_NAME MATCHES "DragonFly.*|FreeBSD") set(FREEBSD TRUE) endif() -# TODO: check bsdi, NetBSD, OpenBSD, to see if they need the same FreeBSD changes +# Check if we're on OpenBSD. See the README.md for build instructions. +if(CMAKE_SYSTEM_NAME MATCHES "kOpenBSD.*|OpenBSD.*") + set(OPENBSD TRUE) +endif() + +# TODO: check bsdi, NetBSD, to see if they need the same FreeBSD changes # # elseif(CMAKE_SYSTEM_NAME MATCHES "kNetBSD.*|NetBSD.*") # set(NETBSD TRUE) -# elseif(CMAKE_SYSTEM_NAME MATCHES "kOpenBSD.*|OpenBSD.*") -# set(OPENBSD TRUE) # elseif(CMAKE_SYSTEM_NAME MATCHES ".*BSDI.*") # set(BSDI TRUE) @@ -379,7 +382,7 @@ else() set(RELEASE_FLAGS "${RELEASE_FLAGS} -ffat-lto-objects") endif() # Since gcc 4.9 the LTO format is non-standard (slim), so we need the gcc-specific ar and ranlib binaries - if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND NOT (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9.0)) + if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND NOT (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9.0) AND NOT OPENBSD) set(CMAKE_AR "gcc-ar") set(CMAKE_RANLIB "gcc-ranlib") endif() @@ -389,7 +392,7 @@ else() set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${DEBUG_FLAGS}") set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} ${RELEASE_FLAGS}") set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${RELEASE_FLAGS}") - if(STATIC AND NOT APPLE AND NOT FREEBSD) + if(STATIC AND NOT APPLE AND NOT FREEBSD AND NOT OPENBSD) set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libgcc -static-libstdc++") endif() endif() @@ -421,7 +424,7 @@ endif() include_directories(SYSTEM ${Boost_INCLUDE_DIRS}) if(MINGW) set(EXTRA_LIBRARIES mswsock;ws2_32;iphlpapi) -elseif(APPLE OR FREEBSD) +elseif(APPLE OR FREEBSD OR OPENBSD) set(EXTRA_LIBRARIES "") elseif(NOT MSVC) find_library(RT rt) |