Fix static linking of zlib. (#370)

Fix static linking of zlib.

Use of the standard FindZLIB and thus support for ZLIB_LIBRARIES was
removed upstream in llvm/llvm-project@916be8fd6a
This commit is contained in:
Sam McCall 2020-05-07 12:44:29 +02:00 committed by GitHub
parent d740d020b6
commit 722567248f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -72,7 +72,6 @@ jobs:
"-DCMAKE_EXE_LINKER_FLAGS_RELEASE=-static-libgcc -Wl,--compress-debug-sections=zlib"
"-DLLVM_STATIC_LINK_CXX_STDLIB=ON"
"-DLLVM_ENABLE_ZLIB=FORCE_ON"
"-DZLIB_LIBRARY=/usr/lib/x86_64-linux-gnu/libz.a"
steps:
- name: Clone scripts
uses: actions/checkout@v2
@ -119,6 +118,10 @@ jobs:
"-DCLANG_PLUGIN_SUPPORT=OFF"
"-DLLVM_ENABLE_PLUGINS=OFF"
${{ 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