tup: platform-specific gc sections;
@@ -25,7 +25,6 @@ FLAGS_@(DEBUG) += -g
FLAGS_@(OPTIMIZE) += -Oz
FLAGS_@(SANITIZE) += -fsanitize=address,undefined
CFLAGS_@(OPTIMIZE) += -fdata-sections -ffunction-sections
-LDFLAGS_@(OPTIMIZE) += -Wl,--gc-sections
ifneq (@(DEBUG),y)
LDFLAGS += -Wl,-s
endif
@@ -72,6 +71,7 @@ ifeq ($(PLATFORM),win32)
CFLAGS += -D_CRT_SECURE_NO_WARNINGS
CFLAGS += -Wno-language-extension-token
LDFLAGS += -lShell32 -lOle32
+ LDFLAGS_@(OPTIMIZE) += -Wl,--gc-sections
EXTRAS += bin/lovr.lib bin/lovr.exp
EXTRAS_@(DEBUG) += bin/lovr.pdb bin/lovr.ilk
endif
@@ -83,6 +83,7 @@ ifeq ($(PLATFORM),linux)
CFLAGS += -DLOVR_GL
LDFLAGS += -lm -lpthread -ldl
LDFLAGS += -Wl,-rpath,\$ORIGIN
+ LDFLAGS_@(OPTIMIZE) += -Wl,--gc-sections
endif
## macOS
@@ -91,6 +92,7 @@ ifeq ($(PLATFORM),macosx)
PLATFORM = macos
CFLAGS += -DLOVR_GL
LDFLAGS += -Wl,-rpath,@executable_path
+ LDFLAGS_@(OPTIMIZE) += -Wl,-dead_strip
LDFLAGS += -lobjc
endif
@@ -117,6 +119,7 @@ ifeq ($(PLATFORM),android)
FLAGS += --target=aarch64-linux-android@(ANDROID_VERSION)
FLAGS_@(DEBUG) += -funwind-tables
LDFLAGS += -shared -landroid -lEGL -lGLESv3
+ LDFLAGS_@(OPTIMIZE) += -Wl,--gc-sections
ACTIVITY_@(OPENXR) = Activity_openxr
ACTIVITY_@(VRAPI) = Activity_vrapi
