From f4a3a5f78d91d3764c5caf58cd8202cda4738957 Mon Sep 17 00:00:00 2001 From: Dniel97 Date: Mon, 25 Dec 2023 15:55:43 +0100 Subject: [PATCH] optimized meson.build to decrease filesize --- meson.build | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/meson.build b/meson.build index c4936be..a0db24a 100644 --- a/meson.build +++ b/meson.build @@ -17,11 +17,13 @@ add_project_arguments( language: 'c', ) -# Use get_argument_syntax() instead once Meson 0.49.0 releases -if meson.get_compiler('c').get_id() != 'msvc' +cc = meson.get_compiler('c') + +if cc.get_id() != 'msvc' add_project_arguments( '-ffunction-sections', '-fdata-sections', + '-flto', # Enable Link-Time Optimization language: 'c', ) @@ -30,11 +32,12 @@ if meson.get_compiler('c').get_id() != 'msvc' '-Wl,--exclude-all-symbols', '-Wl,--gc-sections', '-static-libgcc', + '-flto', # Enable Link-Time Optimization + '-Wl,-s', # Strip debug symbols language: 'c', ) endif -cc = meson.get_compiler('c') shlwapi_lib = cc.find_library('shlwapi') dinput8_lib = cc.find_library('dinput8') dxguid_lib = cc.find_library('dxguid')