@@ -71,12 +71,14 @@ ifeq ($(PLATFORM),windows)
7171 CFLAGS += -DCURL_STATICLIB
7272 CURL_CONFIG = --with-schannel CFLAGS="-DCURL_STATICLIB"
7373 EXE = .exe
74+ STRIP = strip --strip-unneeded $@
7475else ifeq ($(PLATFORM),macos)
7576 TARGET := $(DIST_DIR ) /cloudsync.dylib
7677 LDFLAGS += -arch x86_64 -arch arm64 -framework Security -dynamiclib -undefined dynamic_lookup
7778 T_LDFLAGS = -framework Security
7879 CFLAGS += -arch x86_64 -arch arm64
7980 CURL_CONFIG = --with-secure-transport CFLAGS="-arch x86_64 -arch arm64"
81+ STRIP = strip -x -S $@
8082else ifeq ($(PLATFORM),android)
8183 # Set ARCH to find Android NDK's Clang compiler, the user should set the ARCH
8284 ifeq ($(filter %,$(ARCH)),)
@@ -100,13 +102,15 @@ else ifeq ($(PLATFORM),android)
100102 CURL_CONFIG = --host $(ARCH ) -$(HOST ) -android26 --with-openssl=$(BIN ) /../sysroot/usr LIBS="-lssl -lcrypto" AR=$(BIN ) /llvm-ar AS=$(BIN ) /llvm-as CC=$(CC ) CXX=$(BIN ) /$(ARCH ) -linux-android26-clang++ LD=$(BIN ) /ld RANLIB=$(BIN ) /llvm-ranlib STRIP=$(BIN ) /llvm-strip
101103 TARGET := $(DIST_DIR ) /cloudsync.so
102104 LDFLAGS += -shared -lcrypto -lssl
105+ STRIP = $(BIN ) /llvm-strip --strip-unneeded $@
103106else ifeq ($(PLATFORM),ios)
104107 TARGET := $(DIST_DIR ) /cloudsync.dylib
105108 SDK := -isysroot $(shell xcrun --sdk iphoneos --show-sdk-path) -miphoneos-version-min=11.0
106109 LDFLAGS += -framework Security -framework CoreFoundation -dynamiclib $(SDK )
107110 T_LDFLAGS = -framework Security
108111 CFLAGS += -arch arm64 $(SDK )
109112 CURL_CONFIG = --host=arm64-apple-darwin --with-secure-transport CFLAGS="-arch arm64 -isysroot $$(xcrun --sdk iphoneos --show-sdk-path ) -miphoneos-version-min=11.0"
113+ STRIP = strip -x -S $@
110114else ifeq ($(PLATFORM),isim)
111115 TARGET := $(DIST_DIR ) /cloudsync.dylib
112116 SDK := -isysroot $(shell xcrun --sdk iphonesimulator --show-sdk-path) -miphonesimulator-version-min=11.0
@@ -120,6 +124,7 @@ else # linux
120124 TARGET := $(DIST_DIR ) /cloudsync.so
121125 LDFLAGS += -shared -lssl -lcrypto
122126 CURL_CONFIG = --with-openssl
127+ STRIP = strip --strip-unneeded $@
123128endif
124129
125130ifneq ($(COVERAGE ) ,false)
@@ -153,6 +158,8 @@ ifeq ($(PLATFORM),windows)
153158 # Generate import library for Windows
154159 dlltool -D $@ -d $(DEF_FILE) -l $(DIST_DIR)/cloudsync.lib
155160endif
161+ # Strip debug symbols
162+ $(STRIP)
156163else
157164# WASM build
158165EMSDK := $(BUILD_WASM ) /emsdk
0 commit comments