summary refs log tree commit diff
path: root/pkgs/applications/misc/synergy/respect_macos_arch.patch
blob: 003d7d22421a1c359fa8042bf1322691b5f49d10 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
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