Skip to content

Commit

Permalink
Interpose: build as shared library again; patchelf in CI build
Browse files Browse the repository at this point in the history
  • Loading branch information
Lgt2x committed Nov 22, 2024
1 parent 38f5ede commit cf4bd76
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
15 changes: 13 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: gptokeyb2 Build
on:
workflow_dispatch:
push:
branches: [ "*" ]
branches: [ "master" ]
paths-ignore:
- '**/README.md'
pull_request:
Expand All @@ -23,8 +23,10 @@ jobs:
arch:
- name: arm64
cross: aarch64-linux-gnu
executable:
- name: armhf
cross: arm-linux-gnueabihf
executable: armhf

steps:
- name: Install ${{ matrix.arch.name }} dependencies
Expand All @@ -42,10 +44,19 @@ jobs:
mkdir build && cd build
cmake ../ -GNinja -DCMAKE_TOOLCHAIN_FILE=../cmake/toolchains/debian-${{ matrix.arch.name }}-gcc-toolchain.cmake -DCMAKE_BUILD_TYPE=Release
cmake --build .
- name: Prepare export
run: |
patchelf --replace-needed libinterpose.so libinterpose.${{ matrix.arch.executable }}.so gptokeyb2
patchelf --set-soname libinterpose.${{ matrix.arch.executable }}.so lib/libinterpose.so
mv lib/libinterpose.so libinterpose.${{ matrix.arch.executable }}.so
/usr/${{ matrix.arch.cross }}/bin/strip gptokeyb2
mv gptokeyb2 gptokeyb2.${{ matrix.arch.executable }}
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: gptokeyb2_${{ matrix.arch.name }}
path: ${{ github.workspace }}/build/gptokeyb2
path: |
${{ github.workspace }}/build/gptokeyb2.${{ matrix.arch.executable }}
${{ github.workspace }}/build/libinterpose.${{ matrix.arch.executable }}
2 changes: 1 addition & 1 deletion interpose/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
add_library(interpose STATIC interpose.c interpose.h)
add_library(interpose SHARED interpose.c interpose.h)
set_target_properties(interpose PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")

# Link with pthread & dl
Expand Down

0 comments on commit cf4bd76

Please sign in to comment.