Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .github/actions/ci/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ runs:
if: inputs.use_curl == 'true' || inputs.install_curl == 'true'
uses: ./.github/actions/install-curl
id: install-curl
- name: Install sccache
uses: mozilla-actions/sccache-action@1583d6b38d7be47f593cb472781bbb21cab4321e # v0.0.10
- name: Build Library
shell: bash
run: ./scripts/build.sh ${{ inputs.cmake_target }} ON ${{ inputs.use_curl }}
Expand Down Expand Up @@ -83,6 +85,11 @@ runs:
# has better performance and output.
run: ./build/gtest_${{ inputs.cmake_target }}

- name: sccache stats (after unit-test build)
if: always()
shell: bash
run: sccache --show-stats || true

- name: Simulate Release (Linux/MacOS)
if: inputs.simulate_release == 'true'
shell: bash
Expand Down Expand Up @@ -113,3 +120,8 @@ runs:
Boost_DIR: 'C:\local\boost_1_87_0\lib64-msvc-14.3\cmake\Boost-1.87.0'
CURL_ROOT: ${{ steps.install-curl.outputs.CURL_ROOT }}
CMAKE_PREFIX_PATH: ${{ steps.install-curl.outputs.CURL_ROOT }}

- name: sccache stats (final)
if: always()
shell: bash
run: sccache --show-stats || true
17 changes: 13 additions & 4 deletions scripts/build-release-windows.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ else
suffix=""
fi

sccache_args=()
if command -v sccache >/dev/null 2>&1; then
sccache_args=(-D CMAKE_C_COMPILER_LAUNCHER=sccache -D CMAKE_CXX_COMPILER_LAUNCHER=sccache)
fi

# Build a static release.
mkdir -p "build-static${suffix}" && cd "build-static${suffix}"
mkdir -p release
Expand All @@ -46,7 +51,8 @@ cmake -G Ninja -D CMAKE_BUILD_TYPE=Release \
-D LD_BUILD_DYNAMODB_SUPPORT="$build_dynamodb" \
-D LD_CURL_NETWORKING="$build_curl" \
-D BUILD_TESTING=OFF \
-D CMAKE_INSTALL_PREFIX=./release ..
-D CMAKE_INSTALL_PREFIX=./release \
"${sccache_args[@]}" ..

cmake --build . --target "$TARGET"
cmake --install .
Expand All @@ -62,7 +68,8 @@ cmake -G Ninja -D CMAKE_BUILD_TYPE=Release \
-D BUILD_TESTING=OFF \
-D LD_BUILD_SHARED_LIBS=ON \
-D LD_DYNAMIC_LINK_BOOST=OFF \
-D CMAKE_INSTALL_PREFIX=./release ..
-D CMAKE_INSTALL_PREFIX=./release \
"${sccache_args[@]}" ..

cmake --build . --target "$TARGET"
cmake --install .
Expand All @@ -76,7 +83,8 @@ cmake -G Ninja -D CMAKE_BUILD_TYPE=Debug \
-D LD_BUILD_REDIS_SUPPORT="$build_redis" \
-D LD_BUILD_DYNAMODB_SUPPORT="$build_dynamodb" \
-D LD_CURL_NETWORKING="$build_curl" \
-D CMAKE_INSTALL_PREFIX=./release ..
-D CMAKE_INSTALL_PREFIX=./release \
"${sccache_args[@]}" ..

cmake --build . --target "$TARGET"
cmake --install .
Expand All @@ -93,7 +101,8 @@ cmake -G Ninja -D CMAKE_BUILD_TYPE=Debug \
-D LD_CURL_NETWORKING="$build_curl" \
-D LD_BUILD_SHARED_LIBS=ON \
-D LD_DYNAMIC_LINK_BOOST=OFF \
-D CMAKE_INSTALL_PREFIX=./release ..
-D CMAKE_INSTALL_PREFIX=./release \
"${sccache_args[@]}" ..

cmake --build . --target "$TARGET"
cmake --install .
9 changes: 7 additions & 2 deletions scripts/build-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,15 @@ else
suffix=""
fi

