1
0
Fork 0
forked from lthn/blockchain

Add STATIC build option and update CI workflows

Introduces a STATIC flag to the Makefile for controlling static builds, passing the appropriate Conan and CMake options. Updates the Windows CI workflow to use STATIC=1 for release builds and adjusts Docker build arguments for consistency.
This commit is contained in:
Snider 2025-10-01 22:28:07 +01:00
parent 87605db373
commit 9389b67880
3 changed files with 11 additions and 5 deletions

View file

@ -49,8 +49,7 @@ jobs:
platforms: linux/amd64,linux/arm64
build-args: |
BUILD_TESTNET=${{ inputs.chain-network == 'testnet' && '1' || '0' }}
THREADS=2
BUILD_TARGET=gcc-linux-x86_64
BUILD_THREADS=2
BUILD_LOCAL=1
tags: lthn/chain:${{ inputs.chain-network == 'testnet' && 'testnet' || 'latest' }}
cache-from: type=gha

View file

@ -42,7 +42,7 @@ jobs:
run: make docs
- name: Compile Release
run: make release CPU_CORES=4 TESTNET=${{ inputs.chain-network == 'testnet' && '1' || '0' }}
run: make release STATIC=1 CPU_CORES=4 TESTNET=${{ inputs.chain-network == 'testnet' && '1' || '0' }}
- name: CLI Artifacts
uses: ./.github/actions/upload-artifacts

View file

@ -80,11 +80,18 @@ CONAN_CACHE := $(CURDIR)/build/sdk
DEFAULT_CONAN_PROFILE := $(CONAN_CACHE)/profiles/default
CC_DOCKER_FILE?=utils/docker/images/lthn-chain/Dockerfile
ifeq ($(STATIC), 1)
CONAN_STATIC_FLAG = True
else
CONAN_STATIC_FLAG = False
endif
all: help
release: conan-profile-detect
@echo "Building profile: $(BUILD_TYPE) testnet=$(TESTNET)"
CONAN_HOME=$(CONAN_CACHE) conan install . --build=missing -s build_type=$(BUILD_TYPE)
CONAN_HOME=$(CONAN_CACHE) conan install . --build=missing -s build_type=$(BUILD_TYPE) -o static=$(CONAN_STATIC_FLAG)
cmake -S . -B $(BUILD_FOLDER) -DCMAKE_TOOLCHAIN_FILE=$(BUILD_FOLDER)/generators/conan_toolchain.cmake -DCMAKE_BUILD_TYPE=$(BUILD_TYPE) -DSTATIC=$(STATIC) -DTESTNET=$(TESTNET) -DBUILD_VERSION=$(BUILD_VERSION)
cmake --build $(BUILD_FOLDER) --config=$(BUILD_TYPE) --parallel=$(CPU_CORES)
(cd $(BUILD_FOLDER) && cpack)
@ -145,7 +152,7 @@ test-debug:
configure:
@echo "Running Config: release"
CONAN_HOME=$(CONAN_CACHE) conan install . --output-folder=build/release --build=missing -s build_type=$(BUILD_TYPE)
cmake -S . -B build/release -DCMAKE_TOOLCHAIN_FILE=build/release/generators/conan_toolchain.cmake -DCMAKE_BUILD_TYPE=$(BUILD_TYPE)
cmake -S . -B build/release -DCMAKE_TOOLCHAIN_FILE=build/release/generators/conan_toolchain.cmake -DCMAKE_BUILD_TYPE=$(BUILD_TYPE) -DSTATIC=$(STATIC) -DTESTNET=$(TESTNET) -DBUILD_VERSION=$(BUILD_VERSION)
docs: configure
@echo "Building Documentation"