1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-30 17:41:12 +00:00
nixpkgs/pkgs/applications/misc/synergy/respect_macos_arch.patch
Michael Hoang fe69ee86c8 Fix Synergy building on macOS
Update gtest and gmock to fix clang compiler issues, as well as patch
CMakeLists.txt in multiple places to fix other issues on macOS.
2018-07-16 23:57:40 +10:00

62 lines
1.7 KiB
Diff

From 944177c76d4c7ff5ef3460eab28286a45344a0e7 Mon Sep 17 00:00:00 2001
From: Michael Hoang <enzime@users.noreply.github.com>
Date: Sat, 14 Jul 2018 21:56:59 +1000
Subject: [PATCH 2/2] Make sure CMake respects the current arch on macOS
Only set the macOS architecture if not defined by the user. Use the
OpenSSL libraries and headers from Nix on macOS to prevent architecture
mismatches.
---
CMakeLists.txt | 2 +-
src/CMakeLists.txt | 14 +-------------
2 files changed, 2 insertions(+), 14 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2f37424d..c7217e28 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -172,7 +172,7 @@ if (UNIX)
# <= 10.5: 32-bit Intel and PowerPC
set(CMAKE_OSX_ARCHITECTURES "ppc;i386"
CACHE STRING "" FORCE)
- else()
+ elseif (NOT CMAKE_OSX_ARCHITECTURES)
# >= 10.6: Intel only
set(CMAKE_OSX_ARCHITECTURES "i386"
CACHE STRING "" FORCE)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 237ba484..04428636 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -23,11 +23,6 @@ if (WIN32)
set(OPENSSL_INCLUDE ${CMAKE_SOURCE_DIR}/ext/${OPENSSL_PLAT_DIR}/inc32)
endif()
-if (APPLE)
- set(OPENSSL_PLAT_DIR openssl-osx)
- set(OPENSSL_INCLUDE ${CMAKE_SOURCE_DIR}/ext/${OPENSSL_PLAT_DIR}/include)
-endif()
-
if (WIN32)
set(OPENSSL_LIBS
${CMAKE_SOURCE_DIR}/ext/${OPENSSL_PLAT_DIR}/out32dll/libeay32.lib
@@ -36,14 +31,7 @@ if (WIN32)
endif()
if (UNIX)
- if (APPLE)
- set(OPENSSL_LIBS
- ${CMAKE_SOURCE_DIR}/ext/${OPENSSL_PLAT_DIR}/libssl.a
- ${CMAKE_SOURCE_DIR}/ext/${OPENSSL_PLAT_DIR}/libcrypto.a
- )
- else()
- set(OPENSSL_LIBS ssl crypto)
- endif()
+ set(OPENSSL_LIBS ssl crypto)
endif()
add_subdirectory(lib)
--
2.17.1