[Build] Add option to build with lto to meson.

Fix error in test.

Issue: #1743
This commit is contained in:
Dave Davenport 2022-11-17 11:25:45 +01:00
parent 53391da45a
commit fb80595725
3 changed files with 10 additions and 2 deletions

View file

@ -30,6 +30,13 @@ foreach f : flags
endif
endforeach
if get_option('lto')
add_project_arguments('-flto', language: 'c')
add_project_arguments('-Werror=odr', language: 'c')
add_project_arguments('-Werror=lto-type-mismatch', language: 'c')
add_project_arguments('-Werror=strict-aliasing', language: 'c')
endif
plugindir = join_paths(get_option('libdir'), meson.project_name())
themedir = join_paths(get_option('datadir'), meson.project_name(), 'themes')
desktop_install_dir = join_paths(get_option('datadir'), 'applications')

View file

@ -2,3 +2,4 @@ option('drun', type: 'boolean', value: true, description: 'Desktop file mode')
option('window', type: 'boolean', value: true, description: 'Window switcher mode')
option('check', type: 'feature', description: 'Build and run libcheck-based tests')
option('imdkit', type: 'boolean', value: true, description: 'IMDKit support')
option('lto', type: 'boolean', value: false, description: 'Compile with lto')

View file

@ -97,8 +97,8 @@ char *helper_get_theme_path(const char *file, G_GNUC_UNUSED const char *ext) {
}
void rofi_add_error_message(G_GNUC_UNUSED GString *msg) {}
void rofi_add_warning_message(G_GNUC_UNUSED GString *msg) {}
int textbox_get_estimated_char_height(void);
int textbox_get_estimated_char_height(void) { return 16; }
double textbox_get_estimated_char_height(void);
double textbox_get_estimated_char_height(void) { return 16; }
double textbox_get_estimated_ch(void);
double textbox_get_estimated_ch(void) { return 8; }
void rofi_view_get_current_monitor(G_GNUC_UNUSED int *width,