]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
build: add static build target
authorDaniel Wagner <dwagner@suse.de>
Fri, 12 Jul 2024 11:52:54 +0000 (13:52 +0200)
committerDaniel Wagner <wagi@monom.org>
Fri, 12 Jul 2024 17:57:14 +0000 (19:57 +0200)
Add a static build target.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
scripts/build.sh

index 933d62bc7a204e9104fffe30a0b192fc7c7638dd..a88336fb9021602147b1cd45cac549152076350f 100755 (executable)
@@ -23,6 +23,7 @@ usage() {
     echo "  appimage            build AppImage target"
     echo "  distro              build libnvme and nvme-cli separately"
     echo "  docs                build documentation"
+    echo "  static              build a static binary"
     echo ""
     echo "configs with muon:"
     echo "  [default]           minimal static build"
@@ -126,6 +127,16 @@ config_meson_docs() {
         "${BUILDDIR}"
 }
 
+config_meson_static() {
+    CC="${CC}" "${MESON}" setup                 \
+        --buildtype=release                     \
+        --default-library=static                \
+        --wrap-mode=forcefallback               \
+        -Dc_link_args="-static"                 \
+        -Dlibnvme:keyutils=disabled             \
+        "${BUILDDIR}"
+}
+
 build_meson() {
     "${MESON}" compile                          \
         -C "${BUILDDIR}"