From a2d586b78254f6ba3b12d20f2398f31e9ee66235 Mon Sep 17 00:00:00 2001 From: iphydf Date: Thu, 23 Apr 2020 16:18:15 +0000 Subject: Rework the toxchat/bootstrap-node Docker image. * Use fully static build for the bootstrap daemon. * Store a sha256sum of the binary in the repo. * Updated documentation for it. * Add support for fully static build in cmake. * Enable the docker build on every PR, so we catch changes to the checksum. I realise this is adding toil, but having the checksum is valuable for security of released binaries. --- cmake/ModulePackage.cmake | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'cmake') diff --git a/cmake/ModulePackage.cmake b/cmake/ModulePackage.cmake index 77911b1d..9cc21863 100644 --- a/cmake/ModulePackage.cmake +++ b/cmake/ModulePackage.cmake @@ -9,6 +9,16 @@ if(NOT ENABLE_SHARED AND NOT ENABLE_STATIC) set(ENABLE_SHARED ON) endif() +option(FULLY_STATIC "Build fully static executables" OFF) +if(FULLY_STATIC) + set(CMAKE_EXE_LINKER_FLAGS "-static -no-pie") + # remove -Wl,-Bdynamic + set(CMAKE_EXE_LINK_DYNAMIC_C_FLAGS) + set(CMAKE_EXE_LINK_DYNAMIC_CXX_FLAGS) + set(ENABLE_SHARED OFF) + set(ENABLE_STATIC ON) +endif() + find_package(PkgConfig) function(pkg_use_module mod pkg) -- cgit v1.2.3