From 8a54b7f45e3394bc5e51e6e7cf79db5f8eb14191 Mon Sep 17 00:00:00 2001 From: Juan Cruz Viotti Date: Mon, 12 Feb 2024 14:56:19 -0400 Subject: [PATCH] Support building shared libraries (#750) Signed-off-by: Juan Cruz Viotti --- .github/workflows/ci.yml | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d3314acb..0bc3c437 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,17 +13,34 @@ jobs: fail-fast: false matrix: platform: - # TODO: Enable shared libraries too - os: macos-latest cc: clang cxx: clang++ + type: static + - os: macos-latest + cc: clang + cxx: clang++ + type: shared - os: ubuntu-latest cc: clang cxx: clang++ + type: static - os: ubuntu-latest cc: gcc cxx: g++ + type: static + - os: ubuntu-latest + cc: clang + cxx: clang++ + type: shared + - os: ubuntu-latest + cc: gcc + cxx: g++ + type: shared + - os: windows-latest + type: static - os: windows-latest + type: shared # Sanitizers - os: ubuntu-latest @@ -63,6 +80,7 @@ jobs: - run: cmake --version - name: Configure JSON BinPack (static) + if: matrix.platform.type == 'static' run: > cmake -S . -B ./build -DCMAKE_BUILD_TYPE:STRING=Release @@ -75,6 +93,21 @@ jobs: -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_COMPILE_WARNING_AS_ERROR:BOOL=ON ${{ matrix.platform.options }} + - name: Configure JSON BinPack (shared) + if: matrix.platform.type == 'shared' + run: > + cmake -S . -B ./build + -DCMAKE_BUILD_TYPE:STRING=Release + -DJSONBINPACK_CLI:BOOL=ON + -DJSONBINPACK_RUNTIME:BOOL=ON + -DJSONBINPACK_COMPILER:BOOL=ON + -DJSONBINPACK_TESTS:BOOL=ON + -DJSONBINPACK_WEBSITE:BOOL=OFF + -DJSONBINPACK_DOCS:BOOL=OFF + -DBUILD_SHARED_LIBS:BOOL=ON + -DCMAKE_COMPILE_WARNING_AS_ERROR:BOOL=ON + ${{ matrix.platform.options }} + - run: cmake --build ./build --config Release --target clang_format_test - run: cmake --build ./build --config Release --parallel 4 - run: >