From f777317406a47f70c1eaefda2d3aef0274783f16 Mon Sep 17 00:00:00 2001 From: Eric Liu Date: Tue, 28 Jan 2025 07:34:56 +0000 Subject: [PATCH] Enhance static library support in build workflow - Install static library development packages - Update CMake linker flags to improve static linking - Remove redundant library installation step - Refine static compilation configuration --- .github/workflows/build.yml | 8 +++----- abseil-cpp | 1 + 2 files changed, 4 insertions(+), 5 deletions(-) create mode 160000 abseil-cpp diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d56d612..2836f0f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -25,6 +25,8 @@ jobs: run: | sudo apt-get update sudo apt-get install -y build-essential cmake clang checkinstall zlib1g-dev musl-tools + # Install static versions of libraries + sudo apt-get install -y libstdc++-11-dev libgcc-11-dev libc6-dev - name: Build Static Abseil run: | @@ -48,16 +50,12 @@ jobs: CC=clang CXX=clang++ cmake -DCMAKE_BUILD_TYPE=Release \ -DUSE_CLANG=ON \ -DBUILD_STATIC=ON \ - -DCMAKE_EXE_LINKER_FLAGS="-static" \ + -DCMAKE_EXE_LINKER_FLAGS="-static -static-libgcc -static-libstdc++" \ -DCMAKE_FIND_LIBRARY_SUFFIXES=".a" \ -DCMAKE_CXX_FLAGS="-static-libgcc -static-libstdc++" \ -DCMAKE_C_FLAGS="-static-libgcc" \ .. - - name: Install Static Libraries - run: | - sudo apt-get install -y libstdc++-11-dev-amd64-cross - - name: Build the project run: | cd build diff --git a/abseil-cpp b/abseil-cpp new file mode 160000 index 0000000..20a1220 --- /dev/null +++ b/abseil-cpp @@ -0,0 +1 @@ +Subproject commit 20a1220136952ff620a47a5d6b94243e002c74f3