From 3527cdfcb4dbc67ba89aad45110e3c0e5ff3a312 Mon Sep 17 00:00:00 2001 From: Francesco Abbate Date: Mon, 1 Mar 2021 09:47:03 +0100 Subject: [PATCH] Testing global options to remove unused functions --- meson.build | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/meson.build b/meson.build index 4da88afa..57921eac 100644 --- a/meson.build +++ b/meson.build @@ -5,6 +5,15 @@ libm = cc.find_library('m', required : false) libdl = cc.find_library('dl', required : false) lua_dep = dependency('lua5.2', required : false) +lite_link_args = [] +if get_option('buildtype') == 'release' + if cc.get_id() == 'gcc' + lite_link_args += ['-static-libgcc', '-static-libstdc++'] + endif + add_global_arguments('-fdata-sections', '-ffunction-sections', language : ['c', 'cpp']) + add_global_link_arguments('-Wl,--gc-sections', language : ['c', 'cpp']) +endif + if not lua_dep.found() lua_subproject = subproject('lua', default_options: [ 'shared=false', 'use_readline=false', 'app=false' @@ -26,11 +35,6 @@ foreach data_module : ['core', 'fonts', 'plugins', 'colors'] install_subdir('data' / data_module , install_dir : lite_datadir) endforeach -lite_link_args = [] -if cc.get_id() == 'gcc' and get_option('buildtype') == 'release' - lite_link_args += ['-static-libgcc', '-static-libstdc++'] -endif - lite_rc = [] if host_machine.system() == 'windows' windows = import('windows')