aboutsummaryrefslogtreecommitdiff
path: root/pw_build/BUILD.gn
diff options
context:
space:
mode:
Diffstat (limited to 'pw_build/BUILD.gn')
-rw-r--r--pw_build/BUILD.gn8
1 files changed, 8 insertions, 0 deletions
diff --git a/pw_build/BUILD.gn b/pw_build/BUILD.gn
index a6d0cd7de..1a74c2bad 100644
--- a/pw_build/BUILD.gn
+++ b/pw_build/BUILD.gn
@@ -70,6 +70,14 @@ config("reduced_size") {
"-fdata-sections",
]
cflags_cc = [ "-fno-rtti" ]
+
+ if (current_os == "mac" || current_os == "ios") {
+ # Delete unreferenced sections. Helpful with -ffunction-sections.
+ ldflags = [ "-Wl,-dead_strip" ]
+ } else {
+ # Delete unreferenced sections. Helpful with -ffunction-sections.
+ ldflags = [ "-Wl,--gc-sections" ]
+ }
}
config("strict_warnings") {