From e9b638521e7c450e4947090d3672aab852c8e758 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Tue, 6 Nov 2018 06:00:11 +0100 Subject: Add file size optimisations to Release build * Remove `dome-key-map/target/debug` from Release library search paths. This was causing the Release build to link against the debug version of dome-key-map, resulting in a 25 Mb binary. * Strip debug symbols * Turn on link-time optimisation This takes the Release binary down to 1.5 Mb. Added an `archive` target to the Makefile. This does additional optimisations (maybe stripping symbols?), and gives us a final binary size of 1.1 Mb. Much better. --- Makefile | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 02b2a62..f2029ff 100644 --- a/Makefile +++ b/Makefile @@ -40,6 +40,17 @@ $(RUST_LIB_RELEASE): $(RUST_SOURCE_FILES) $(MAKE) -C $(RUST_DIR) $(RUST_LOCAL_LIB_RELEASE) +# Archive + +.PHONY: archive +archive: clean-release + xcodebuild -project DomeKey.xcodeproj \ + -scheme DomeKey \ + -configuration Release \ + archive \ + -archivePath build/Release.xcarchive + + # Sounds DomeKey/sound_data.h: sounds/*.mp3 -- cgit v1.2.3