Try to fix static libz on linux

This commit is contained in:
Sam McCall 2020-09-24 16:33:20 +02:00
parent 40dcef1871
commit 45b6fbdfb0
2 changed files with 4 additions and 4 deletions

View File

@ -70,6 +70,7 @@ jobs:
"-DCMAKE_EXE_LINKER_FLAGS_RELEASE=-static-libgcc -Wl,--compress-debug-sections=zlib"
"-DLLVM_STATIC_LINK_CXX_STDLIB=ON"
"-DLLVM_ENABLE_ZLIB=FORCE_ON"
"-DCMAKE_PROJECT_INCLUDE=$GITHUB_WORKSPACE/.github/workflows/linux-static-deps.cmake"
steps:
- name: Clone scripts
uses: actions/checkout@v2
@ -118,10 +119,6 @@ jobs:
"-DCMAKE_C_FLAGS_RELEASE=${{ matrix.config.cflags }}"
"-DCMAKE_CXX_FLAGS_RELEASE=${{ matrix.config.cflags }}"
${{ matrix.config.cmake }}
# LLVM 10 has no way to statically link zlib via CMake itself, AFAICT...
- name: Statically link zlib
if: matrix.config.name == 'linux'
run: sed -i 's/ -lz / -l:libz.a /' "$CLANGD_DIR/build.ninja"
- name: Ninja
run: ninja -C ${{ env.CLANGD_DIR }} clangd
- name: Archive

View File

@ -0,0 +1,3 @@
# Convince find_package() to link against libz.a instead of libz.so.
# The default is ".so;.a", meaning dynamic libraries are preferred.
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")