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:
parent
87605db373
commit
9389b67880
3 changed files with 11 additions and 5 deletions
3
.github/workflows/build-docker.yml
vendored
3
.github/workflows/build-docker.yml
vendored
|
|
@ -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
|
||||
|
|
|
|||
2
.github/workflows/build-windows-intel.yml
vendored
2
.github/workflows/build-windows-intel.yml
vendored
|
|
@ -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
|
||||
|
|
|
|||
11
Makefile
11
Makefile
|
|
@ -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"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue