build: add enable-tools option

this is mainly useful for multilib, but may be useful for other users as well

Signed-off-by: Alex Xu (Hello71) <alex_y_xu@yahoo.ca>
master
Alex Xu (Hello71) 2021-10-08 09:51:10 -04:00 committed by Ran Benita
parent 50a24569b8
commit 8531ea723f
2 changed files with 8 additions and 4 deletions

View File

@ -125,8 +125,6 @@ elif cc.has_header_symbol('stdlib.h', '__secure_getenv', prefix: system_ext_defi
else else
message('C library does not support secure_getenv, using getenv instead') message('C library does not support secure_getenv, using getenv instead')
endif endif
have_getopt_long = cc.has_header_symbol('getopt.h', 'getopt_long',
prefix: '#define _GNU_SOURCE')
if not cc.has_header_symbol('limits.h', 'PATH_MAX', prefix: system_ext_define) if not cc.has_header_symbol('limits.h', 'PATH_MAX', prefix: system_ext_define)
if host_machine.system() == 'windows' if host_machine.system() == 'windows'
# see https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file#maximum-path-length-limitation # see https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file#maximum-path-length-limitation
@ -406,7 +404,7 @@ endif
man_pages = [] man_pages = []
# Tools # Tools
build_tools = have_getopt_long build_tools = get_option('enable-tools') and cc.has_header_symbol('getopt.h', 'getopt_long', prefix: '#define _GNU_SOURCE')
if build_tools if build_tools
libxkbcommon_tools_internal = static_library( libxkbcommon_tools_internal = static_library(
'tools-internal', 'tools-internal',

View File

@ -43,6 +43,12 @@ option(
value: '', value: '',
description: 'Default XKB options', description: 'Default XKB options',
) )
option(
'enable-tools',
type: 'boolean',
value: true,
description: 'Enable building tools',
)
option( option(
'enable-x11', 'enable-x11',
type: 'boolean', type: 'boolean',
@ -59,7 +65,7 @@ option(
'enable-wayland', 'enable-wayland',
type: 'boolean', type: 'boolean',
value: true, value: true,
description: 'Enable support for Wayland utility programs', description: 'Enable support for Wayland utility programs (requires enable-tools)',
) )
option( option(
'enable-xkbregistry', 'enable-xkbregistry',