mirror of
https://review.coreboot.org/flashrom.git
synced 2025-04-27 23:22:37 +02:00
meson.build: Use library() to build libflashrom
Use library() instead of both_libraries() to build libflashrom. The built-in option `default-library` can be used to decide which kind of libraries should be built. Make `both` the default and throw an error in the case someone tries to build the classic_cli with a shared library. Change-Id: I27f10fdf1227795a9a3b4e050a2d708b58f10ee7 Signed-off-by: Thomas Heijligen <thomas.heijligen@secunet.com> Reviewed-on: https://review.coreboot.org/c/flashrom/+/73101 Reviewed-by: Edward O'Callaghan <quasisec@chromium.org> Reviewed-by: Anastasia Klimchuk <aklm@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
parent
f3c21c6439
commit
67ca4a71c4
15
meson.build
15
meson.build
@ -8,9 +8,17 @@ project('flashromutils', 'c',
|
|||||||
'werror=true',
|
'werror=true',
|
||||||
'optimization=s',
|
'optimization=s',
|
||||||
'debug=false',
|
'debug=false',
|
||||||
|
'default_library=both'
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if get_option('classic_cli').enabled() and get_option('default_library') == 'shared'
|
||||||
|
error('''
|
||||||
|
Cannot build cli_classic with shared libflashrom. Use \'-Dclassic_cli=disabled\' to disable the cli,
|
||||||
|
or use \'--default-library=both\' to also build the classic_cli
|
||||||
|
''')
|
||||||
|
endif
|
||||||
|
|
||||||
subdir('doc')
|
subdir('doc')
|
||||||
|
|
||||||
# libtool versioning
|
# libtool versioning
|
||||||
@ -587,7 +595,7 @@ if host_machine.system() == 'darwin'
|
|||||||
else
|
else
|
||||||
vflag = '-Wl,--version-script,@0@/@1@'.format(meson.current_source_dir(), mapfile)
|
vflag = '-Wl,--version-script,@0@/@1@'.format(meson.current_source_dir(), mapfile)
|
||||||
endif
|
endif
|
||||||
libflashrom = both_libraries(
|
libflashrom = library(
|
||||||
'flashrom',
|
'flashrom',
|
||||||
sources : [
|
sources : [
|
||||||
srcs,
|
srcs,
|
||||||
@ -624,7 +632,7 @@ pkgg.generate(
|
|||||||
description : 'library to interact with flashrom',
|
description : 'library to interact with flashrom',
|
||||||
)
|
)
|
||||||
|
|
||||||
if get_option('classic_cli').auto() or get_option('classic_cli').enabled()
|
if get_option('classic_cli').enabled() or get_option('classic_cli').auto() and not get_option('default_library') == 'shared'
|
||||||
classic_cli = executable(
|
classic_cli = executable(
|
||||||
'flashrom',
|
'flashrom',
|
||||||
files(
|
files(
|
||||||
@ -637,7 +645,8 @@ if get_option('classic_cli').auto() or get_option('classic_cli').enabled()
|
|||||||
install : true,
|
install : true,
|
||||||
install_dir : get_option('sbindir'),
|
install_dir : get_option('sbindir'),
|
||||||
link_args : link_args,
|
link_args : link_args,
|
||||||
link_with : libflashrom.get_static_lib(), # flashrom needs internal symbols of libflashrom
|
# flashrom needs internal symbols of libflashrom
|
||||||
|
link_with : get_option('default_library') == 'static' ? libflashrom : libflashrom.get_static_lib(),
|
||||||
)
|
)
|
||||||
if get_option('llvm_cov').enabled()
|
if get_option('llvm_cov').enabled()
|
||||||
run_target('llvm-cov-cli', command : ['scripts/llvm-cov', classic_cli])
|
run_target('llvm-cov-cli', command : ['scripts/llvm-cov', classic_cli])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user