sccache_args=()
if command -v sccache >/dev/null 2>&1; then
sccache_args=(-D CMAKE_C_COMPILER_LAUNCHER=sccache -D CMAKE_CXX_COMPILER_LAUNCHER=sccache)
fi

# Build a static release.
mkdir -p "build-static${suffix}" && cd "build-static${suffix}"
mkdir -p release
cmake -G Ninja -D CMAKE_BUILD_TYPE=Release -D LD_BUILD_REDIS_SUPPORT="$build_redis" -D LD_BUILD_DYNAMODB_SUPPORT="$build_dynamodb" -D LD_CURL_NETWORKING="$build_curl" -D BUILD_TESTING=OFF -D CMAKE_INSTALL_PREFIX=./release ..
cmake -G Ninja -D CMAKE_BUILD_TYPE=Release -D LD_BUILD_REDIS_SUPPORT="$build_redis" -D LD_BUILD_DYNAMODB_SUPPORT="$build_dynamodb" -D LD_CURL_NETWORKING="$build_curl" -D BUILD_TESTING=OFF -D CMAKE_INSTALL_PREFIX=./release "${sccache_args[@]}" ..

cmake --build . --target "$TARGET"
cmake --install .
Expand All @@ -50,7 +55,7 @@ cd ..
# Build a dynamic release.
mkdir -p "build-dynamic${suffix}" && cd "build-dynamic${suffix}"
mkdir -p release
cmake -G Ninja -D CMAKE_BUILD_TYPE=Release -D LD_BUILD_REDIS_SUPPORT="$build_redis" -D LD_BUILD_DYNAMODB_SUPPORT="$build_dynamodb" -D LD_CURL_NETWORKING="$build_curl" -D BUILD_TESTING=OFF -D LD_BUILD_SHARED_LIBS=ON -D CMAKE_INSTALL_PREFIX=./release ..
cmake -G Ninja -D CMAKE_BUILD_TYPE=Release -D LD_BUILD_REDIS_SUPPORT="$build_redis" -D LD_BUILD_DYNAMODB_SUPPORT="$build_dynamodb" -D LD_CURL_NETWORKING="$build_curl" -D BUILD_TESTING=OFF -D LD_BUILD_SHARED_LIBS=ON -D CMAKE_INSTALL_PREFIX=./release "${sccache_args[@]}" ..

cmake --build . --target "$TARGET"
cmake --install .
Expand Down
9 changes: 8 additions & 1 deletion scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ if [ "$1" == "launchdarkly-cpp-server-otel" ] || [ "$1" == "gtest_launchdarkly-c
build_otel_fetch_deps="ON"
fi

sccache_args=()
if command -v sccache >/dev/null 2>&1; then
sccache_args=(-D CMAKE_C_COMPILER_LAUNCHER=sccache -D CMAKE_CXX_COMPILER_LAUNCHER=sccache)
fi

echo "==== Build Configuration ===="
echo "Target: $1"
echo "CMAKE_BUILD_TYPE: $build_type"
Expand All @@ -63,6 +68,7 @@ echo "LD_BUILD_DYNAMODB_SUPPORT: $build_dynamodb"
echo "LD_CURL_NETWORKING: $build_curl"
echo "LD_BUILD_OTEL_SUPPORT: $build_otel"
echo "LD_BUILD_OTEL_FETCH_DEPS: $build_otel_fetch_deps"
echo "sccache: ${sccache_args[*]:-not detected}"
echo "============================="

cmake -G Ninja -D CMAKE_BUILD_TYPE="$build_type" \
Expand All @@ -74,6 +80,7 @@ cmake -G Ninja -D CMAKE_BUILD_TYPE="$build_type" \
-D LD_BUILD_DYNAMODB_SUPPORT="$build_dynamodb" \
-D LD_CURL_NETWORKING="$build_curl" \
-D LD_BUILD_OTEL_SUPPORT="$build_otel" \
-D LD_BUILD_OTEL_FETCH_DEPS="$build_otel_fetch_deps" ..
-D LD_BUILD_OTEL_FETCH_DEPS="$build_otel_fetch_deps" \
"${sccache_args[@]}" ..

cmake --build . --target "$1"
Loading