tup: platform-specific gc sections;

This commit is contained in:
bjorn 2021-04-03 14:46:50 -06:00
parent 832274edb6
commit 7bc3bc232e
1 changed files with 4 additions and 1 deletions

View File

@ -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