From 496d5585749b0f742988f179d58befc98f38b3d9 Mon Sep 17 00:00:00 2001 From: Eric Liu Date: Tue, 28 Jan 2025 07:30:29 +0000 Subject: [PATCH] Improve static linking configuration in build workflow - Modify CMake linker and compiler flags for better static linking - Add step to install static library dependencies - Adjust static compilation flags to support cross-compilation --- .github/workflows/build.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 34f62a8..d56d612 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -48,11 +48,16 @@ jobs: CC=clang CXX=clang++ cmake -DCMAKE_BUILD_TYPE=Release \ -DUSE_CLANG=ON \ -DBUILD_STATIC=ON \ - -DCMAKE_EXE_LINKER_FLAGS="-static -static-libgcc -static-libstdc++" \ + -DCMAKE_EXE_LINKER_FLAGS="-static" \ -DCMAKE_FIND_LIBRARY_SUFFIXES=".a" \ - -DCMAKE_EXE_LINKER_FLAGS_INIT="-static" \ + -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