From 9905a2bd4be1a8965e5b4b50557c8958d3f8ce95 Mon Sep 17 00:00:00 2001 From: Thomas Winget Date: Tue, 16 Jun 2020 20:36:18 -0400 Subject: [PATCH] static build flag for win/mac static builds in drone config --- .drone.jsonnet | 6 +++--- CMakeLists.txt | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.drone.jsonnet b/.drone.jsonnet index 0858e303d..2fa46475e 100644 --- a/.drone.jsonnet +++ b/.drone.jsonnet @@ -230,8 +230,8 @@ local mac_builder(name, build_type='Release', werror=true, cmake_extra='', extra debian_pipeline("Debian buster (armhf)", "arm32v7/debian:buster", arch="arm64", cmake_extra='-DDOWNLOAD_SODIUM=ON'), // Windows builds (WOW64 and native) - alpine_win32_pipeline("win32 on alpine (amd64)", "alpine:edge", cmake_extra="-DDOWNLOAD_SODIUM=ON -DBUILD_PACKAGE=OFF -DBUILD_SHARED_LIBS=OFF -DBUILD_TESTING=ON -DNATIVE_BUILD=OFF -DSTATIC_LINK=ON", lto=false), - alpine_wow64_pipeline("win32 on alpine (i386)", "i386/alpine:edge", cmake_extra="-DDOWNLOAD_SODIUM=ON -DBUILD_PACKAGE=OFF -DBUILD_SHARED_LIBS=OFF -DBUILD_TESTING=ON -DNATIVE_BUILD=OFF -DSTATIC_LINK=ON", lto=false), + alpine_win32_pipeline("win32 on alpine (amd64)", "alpine:edge", cmake_extra="-DBUILD_STATIC_DEPS=ON -DDOWNLOAD_SODIUM=ON -DBUILD_PACKAGE=OFF -DBUILD_SHARED_LIBS=OFF -DBUILD_TESTING=ON -DNATIVE_BUILD=OFF -DSTATIC_LINK=ON", lto=false), + alpine_wow64_pipeline("win32 on alpine (i386)", "i386/alpine:edge", cmake_extra="-DBUILD_STATIC_DEPS=ON -DDOWNLOAD_SODIUM=ON -DBUILD_PACKAGE=OFF -DBUILD_SHARED_LIBS=OFF -DBUILD_TESTING=ON -DNATIVE_BUILD=OFF -DSTATIC_LINK=ON", lto=false), // Static build (on bionic) which gets uploaded to builds.lokinet.dev: debian_pipeline("Static (bionic amd64)", "ubuntu:bionic", deps='g++-8 python3-dev', lto=true, @@ -255,7 +255,7 @@ local mac_builder(name, build_type='Release', werror=true, cmake_extra='', extra // Macos builds: mac_builder('macOS (Release)'), mac_builder('macOS (Debug)', build_type='Debug'), - mac_builder('macOS (Static)', cmake_extra='-DBUILD_SHARED_LIBS=OFF -DSTATIC_LINK=ON -DDOWNLOAD_SODIUM=FORCE -DDOWNLOAD_CURL=FORCE -DDOWNLOAD_UV=FORCE', + mac_builder('macOS (Static)', cmake_extra='-DBUILD_STATIC_DEPS=ON -DBUILD_SHARED_LIBS=OFF -DSTATIC_LINK=ON -DDOWNLOAD_SODIUM=FORCE -DDOWNLOAD_CURL=FORCE -DDOWNLOAD_UV=FORCE', extra_cmds=[ '../contrib/ci/drone-check-static-libs.sh', '../contrib/ci/drone-static-upload.sh' diff --git a/CMakeLists.txt b/CMakeLists.txt index 880bf6dd6..c917eff0b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -226,8 +226,9 @@ endif() string(REGEX REPLACE "^fatal.*$" nogit GIT_VERSION_REAL "${GIT_VERSION}") +find_package(PkgConfig REQUIRED) + if (NOT BUILD_STATIC_DEPS) - find_package(PkgConfig REQUIRED) pkg_check_modules(UNBOUND libunbound REQUIRED IMPORTED_TARGET) add_library(libunbound INTERFACE) target_link_libraries(libunbound INTERFACE PkgConfig::UNBOUND)