nixpkgs-suyu/pkgs/servers/osrm-backend/darwin.patch
2023-04-12 20:05:05 +05:30

30 lines
1.2 KiB
Diff

diff --git a/CMakeLists.txt b/CMakeLists.txt
index e49fac2..25e3302 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -34,6 +34,14 @@ option(ENABLE_GLIBC_WORKAROUND "Workaround GLIBC symbol exports" OFF)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
+IF(APPLE)
+ set(CMAKE_THREAD_LIBS_INIT "-lpthread")
+ set(CMAKE_HAVE_THREADS_LIBRARY 1)
+ set(CMAKE_USE_WIN32_THREADS_INIT 0)
+ set(CMAKE_USE_PTHREADS_INIT 1)
+ set(THREADS_PREFER_PTHREAD_FLAG ON)
+ENDIF()
+
if(ENABLE_MASON)
# versions in use
set(MASON_BOOST_VERSION "1.65.1")
@@ -405,7 +413,8 @@ endif()
if(APPLE)
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.10")
execute_process(COMMAND xcrun --sdk macosx --show-sdk-path OUTPUT_VARIABLE CMAKE_OSX_SYSROOT OUTPUT_STRIP_TRAILING_WHITESPACE)
+ execute_process(COMMAND uname -m OUTPUT_VARIABLE JAMBA_OSX_NATIVE_ARCHITECTURE OUTPUT_STRIP_TRAILING_WHITESPACE)
- set(CMAKE_OSX_ARCHITECTURES "x86_64")
+ set(CMAKE_OSX_ARCHITECTURES "${JAMBA_OSX_NATIVE_ARCHITECTURE}")
+ message(STATUS "Set Architecture to ${JAMBA_OSX_NATIVE_ARCHITECTURE} on OS X")
- message(STATUS "Set Architecture to x64 on OS X")
exec_program(uname ARGS -v OUTPUT_VARIABLE DARWIN_VERSION)
string(REGEX MATCH "[0-9]+" DARWIN_VERSION ${DARWIN_VERSION})