@@ -72,10 +72,17 @@ ifeq ($(PLATFORM),windows)
7272 STRIP = strip --strip-unneeded $@
7373else ifeq ($(PLATFORM),macos)
7474 TARGET := $(DIST_DIR)/cloudsync.dylib
75- LDFLAGS += -arch x86_64 -arch arm64 -framework Security -dynamiclib -undefined dynamic_lookup
75+ ifndef ARCH
76+ LDFLAGS += -arch x86_64 -arch arm64
77+ CFLAGS += -arch x86_64 -arch arm64
78+ CURL_CONFIG = --with-secure-transport CFLAGS="-arch x86_64 -arch arm64"
79+ else
80+ LDFLAGS += -arch $(ARCH)
81+ CFLAGS += -arch $(ARCH)
82+ CURL_CONFIG = --with-secure-transport CFLAGS="-arch $(ARCH)"
83+ endif
84+ LDFLAGS += -framework Security -dynamiclib -undefined dynamic_lookup -headerpad_max_install_names
7685 T_LDFLAGS = -framework Security
77- CFLAGS += -arch x86_64 -arch arm64
78- CURL_CONFIG = --with-secure-transport CFLAGS="-arch x86_64 -arch arm64"
7986 STRIP = strip -x -S $@
8087else ifeq ($(PLATFORM),android)
8188 ifndef ARCH # Set ARCH to find Android NDK's Clang compiler, the user should set the ARCH
@@ -101,15 +108,15 @@ else ifeq ($(PLATFORM),android)
101108else ifeq ($(PLATFORM),ios)
102109 TARGET := $(DIST_DIR)/cloudsync.dylib
103110 SDK := -isysroot $(shell xcrun --sdk iphoneos --show-sdk-path) -miphoneos-version-min=11.0
104- LDFLAGS += -framework Security -framework CoreFoundation -dynamiclib $(SDK)
111+ LDFLAGS += -framework Security -framework CoreFoundation -dynamiclib $(SDK) -headerpad_max_install_names
105112 T_LDFLAGS = -framework Security
106113 CFLAGS += -arch arm64 $(SDK)
107114 CURL_CONFIG = --host=arm64-apple-darwin --with-secure-transport CFLAGS="-arch arm64 -isysroot $$(xcrun --sdk iphoneos --show-sdk-path) -miphoneos-version-min=11.0"
108115 STRIP = strip -x -S $@
109116else ifeq ($(PLATFORM),ios-sim)
110117 TARGET := $(DIST_DIR)/cloudsync.dylib
111118 SDK := -isysroot $(shell xcrun --sdk iphonesimulator --show-sdk-path) -miphonesimulator-version-min=11.0
112- LDFLAGS += -arch x86_64 -arch arm64 -framework Security -framework CoreFoundation -dynamiclib $(SDK)
119+ LDFLAGS += -arch x86_64 -arch arm64 -framework Security -framework CoreFoundation -dynamiclib $(SDK) -headerpad_max_install_names
113120 T_LDFLAGS = -framework Security
114121 CFLAGS += -arch x86_64 -arch arm64 $(SDK)
115122 CURL_CONFIG = --host=arm64-apple-darwin --with-secure-transport CFLAGS="-arch x86_64 -arch arm64 -isysroot $$(xcrun --sdk iphonesimulator --show-sdk-path) -miphonesimulator-version-min=11.0"
0 commit comments