Update build workflow to statically build Abseil and project dependencies
Some checks failed
Build / build (push) Failing after 2m4s
Some checks failed
Build / build (push) Failing after 2m4s
Modify GitHub Actions workflow to: - Build Abseil from source statically - Configure CMake for static linking - Remove external Abseil library dependency - Update build flags to support static compilation
This commit is contained in:
32
.github/workflows/build.yml
vendored
32
.github/workflows/build.yml
vendored
@@ -9,6 +9,7 @@ on:
|
|||||||
env:
|
env:
|
||||||
PKG_VERSION: "2.1.0"
|
PKG_VERSION: "2.1.0"
|
||||||
PKG_RELEASE: "1"
|
PKG_RELEASE: "1"
|
||||||
|
ABSEIL_VERSION: "20230125.3"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
@@ -23,15 +24,34 @@ jobs:
|
|||||||
- name: Install Dependencies
|
- name: Install Dependencies
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install -y build-essential cmake libabsl-dev clang checkinstall
|
sudo apt-get install -y build-essential cmake clang checkinstall zlib1g-dev musl-tools
|
||||||
|
|
||||||
- name: Create build directory
|
- name: Build Static Abseil
|
||||||
run: mkdir build
|
run: |
|
||||||
|
git clone https://github.com/abseil/abseil-cpp.git
|
||||||
|
cd abseil-cpp
|
||||||
|
mkdir build && cd build
|
||||||
|
cmake -DCMAKE_BUILD_TYPE=Release \
|
||||||
|
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
|
||||||
|
-DABSL_BUILD_TESTING=OFF \
|
||||||
|
-DABSL_USE_GOOGLETEST_HEAD=OFF \
|
||||||
|
-DCMAKE_CXX_STANDARD=17 \
|
||||||
|
-DBUILD_SHARED_LIBS=OFF \
|
||||||
|
..
|
||||||
|
make -j$(nproc)
|
||||||
|
make install
|
||||||
|
ldconfig
|
||||||
|
|
||||||
- name: Configure the project
|
- name: Configure the project
|
||||||
run: |
|
run: |
|
||||||
cd build
|
mkdir build; cd build
|
||||||
CC=clang CXX=clang++ cmake -DCMAKE_BUILD_TYPE=Release -DUSE_CLANG=ON -DBUILD_STATIC=OFF ..
|
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_FIND_LIBRARY_SUFFIXES=".a" \
|
||||||
|
-DCMAKE_EXE_LINKER_FLAGS_INIT="-static" \
|
||||||
|
..
|
||||||
|
|
||||||
- name: Build the project
|
- name: Build the project
|
||||||
run: |
|
run: |
|
||||||
@@ -45,7 +65,7 @@ jobs:
|
|||||||
--pkgversion=${{ env.PKG_VERSION }} \
|
--pkgversion=${{ env.PKG_VERSION }} \
|
||||||
--pkgrelease=${{ env.PKG_RELEASE }} \
|
--pkgrelease=${{ env.PKG_RELEASE }} \
|
||||||
--maintainer="maintainer@example.com" \
|
--maintainer="maintainer@example.com" \
|
||||||
--requires="libabsl20220623t64" \
|
--requires="" \
|
||||||
--default \
|
--default \
|
||||||
--pakdir=. \
|
--pakdir=. \
|
||||||
--backup=no \
|
--backup=no \
|
||||||
|
43
.gitignore
vendored
Normal file
43
.gitignore
vendored
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
# CMake build directories
|
||||||
|
build/
|
||||||
|
CMakeFiles/
|
||||||
|
CMakeCache.txt
|
||||||
|
cmake_install.cmake
|
||||||
|
compile_commands.json
|
||||||
|
CTestTestfile.cmake
|
||||||
|
Testing/
|
||||||
|
_deps/
|
||||||
|
|
||||||
|
# Compiled files
|
||||||
|
*.o
|
||||||
|
*.obj
|
||||||
|
*.exe
|
||||||
|
*.out
|
||||||
|
*.app
|
||||||
|
*.dll
|
||||||
|
*.so
|
||||||
|
*.dylib
|
||||||
|
|
||||||
|
# IDE specific files
|
||||||
|
.vscode/
|
||||||
|
.idea/
|
||||||
|
*.swp
|
||||||
|
*.swo
|
||||||
|
.DS_Store
|
||||||
|
|
||||||
|
# Generated files
|
||||||
|
Makefile
|
||||||
|
*.make
|
||||||
|
*.cmake
|
||||||
|
!CMakeLists.txt
|
||||||
|
|
||||||
|
# Dependencies
|
||||||
|
_deps/
|
||||||
|
vcpkg_installed/
|
||||||
|
|
||||||
|
# Debug symbols
|
||||||
|
*.pdb
|
||||||
|
*.dSYM/
|
||||||
|
|
||||||
|
# Generated documentation
|
||||||
|
docs/_build/
|
Reference in New Issue
Block a user