Move gcrypt-util to basic/
We were including gcrypt-util.[ch] by hand in the few places where it was used. Create a convenience library to avoid compiling the same files multiple times. v2: - use a separate static library instead of mergin into libbasic
This commit is contained in:
parent
2d4ceca8a5
commit
34e221a58b
18
meson.build
18
meson.build
|
@ -1235,9 +1235,6 @@ includes = include_directories('src/basic',
|
|||
|
||||
add_project_arguments('-include', 'config.h', language : 'c')
|
||||
|
||||
gcrypt_util_sources = files('src/shared/gcrypt-util.h',
|
||||
'src/shared/gcrypt-util.c')
|
||||
|
||||
subdir('po')
|
||||
subdir('catalog')
|
||||
subdir('src/systemd')
|
||||
|
@ -1258,15 +1255,14 @@ libsystemd_sym_path = '@0@/@1@'.format(meson.current_source_dir(), libsystemd_sy
|
|||
libsystemd = shared_library(
|
||||
'systemd',
|
||||
journal_internal_sources,
|
||||
gcrypt_util_sources,
|
||||
version : libsystemd_version,
|
||||
include_directories : includes,
|
||||
link_args : ['-shared',
|
||||
'-Wl,--version-script=' + libsystemd_sym_path],
|
||||
link_with : libbasic,
|
||||
link_with : [libbasic,
|
||||
libbasic_gcrypt],
|
||||
link_whole : libsystemd_static,
|
||||
dependencies : [threads,
|
||||
libgcrypt,
|
||||
librt,
|
||||
libxz,
|
||||
liblz4],
|
||||
|
@ -1507,11 +1503,10 @@ endif
|
|||
if conf.get('ENABLE_RESOLVE') == 1
|
||||
executable('systemd-resolved',
|
||||
systemd_resolved_sources,
|
||||
gcrypt_util_sources,
|
||||
include_directories : includes,
|
||||
link_with : [libshared],
|
||||
link_with : [libshared,
|
||||
libbasic_gcrypt],
|
||||
dependencies : [threads,
|
||||
libgcrypt,
|
||||
libgpg_error,
|
||||
libm,
|
||||
libidn],
|
||||
|
@ -1521,11 +1516,10 @@ if conf.get('ENABLE_RESOLVE') == 1
|
|||
|
||||
exe = executable('systemd-resolve',
|
||||
systemd_resolve_sources,
|
||||
gcrypt_util_sources,
|
||||
include_directories : includes,
|
||||
link_with : [libshared],
|
||||
link_with : [libshared,
|
||||
libbasic_gcrypt],
|
||||
dependencies : [threads,
|
||||
libgcrypt,
|
||||
libgpg_error,
|
||||
libm,
|
||||
libidn],
|
||||
|
|
|
@ -306,3 +306,13 @@ libbasic = static_library(
|
|||
libselinux],
|
||||
c_args : ['-fvisibility=default'],
|
||||
install : false)
|
||||
|
||||
# A convenience library that is separate from libbasic to avoid
|
||||
# unnecessary linking to libgcrypt.
|
||||
libbasic_gcrypt = static_library(
|
||||
'basic-gcrypt',
|
||||
'gcrypt-util.c',
|
||||
'gcrypt-util.h',
|
||||
include_directories : includes,
|
||||
dependencies : [libgcrypt],
|
||||
c_args : ['-fvisibility=default'])
|
||||
|
|
|
@ -56,8 +56,6 @@ shared_sources = '''
|
|||
firewall-util.h
|
||||
fstab-util.c
|
||||
fstab-util.h
|
||||
gcrypt-util.c
|
||||
gcrypt-util.h
|
||||
generator.c
|
||||
generator.h
|
||||
gpt.h
|
||||
|
@ -175,7 +173,8 @@ libshared = shared_library(
|
|||
link_args : ['-shared',
|
||||
'-Wl,--version-script=' + libshared_sym_path],
|
||||
link_whole : [libshared_static,
|
||||
libbasic],
|
||||
libbasic,
|
||||
libbasic_gcrypt],
|
||||
c_args : ['-fvisibility=default'],
|
||||
dependencies : libshared_deps,
|
||||
install : true,
|
||||
|
|
Loading…
Reference in New Issue