optimized meson.build to decrease filesize

This commit is contained in:
Dniel97 2023-12-25 15:55:43 +01:00
parent f5f275c8e9
commit f4a3a5f78d
Signed by untrusted user: Dniel97
GPG Key ID: 6180B3C768FB2E08

View File

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