From 4e03a4c21d120b55acf16340ba122c6878ffdc6c Mon Sep 17 00:00:00 2001 From: Wenkang Zhang <314830391@qq.com> Date: Mon, 29 Jan 2024 16:54:14 +0800 Subject: [PATCH] AVRO-3932: [C] fix variable reference in CMakeLists.txt (#2713) AVRO-3932: [C] fix variable reference in CMakeLists.txt Check that `pkg-config --libs avro-c` does not produce errors Signed-off-by: Martin Tzvetanov Grigorov --------- Signed-off-by: Martin Tzvetanov Grigorov Co-authored-by: Martin Tzvetanov Grigorov --- .github/workflows/test-lang-c.yml | 9 +++++++++ lang/c/CMakeLists.txt | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-lang-c.yml b/.github/workflows/test-lang-c.yml index e236778b37c..8a5494db1ae 100644 --- a/.github/workflows/test-lang-c.yml +++ b/.github/workflows/test-lang-c.yml @@ -47,6 +47,15 @@ jobs: - name: Test run: ./build.sh test + - name: Check pkg-config + run: | + mkdir -p build + cd build + cmake .. + cp /usr/lib/x86_64-linux-gnu/pkgconfig/snappy.pc src/libsnappy.pc + export PKG_CONFIG_PATH=./src + pkg-config --libs avro-c + - name: Cache Local Maven Repository uses: actions/cache@v4 with: diff --git a/lang/c/CMakeLists.txt b/lang/c/CMakeLists.txt index aa923e1829a..2956a07e87a 100644 --- a/lang/c/CMakeLists.txt +++ b/lang/c/CMakeLists.txt @@ -176,7 +176,7 @@ else (LZMA_FOUND) endif (LZMA_FOUND) set(CODEC_LIBRARIES ${ZLIB_LIBRARIES} ${LZMA_LIBRARIES} ${SNAPPY_LIBRARIES}) -set(CODEC_PKG "@ZLIB_PKG@ @LZMA_PKG@ @SNAPPY_PKG@") +set(CODEC_PKG "${ZLIB_PKG} ${LZMA_PKG} ${SNAPPY_PKG}") # Jansson JSON library pkg_check_modules(JANSSON jansson>=2.3)