-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🔧🔨 Fix CMake's handling of OpenSSL + Install it in CI
- Loading branch information
1 parent
4a2a376
commit 07e7755
Showing
6 changed files
with
99 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,6 +62,41 @@ jobs: | |
if: matrix.config.name == 'Windows MSVC' | ||
uses: ilammy/[email protected] | ||
|
||
- name: Cache vcpkg | ||
if: runner.os == 'Windows' | ||
uses: actions/cache@v4 | ||
with: | ||
path: | | ||
${{ runner.temp }}/vcpkg | ||
key: vcpkg-${{ runner.os }}-${{ hashFiles('**/vcpkg.json') }} | ||
restore-keys: vcpkg-${{ runner.os }}- | ||
|
||
- name: Cache vcpkg installed packages | ||
if: runner.os == 'Windows' | ||
uses: actions/cache@v4 | ||
with: | ||
path: | | ||
${{ runner.temp }}/vcpkg/installed | ||
${{ runner.temp }}/vcpkg/buildtrees | ||
key: vcpkg-packages-${{ runner.os }}-${{ hashFiles('**/vcpkg.json') }} | ||
restore-keys: vcpkg-packages-${{ runner.os }}- | ||
|
||
- name: Install vcpkg | ||
if: runner.os == 'Windows' | ||
run: | | ||
if not exist "${{ runner.temp }}\vcpkg" ( | ||
git clone https://github.com/microsoft/vcpkg.git ${{ runner.temp }}\vcpkg | ||
cd ${{ runner.temp }}\vcpkg | ||
.\bootstrap-vcpkg.bat | ||
) | ||
shell: cmd | ||
|
||
- name: Install Windows dependencies | ||
if: runner.os == 'Windows' | ||
run: | | ||
${{ runner.temp }}\vcpkg\vcpkg.exe install openssl:x64-windows | ||
shell: cmd | ||
|
||
- name: Install Linux dependencies | ||
if: runner.os == 'Linux' | ||
run: | | ||
|
@@ -82,12 +117,17 @@ jobs: | |
with: | ||
key: ${{matrix.config.name}}-${{matrix.build_type}} | ||
|
||
- name: Set CMake Toolchain Argument | ||
if: runner.os == 'Windows' | ||
run: echo "CMAKE_TOOLCHAIN_ARG=-D CMAKE_TOOLCHAIN_FILE=${{ runner.temp }}\vcpkg\scripts\buildsystems\vcpkg.cmake" >> $GITHUB_ENV | ||
shell: bash | ||
|
||
- name: Build | ||
uses: lukka/run-cmake@v3 | ||
with: | ||
cmakeListsOrSettingsJson: CMakeListsTxtAdvanced | ||
cmakeListsTxtPath: ${{github.workspace}}/${{env.cmakelists_folder}}/CMakeLists.txt | ||
cmakeAppendedArgs: ${{env.cmake_configure_args}} -D CMAKE_BUILD_TYPE=${{matrix.build_type}} ${{matrix.config.cmake_configure_args}} -D CMAKE_C_COMPILER_LAUNCHER=ccache -D CMAKE_CXX_COMPILER_LAUNCHER=ccache | ||
cmakeAppendedArgs: ${{env.cmake_configure_args}} -D CMAKE_BUILD_TYPE=${{matrix.build_type}} ${{matrix.config.cmake_configure_args}} -D CMAKE_C_COMPILER_LAUNCHER=ccache -D CMAKE_CXX_COMPILER_LAUNCHER=ccache ${{ env.CMAKE_TOOLCHAIN_ARG }} | ||
buildWithCMakeArgs: --config ${{matrix.build_type}} --target ${{env.cmake_target}} | ||
cmakeBuildType: ${{matrix.build_type}} | ||
buildDirectory: ${{github.workspace}}/build | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,6 +43,41 @@ jobs: | |
if: matrix.config.name == 'Windows' | ||
uses: ilammy/[email protected] | ||
|
||
- name: Cache vcpkg | ||
if: runner.os == 'Windows' | ||
uses: actions/cache@v4 | ||
with: | ||
path: | | ||
${{ runner.temp }}/vcpkg | ||
key: vcpkg-${{ runner.os }}-${{ hashFiles('**/vcpkg.json') }} | ||
restore-keys: vcpkg-${{ runner.os }}- | ||
|
||
- name: Cache vcpkg installed packages | ||
if: runner.os == 'Windows' | ||
uses: actions/cache@v4 | ||
with: | ||
path: | | ||
${{ runner.temp }}/vcpkg/installed | ||
${{ runner.temp }}/vcpkg/buildtrees | ||
key: vcpkg-packages-${{ runner.os }}-${{ hashFiles('**/vcpkg.json') }} | ||
restore-keys: vcpkg-packages-${{ runner.os }}- | ||
|
||
- name: Install vcpkg | ||
if: runner.os == 'Windows' | ||
run: | | ||
if not exist "${{ runner.temp }}\vcpkg" ( | ||
git clone https://github.com/microsoft/vcpkg.git ${{ runner.temp }}\vcpkg | ||
cd ${{ runner.temp }}\vcpkg | ||
.\bootstrap-vcpkg.bat | ||
) | ||
shell: cmd | ||
|
||
- name: Install Windows dependencies | ||
if: runner.os == 'Windows' | ||
run: | | ||
${{ runner.temp }}\vcpkg\vcpkg.exe install openssl:x64-windows | ||
shell: cmd | ||
|
||
- name: Install Linux dependencies | ||
if: runner.os == 'Linux' | ||
run: | | ||
|
@@ -64,12 +99,17 @@ jobs: | |
with: | ||
key: ${{matrix.config.name}} Clang-Release # Key name should match the one used in build_and_run_tests.yml so that we can reuse its cache. | ||
|
||
- name: Set CMake Toolchain Argument | ||
if: runner.os == 'Windows' | ||
run: echo "CMAKE_TOOLCHAIN_ARG=-D CMAKE_TOOLCHAIN_FILE=${{ runner.temp }}\vcpkg\scripts\buildsystems\vcpkg.cmake" >> $GITHUB_ENV | ||
shell: bash | ||
|
||
- name: Build | ||
uses: lukka/run-cmake@v3 | ||
with: | ||
cmakeListsOrSettingsJson: CMakeListsTxtAdvanced | ||
cmakeListsTxtPath: ${{github.workspace}}/${{env.cmakelists_folder}}/CMakeLists.txt | ||
cmakeAppendedArgs: ${{env.cmake_configure_args}} -D CPACK_GENERATOR=${{matrix.config.cpack_generator}} -D CMAKE_BUILD_TYPE=Release ${{matrix.config.cmake_configure_args}} -D CMAKE_C_COMPILER_LAUNCHER=ccache -D CMAKE_CXX_COMPILER_LAUNCHER=ccache | ||
cmakeAppendedArgs: ${{env.cmake_configure_args}} -D CPACK_GENERATOR=${{matrix.config.cpack_generator}} -D CMAKE_BUILD_TYPE=Release ${{matrix.config.cmake_configure_args}} -D CMAKE_C_COMPILER_LAUNCHER=ccache -D CMAKE_CXX_COMPILER_LAUNCHER=ccache ${{ env.CMAKE_TOOLCHAIN_ARG }} | ||
buildWithCMakeArgs: --config Release --target ${{env.cmake_target}} | ||
cmakeBuildType: Release | ||
buildDirectory: ${{github.workspace}}/build | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters