Skip to content

Commit

Permalink
latest Eigen; cmake and actions overhaul
Browse files Browse the repository at this point in the history
  • Loading branch information
kupix committed Mar 3, 2024
1 parent c14f951 commit 03f9ca5
Show file tree
Hide file tree
Showing 5 changed files with 165 additions and 15 deletions.
25 changes: 11 additions & 14 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: build
name: push

on:
push:
branches:
- main
- '*'

jobs:
build:
Expand All @@ -14,20 +14,17 @@ jobs:
with:
submodules: recursive
fetch-depth: 1
path: .
path: bungee

- name: 🛠️ Build
- name: 🛠️ Configure, build and install presets
env:
CC: gcc-10
CXX: g++-10
CMAKE_BUILD_PARALLEL_LEVEL: 2
BUILD_TYPES: Release Debug
PRESET: linux-x86_64
run: |
for BUILD_TYPE in ${BUILD_TYPES}; do \
cmake \
-S . \
-B build/${BUILD_TYPE} \
-DBUNGEE_SELF_TEST=2 \
-DCMAKE_BUILD_TYPE=${BUILD_TYPE}; \
cmake --build build/${BUILD_TYPE}; \
done
--preset ${PRESET} \
-S ${{github.workspace}}/bungee \
-B ${{github.workspace}}/builds/${PRESET} \
-G "Unix Makefiles"
cmake \
--build ${{github.workspace}}/builds/${PRESET}/
75 changes: 75 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: release

on:
push:
tags:
- 'v[0-9]+.*'

jobs:
build_ubuntu:
runs-on: ubuntu-latest
steps:

- name: 🛒 Checkout
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 1
path: bungee

- name: 🛠️ Configure, build and install presets
env:
CMAKE_BUILD_PARALLEL_LEVEL: 2
ANDROID_NDK: /usr/local/lib/android/sdk/ndk/26.2.11394342
run: |
for PRESET in \
linux-x86_64 \
android-armeabi-v7a \
android-arm64-v8a \
android-x86 \
android-x86_64 \
; do
cmake \
--preset ${PRESET} \
-S ${{github.workspace}}/bungee \
-B ${{github.workspace}}/builds/${PRESET} \
-D BUNGEE_ABI_NAME=${PRESET} \
-D CMAKE_INSTALL_PREFIX=${{github.workspace}}/ubuntu/ \
-G "Unix Makefiles"
echo cmake --build --target install ${{github.workspace}}/builds/${PRESET}/
cmake \
--build ${{github.workspace}}/builds/${PRESET}/ \
--target install
done
- name: ✈️ Upload artifact
uses: actions/upload-artifact@v4
with:
name: ubuntu-latest-install
path: ${{github.workspace}}/ubuntu/

build_ubuntu2:
runs-on: ubuntu-latest
needs: build_ubuntu
steps:

- name: 🪂 Download artifact
uses: actions/download-artifact@v4
with:
name: ubuntu-latest-install
path: ${{github.workspace}}/ubuntu/

- name: 🗜️Prepare archive
run: |
mv ${{github.workspace}}/ubuntu ${{github.workspace}}/bungee-${{ github.ref_name }}
tar -czf ${{github.workspace}}/bungee-${{ github.ref_name }}.tgz -C ${{github.workspace}} bungee-${{ github.ref_name }}
- name: ⭐Create release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create "${{ github.ref_name }}" \
--repo="${{ github.repository }}" \
--title="${{ github.repository }} ${{ github.ref_name }}" \
--generate-notes \
${{github.workspace}}/bungee-${{ github.ref_name }}.tgz
10 changes: 10 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,13 @@ target_include_directories(bungee PRIVATE submodules/cxxopts/include)
target_link_libraries(bungee PRIVATE libbungee)

target_include_directories(bungee PRIVATE submodules/cxxopts/include)

install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/bungee/
DESTINATION ${CMAKE_INSTALL_PREFIX}/include/bungee
FILES_MATCHING PATTERN "*.h"
)

set(BUNGEE_ABI_NAME "abi" CACHE STRING "ABI name for binary files, e.g. windows-x86_64")

install(TARGETS bungee RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/${BUNGEE_ABI_NAME}/)
install(TARGETS libbungee ARCHIVE DESTINATION ${CMAKE_INSTALL_PREFIX}/${BUNGEE_ABI_NAME}/)
68 changes: 68 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
{
"version": 6,
"cmakeMinimumRequired": {
"major": 3,
"minor": 25,
"patch": 0
},
"configurePresets": [
{
"name": "base",
"hidden": true,
"generator": "Ninja",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release",
"BUNGEE_SELF_TEST": "0",
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON",
"CMAKE_INSTALL_PREFIX": "${sourceDir}/out/bungee/"
}
},
{
"name": "linux-x86_64",
"inherits": "base"
},
{
"name": "android",
"hidden": true,
"inherits": "base",
"toolchainFile": "$env{ANDROID_NDK}/build/cmake/android.toolchain.cmake",
"cacheVariables": {
"ANDROID_TOOLCHAIN": "clang",
"ANDROID_STL": "c++_static",
"BUILD_SHARED_LIBS": "false"
}
},
{
"name": "android-armeabi-v7a",
"inherits": "android",
"cacheVariables": {
"ANDROID_ABI": "armeabi-v7a",
"ANDROID_PLATFORM": "android-16"
}
},
{
"name": "android-arm64-v8a",
"inherits": "android",
"cacheVariables": {
"ANDROID_ABI": "x86_64",
"ANDROID_PLATFORM": "android-21"
}
},
{
"name": "android-x86",
"inherits": "android",
"cacheVariables": {
"ANDROID_ABI": "x86",
"ANDROID_PLATFORM": "android-16"
}
},
{
"name": "android-x86_64",
"inherits": "android",
"cacheVariables": {
"ANDROID_ABI": "x86_64",
"ANDROID_PLATFORM": "android-21"
}
}
]
}
2 changes: 1 addition & 1 deletion submodules/eigen
Submodule eigen updated from d62676 to 64edfb

0 comments on commit 03f9ca5

Please sign in to comment.