Skip to content

Commit 7fe2c47

Browse files
committed
Add stripping of debug symbols for platform-specific builds in Makefile
1 parent 36e6409 commit 7fe2c47

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Makefile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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 $@
7475
else 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 $@
8082
else 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 $@
103106
else 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 $@
110114
else 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 $@
123128
endif
124129

125130
ifneq ($(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
155160
endif
161+
# Strip debug symbols
162+
$(STRIP)
156163
else
157164
#WASM build
158165
EMSDK := $(BUILD_WASM)/emsdk

0 commit comments

Comments
 (0)