Skip to content

Commit 27ca93b

Browse files
committed
Further reduce binary size
1 parent c67b678 commit 27ca93b

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

ax/Makefile

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,16 @@ $(FINAL_BINARY_PATH): $(UNIVERSAL_BINARY_PATH)
1717

1818
$(UNIVERSAL_BINARY_PATH):
1919
@echo "Building universal binary for $(UNIVERSAL_BINARY_NAME) (arm64 + x86_64) with size optimization (Osize, dead_strip)..."
20-
@swift build -c release --arch arm64 --arch x86_64 -Xswiftc -Osize -Xcc -Wl,-dead_strip
21-
@echo "Stripping symbols from $(UNIVERSAL_BINARY_PATH)..."
22-
@strip $(UNIVERSAL_BINARY_PATH)
23-
@echo "Universal binary built and stripped at $(UNIVERSAL_BINARY_PATH)"
20+
@swift build -c release --arch arm64 --arch x86_64 -Xswiftc -Osize -Xlinker -Wl,-dead_strip
21+
@echo "Aggressively stripping symbols (strip -x) from $(UNIVERSAL_BINARY_PATH)..."
22+
@strip -x $(UNIVERSAL_BINARY_PATH)
23+
@echo "Universal binary built and stripped: $(UNIVERSAL_BINARY_PATH)"
2424

25-
# Clean build artifacts
2625
clean:
2726
@echo "Cleaning build artifacts..."
28-
@rm -rf .build $(FINAL_BINARY_PATH)
27+
@rm -rf $(SWIFT_BUILD_DIR)
28+
@rm -f $(FINAL_BINARY_PATH)
29+
@rm -f $(UNIVERSAL_BINARY_PATH) # Also remove the intermediate universal binary if it exists
2930
@echo "Clean complete."
3031

3132
.PHONY: all clean

0 commit comments

Comments
 (0)