diff options
author | Rasmus Thomsen <oss@cogitri.dev> | 2020-10-01 17:53:36 +0200 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2020-10-09 16:09:19 +0300 |
commit | 1bbdc8eb3740ab2125ec4eeca0d1c0b090e4939c (patch) | |
tree | c89ec97bc1ab1e53b1f7e333ea9037d806f5fe46 /src/meson.build | |
parent | 7375327fbd153365e9aa8be8d32a46853061be47 (diff) | |
download | apk-tools-1bbdc8eb3740ab2125ec4eeca0d1c0b090e4939c.tar.gz apk-tools-1bbdc8eb3740ab2125ec4eeca0d1c0b090e4939c.tar.bz2 apk-tools-1bbdc8eb3740ab2125ec4eeca0d1c0b090e4939c.tar.xz apk-tools-1bbdc8eb3740ab2125ec4eeca0d1c0b090e4939c.zip |
build: add option to build apk.static binary
Diffstat (limited to 'src/meson.build')
-rw-r--r-- | src/meson.build | 40 |
1 files changed, 32 insertions, 8 deletions
diff --git a/src/meson.build b/src/meson.build index 233d383..e104a05 100644 --- a/src/meson.build +++ b/src/meson.build @@ -82,26 +82,36 @@ apk_cargs = [ '-D_ATFILE_SOURCE', ] -libapk = library( +libapk_shared = shared_library( 'apk', libapk_src, version: meson.project_version(), - install: true, + install: not subproject, dependencies: [ libfetch_dep, - zlib_dep, - openssl_dep, + shared_deps, ], c_args: apk_cargs, ) +libapk_static = static_library( + 'apk', + libapk_src, + install: not subproject, + dependencies: [ + libfetch_dep, + static_deps, + ], + c_args: [apk_cargs, '-DOPENSSL_NO_ENGINE'], +) + libapk_dep = declare_dependency( - link_with: libapk, + link_with: libapk_shared, ) if not subproject pkgc.generate( - libapk, + libapk_shared, name: 'apk', version: meson.project_version(), ) @@ -133,9 +143,23 @@ apk_exe = executable( install: not subproject, dependencies: [ libapk_dep, - zlib_dep, - openssl_dep, + shared_deps, libfetch_dep.partial_dependency(includes: true), ], c_args: apk_cargs, ) + +if get_option('static_apk') + apk_static_exe = executable( + 'apk.static', + apk_src, + install: not subproject, + dependencies: [ + static_deps, + libfetch_dep.partial_dependency(includes: true), + ], + link_with: libapk_static, + c_args: [apk_cargs, '-DOPENSSL_NO_ENGINE'], + link_args: '-static', + ) +endif |