mirror of
https://github.com/labwc/labwc.git
synced 2025-10-29 05:40:24 -04:00
build: add 'sections' option to show unused functions
This commit is contained in:
parent
c5cd1f691d
commit
27f3097f8f
2 changed files with 11 additions and 0 deletions
10
meson.build
10
meson.build
|
|
@ -134,6 +134,15 @@ if get_option('static_analyzer').enabled()
|
||||||
add_project_arguments(['-fanalyzer'], language: 'c')
|
add_project_arguments(['-fanalyzer'], language: 'c')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
link_args = []
|
||||||
|
if get_option('sections').enabled()
|
||||||
|
add_project_arguments(['-ffunction-sections'], language: 'c')
|
||||||
|
link_args += [
|
||||||
|
'-Wl,--gc-sections',
|
||||||
|
'-Wl,--print-gc-sections',
|
||||||
|
]
|
||||||
|
endif
|
||||||
|
|
||||||
msgfmt = find_program('msgfmt', required: get_option('nls'))
|
msgfmt = find_program('msgfmt', required: get_option('nls'))
|
||||||
if msgfmt.found()
|
if msgfmt.found()
|
||||||
source_root = meson.current_source_dir()
|
source_root = meson.current_source_dir()
|
||||||
|
|
@ -193,6 +202,7 @@ executable(
|
||||||
include_directories: [labwc_inc],
|
include_directories: [labwc_inc],
|
||||||
dependencies: labwc_deps,
|
dependencies: labwc_deps,
|
||||||
install: true,
|
install: true,
|
||||||
|
link_args: link_args,
|
||||||
)
|
)
|
||||||
|
|
||||||
install_data('data/labwc.desktop', install_dir: get_option('datadir') / 'wayland-sessions')
|
install_data('data/labwc.desktop', install_dir: get_option('datadir') / 'wayland-sessions')
|
||||||
|
|
|
||||||
|
|
@ -5,3 +5,4 @@ option('icon', type: 'feature', value: 'enabled', description: 'Enable window ic
|
||||||
option('nls', type: 'feature', value: 'auto', description: 'Enable native language support')
|
option('nls', type: 'feature', value: 'auto', description: 'Enable native language support')
|
||||||
option('static_analyzer', type: 'feature', value: 'disabled', description: 'Run gcc static analyzer')
|
option('static_analyzer', type: 'feature', value: 'disabled', description: 'Run gcc static analyzer')
|
||||||
option('test', type: 'feature', value: 'disabled', description: 'Run tests')
|
option('test', type: 'feature', value: 'disabled', description: 'Run tests')
|
||||||
|
option('sections', type: 'feature', value: 'disabled', description: 'Show unused functions')
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue