Thomas Heijligen submitted this change.
meson: link flashrom binary against static libflashrom
TEST: meson build && ninja -C build
Read chip successfully with ch341a_spi programmer
Change-Id: Ic522610f59e00299ebfa1bd29482ff92120ec52b
Signed-off-by: Thomas Heijligen <thomas.heijligen@secunet.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/64030
Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
Reviewed-by: Peter Marheine <pmarheine@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
---
M meson.build
1 file changed, 7 insertions(+), 20 deletions(-)
diff --git a/meson.build b/meson.build
index 30ebb88..cbce8c1 100644
--- a/meson.build
+++ b/meson.build
@@ -425,7 +425,7 @@
mapfile = 'libflashrom.map'
vflag = '-Wl,--version-script,@0@/@1@'.format(meson.current_source_dir(), mapfile)
-flashrom = library(
+libflashrom = both_libraries(
'flashrom',
sources : [
srcs,
@@ -455,7 +455,7 @@
pkgg = import('pkgconfig')
pkgg.generate(
- libraries : flashrom,
+ libraries : libflashrom,
version : version,
name : 'flashrom',
filebase : 'flashrom',
@@ -472,31 +472,18 @@
install_dir: join_paths(get_option('mandir'), 'man8'),
)
-flashrom_dep = declare_dependency(
- link_with : flashrom,
- include_directories : include_dir,
- dependencies : deps
-)
-
-# we can't just link_with libflashrom as we require all the internal symbols...
executable(
'flashrom',
- sources : [
- srcs,
+ files(
'cli_classic.c',
'cli_common.c',
'cli_output.c',
- 'flashrom.c',
- ],
+ ),
+ c_args : cargs,
include_directories : include_dir,
- dependencies : [
- deps,
- ],
- c_args : [
- cargs
- ],
install : true,
- install_dir : get_option('sbindir')
+ install_dir : get_option('sbindir'),
+ link_with : libflashrom.get_static_lib(), # flashrom needs internal symbols of libflashrom
)
subdir('util')
To view, visit change 64030. To unsubscribe, or for help writing mail filters, visit settings.