lokinet/cmake/unix.cmake
Jason Rhinelander 488ed47cda Remove duplicate handling of jemalloc
We were linking/loading it in different ways, one with cmake option
`USE_JELLOC` and the other, older version `WITH_JEMALLOC`.  This removes
the latter (which was default OFF) and keeps the former (which was added
and has been default ON since 0.9.4 or so).

Also removes the `ifdef`ed JEMALLOC code in lokinet.cpp because we don't
need it; just linking to jemalloc is enough to get the malloc/free
replacements.
2021-09-13 13:26:12 -03:00

22 lines
416 B
CMake

if(NOT ANDROID)
if(NOT UNIX)
return()
endif()
endif()
include(CheckCXXSourceCompiles)
include(CheckLibraryExists)
add_definitions(-DUNIX)
add_definitions(-DPOSIX)
if(EMBEDDED_CFG OR ${CMAKE_SYSTEM_NAME} MATCHES "Linux")
link_libatomic()
endif()
if (${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD")
add_definitions(-D_BSD_SOURCE)
add_definitions(-D_GNU_SOURCE)
add_definitions(-D_XOPEN_SOURCE=700)
endif()