mirror of
https://github.com/loot/libloot.git
synced 2026-07-27 14:16:01 -07:00
Adapt build to CMake's CMP0167 policy
This is a little awkward because libloot only needs Boost's headers, but it doesn't supply a CMake config unless it's built, so we build the system stub to make that happen as quickly as possible.
This commit is contained in:
+40
-14
@@ -41,14 +41,27 @@ jobs:
|
||||
LIBLOOT_SAFE_DESC_REF=${LIBLOOT_DESC_REF//[\/<>\"|]/_}
|
||||
echo "version=$LIBLOOT_SAFE_DESC_REF" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Download Boost
|
||||
id: get-boost
|
||||
- name: Get Boost metadata
|
||||
id: boost-metadata
|
||||
run: |
|
||||
BOOST_BASENAME=boost_${BOOST_VERSION//./_}
|
||||
wget https://archives.boost.io/release/${BOOST_VERSION}/source/${BOOST_BASENAME}.tar.gz
|
||||
tar -xf ${BOOST_BASENAME}.tar.gz
|
||||
BOOST_ROOT="${{ github.workspace }}/boost_${BOOST_VERSION//./_}"
|
||||
echo "root=$BOOST_ROOT" >> $GITHUB_OUTPUT
|
||||
|
||||
echo "root=${BOOST_BASENAME}" >> $GITHUB_OUTPUT
|
||||
- name: Boost cache
|
||||
id: boost-cache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: |
|
||||
${{ steps.boost-metadata.outputs.root }}/boost
|
||||
${{ steps.boost-metadata.outputs.root }}/stage
|
||||
key: ${{ runner.os }}-Boost-${{ env.BOOST_VERSION }}
|
||||
|
||||
# Need to build Boost's 'system' stub to generate the CMake config file.
|
||||
- name: Download & build Boost
|
||||
run: |
|
||||
curl -sSfLO https://raw.githubusercontent.com/Ortham/ci-scripts/2.2.1/install_boost.py
|
||||
python install_boost.py --directory ${{ github.workspace }} --boost-version $BOOST_VERSION -a 64 system
|
||||
if: steps.boost-cache.outputs.cache-hit != 'true'
|
||||
|
||||
- name: Install APT package dependencies
|
||||
run: |
|
||||
@@ -64,7 +77,7 @@ jobs:
|
||||
- name: Run CMake
|
||||
run: |
|
||||
cmake \
|
||||
-DBOOST_ROOT="${{ steps.get-boost.outputs.root }}" \
|
||||
-DCMAKE_PREFIX_PATH="${{ steps.boost-metadata.outputs.root }}\stage" \
|
||||
-DCPACK_PACKAGE_VERSION="${{ steps.get-libloot-version.outputs.version }}" \
|
||||
-B build
|
||||
cmake --build build
|
||||
@@ -138,14 +151,27 @@ jobs:
|
||||
- name: Install Rust i686-pc-windows-msvc target
|
||||
run: rustup target add i686-pc-windows-msvc
|
||||
|
||||
- name: Download Boost
|
||||
id: get-boost
|
||||
- name: Get Boost metadata
|
||||
id: boost-metadata
|
||||
run: |
|
||||
$BOOST_BASENAME="boost_" + $env:BOOST_VERSION -replace "\.", "_"
|
||||
curl -sSfLO "https://archives.boost.io/release/${env:BOOST_VERSION}/source/${BOOST_BASENAME}.7z"
|
||||
7z x "${BOOST_BASENAME}.7z"
|
||||
$BOOST_ROOT="${{ github.workspace }}/boost_" + $env:BOOST_VERSION -replace "\.", "_"
|
||||
echo "root=$BOOST_ROOT" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
|
||||
|
||||
echo "root=$BOOST_BASENAME" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
|
||||
- name: Boost cache
|
||||
id: boost-cache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: |
|
||||
${{ steps.boost-metadata.outputs.root }}/boost
|
||||
${{ steps.boost-metadata.outputs.root }}/stage
|
||||
key: ${{ runner.os }}-x64-Boost-${{ env.BOOST_VERSION }}
|
||||
|
||||
# Need to build Boost's 'system' stub to generate the CMake config file.
|
||||
- name: Download & build Boost
|
||||
run: |
|
||||
curl -sSfLO https://raw.githubusercontent.com/Ortham/ci-scripts/2.2.1/install_boost.py
|
||||
python install_boost.py --directory ${{ github.workspace }} --boost-version ${{ env.BOOST_VERSION }} -a 64 system
|
||||
if: steps.boost-cache.outputs.cache-hit != 'true'
|
||||
|
||||
- name: Get descriptive libloot version
|
||||
id: get-libloot-version
|
||||
@@ -160,7 +186,7 @@ jobs:
|
||||
run: |
|
||||
cmake -G "Visual Studio 16 2019" `
|
||||
-A ${{ matrix.platform }} `
|
||||
-DBOOST_ROOT="${{ steps.get-boost.outputs.root }}" `
|
||||
-DCMAKE_PREFIX_PATH="${{ steps.boost-metadata.outputs.root }}\stage" `
|
||||
-DCPACK_PACKAGE_VERSION="${{ steps.get-libloot-version.outputs.version }}" `
|
||||
-B build
|
||||
cmake --build build --config ${{ env.MSVC_CONFIG }}
|
||||
|
||||
@@ -62,20 +62,33 @@ jobs:
|
||||
- name: Install Rust i686-pc-windows-msvc target
|
||||
run: rustup target add i686-pc-windows-msvc
|
||||
|
||||
- name: Download Boost
|
||||
id: get-boost
|
||||
- name: Get Boost metadata
|
||||
id: boost-metadata
|
||||
run: |
|
||||
$BOOST_BASENAME="boost_" + $env:BOOST_VERSION -replace "\.", "_"
|
||||
curl -sSfLO "https://archives.boost.io/release/${env:BOOST_VERSION}/source/${BOOST_BASENAME}.7z"
|
||||
7z x "${BOOST_BASENAME}.7z"
|
||||
$BOOST_ROOT="${{ github.workspace }}/boost_" + $env:BOOST_VERSION -replace "\.", "_"
|
||||
echo "root=$BOOST_ROOT" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
|
||||
|
||||
echo "root=$BOOST_BASENAME" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
|
||||
- name: Boost cache
|
||||
id: boost-cache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: |
|
||||
${{ steps.boost-metadata.outputs.root }}/boost
|
||||
${{ steps.boost-metadata.outputs.root }}/stage
|
||||
key: ${{ runner.os }}-x64-Boost-${{ env.BOOST_VERSION }}
|
||||
|
||||
# Need to build Boost's 'system' stub to generate the CMake config file.
|
||||
- name: Download & build Boost
|
||||
run: |
|
||||
curl -sSfLO https://raw.githubusercontent.com/Ortham/ci-scripts/2.2.1/install_boost.py
|
||||
python install_boost.py --directory ${{ github.workspace }} --boost-version ${{ env.BOOST_VERSION }} -a 64 system
|
||||
if: steps.boost-cache.outputs.cache-hit != 'true'
|
||||
|
||||
- name: Run CMake
|
||||
run: |
|
||||
cmake -G "Visual Studio 16 2019" `
|
||||
-A ${{ matrix.platform }} `
|
||||
-DBOOST_ROOT="${{ steps.get-boost.outputs.root }}" `
|
||||
-DCMAKE_PREFIX_PATH="${{ steps.boost-metadata.outputs.root }}\stage" `
|
||||
-DCPACK_PACKAGE_VERSION="${{ needs.create_release.outputs.git_tag }}" `
|
||||
-B build
|
||||
cmake --build build --config ${{ env.MSVC_CONFIG }}
|
||||
|
||||
Reference in New Issue
Block a user