mirror of
https://github.com/google/sandboxed-api.git
synced 2024-03-22 13:11:30 +08:00
Add GitHub workflow to build Clang tool based header generator
Drive-by: - Add flags to link libgcc and libstdc++ statically into the binary, making it "mostly static" PiperOrigin-RevId: 532349354 Change-Id: I0a86eb29b6a40aec4cec3cffeaf9511726ee4dc8
This commit is contained in:
parent
70e3d9f560
commit
1bf9437f95
59
.github/workflows/debian-sapi-generator-tool.yml
vendored
Normal file
59
.github/workflows/debian-sapi-generator-tool.yml
vendored
Normal file
|
@ -0,0 +1,59 @@
|
|||
name: sapi-generator-tool
|
||||
on: push
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
container: debian:10.13
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Cache dependencies
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
key: debian-10.13-clang16
|
||||
path: |
|
||||
${{github.workspace}}/build/_deps
|
||||
|
||||
- name: Install build tools
|
||||
run: |
|
||||
apt-get update
|
||||
env DEBIAN_FRONTEND=noninteractive \
|
||||
apt-get install -qy --no-install-recommends \
|
||||
build-essential \
|
||||
ca-certificates \
|
||||
cmake \
|
||||
file \
|
||||
git \
|
||||
gnupg \
|
||||
libc6-dev \
|
||||
lsb-release \
|
||||
make \
|
||||
software-properties-common \
|
||||
wget
|
||||
wget https://apt.llvm.org/llvm.sh
|
||||
chmod +x llvm.sh
|
||||
./llvm.sh 16 all
|
||||
|
||||
- name: Install ninja-build tool
|
||||
uses: seanmiddleditch/gha-setup-ninja@v3
|
||||
|
||||
- name: Create Build Environment
|
||||
run: |
|
||||
cmake -E make_directory $GITHUB_WORKSPACE/build
|
||||
|
||||
- name: Configure CMake
|
||||
run: |
|
||||
cmake \
|
||||
-S $GITHUB_WORKSPACE \
|
||||
-B $GITHUB_WORKSPACE/build \
|
||||
-G Ninja \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DSAPI_ENABLE_CLANG_TOOL=ON \
|
||||
-DSAPI_ENABLE_CLANG_TOOL_STATIC=ON
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
cmake \
|
||||
--build $GITHUB_WORKSPACE/build \
|
||||
--config Release \
|
||||
--target sapi_generator_tool
|
|
@ -128,6 +128,13 @@ target_link_libraries(sapi_generator_tool PRIVATE
|
|||
sapi::fileops
|
||||
sapi::generator
|
||||
)
|
||||
if(SAPI_ENABLE_CLANG_TOOL_STATIC)
|
||||
target_link_options(sapi_generator_tool PRIVATE
|
||||
# These work for both GCC and Clang
|
||||
-static-libgcc
|
||||
-static-libstdc++
|
||||
)
|
||||
endif()
|
||||
|
||||
if(BUILD_TESTING AND SAPI_BUILD_TESTING)
|
||||
add_executable(sapi_generator_test
|
||||
|
|
Loading…
Reference in New Issue
Block a user