Skip to content

Commit

Permalink
GithubActions: Build with static linkage
Browse files Browse the repository at this point in the history
In order to avoid runtime issues on systems with older verisons of glibc and libstdc++.
  • Loading branch information
qinghui-xu committed Sep 16, 2024
1 parent 3ff0381 commit f82e388
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions .github/workflows/criteo_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,21 @@ jobs:
run: >
(Get-Content CMakeLists.txt) -replace '4.22.5', '${{ env.proto_version }}' | Set-Content CMakeLists.txt
- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
- name: Configure CMake for Linux and Windows
# For Linux case: Configure CMake to build protoc with static linkage to be able to run in systems with lower version of glibc and libstdc++.
if: ${{ matrix.os_family == 'linux' || matrix.os_family == 'windows' }}
run: >
cmake -B ${{ github.workspace }}/build
-G "Unix Makefiles"
-DCMAKE_CXX_STANDARD=14
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-DBUILD_SHARED_LIBS=OFF
-DCMAKE_EXE_LINKER_FLAGS="-static"
-DZLIB_USE_STATIC_LIBS=ON
- name: Configure CMake for OSX
# Static linkage options leads to cmake failure due to some missing library (ld: library not found for -lcrt0.o).
if: ${{ matrix.os_family == 'osx' }}
run: >
cmake -B ${{ github.workspace }}/build
-G "Unix Makefiles"
Expand Down

0 comments on commit f82e388

Please sign in to comment.