Skip to content

Commit

Permalink
add cmake stuff for native build
Browse files Browse the repository at this point in the history
  • Loading branch information
ekoby committed Jul 23, 2024
1 parent b83fc73 commit e44adb8
Show file tree
Hide file tree
Showing 3 changed files with 101 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .github/actions/gradle/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ inputs:
runs:
using: "composite"
steps:
- name: install contemporary cmake
uses: lukka/[email protected] # pin version to avoid failed glibc dependency on ubuntu 20 runners. go back to @latest when ubuntu 22+ is adopted for runner os.

- uses: lukka/run-vcpkg@v11
with:
vcpkgJsonGlob: ./ziti-native-tunnel/vcpkg.json

- name: set up JDK 17
uses: actions/setup-java@v3
with:
Expand Down
79 changes: 79 additions & 0 deletions ziti-native-tunnel/CMakePresets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
{
"version": 2,
"cmakeMinimumRequired": {
"major": 3,
"minor": 20,
"patch": 0
},
"configurePresets": [
{
"name": "vcpkg",
"hidden": true,
"cacheVariables": {
"CMAKE_TOOLCHAIN_FILE": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake"
}
},
{
"name": "android",
"binaryDir": "build/cmake/${presetName}",
"hidden": true,
"environment": {
"ANDROID_NDK_HOME": "$env{ANDROID_NDK_ROOT}"
}
},
{
"name": "ninja",
"hidden": true,
"generator": "Ninja"
},
{
"name": "ci-std",
"description": "This preset makes sure the project actually builds with at least the specified standard",
"hidden": true,
"cacheVariables": {
"CMAKE_C_EXTENSIONS": "ON",
"CMAKE_C_STANDARD": "99",
"CMAKE_C_STANDARD_REQUIRED": "ON",
"CMAKE_CXX_EXTENSIONS": "OFF",
"CMAKE_CXX_STANDARD": "11",
"CMAKE_CXX_STANDARD_REQUIRED": "ON"
}
},
{
"name": "ci-unix",
"hidden": true,
"inherits": ["ci-std", "ninja"],
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release"
}
},
{
"name": "x64-android",
"inherits": ["ci-unix", "vcpkg", "android"],
"cacheVariables": {
"VCPKG_TARGET_TRIPLET": "x64-android"
}
},
{
"name": "x86-android",
"inherits": ["ci-unix", "vcpkg", "android"],
"cacheVariables": {
"VCPKG_TARGET_TRIPLET": "x86-android"
}
},
{
"name": "arm-android",
"inherits": ["ci-unix", "vcpkg", "android"],
"cacheVariables": {
"VCPKG_TARGET_TRIPLET": "arm-neon-android"
}
},
{
"name": "arm64-android",
"inherits": ["ci-unix", "vcpkg", "android"],
"cacheVariables": {
"VCPKG_TARGET_TRIPLET": "arm64-android"
}
}
]
}
15 changes: 15 additions & 0 deletions ziti-native-tunnel/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "ziti-native-deps",
"version-semver": "1.0.0",
"dependencies": [
"libuv",
"openssl",
"zlib",
"llhttp",
"libsodium",
"protobuf-c",
"json-c"
],
"overrides": [],
"builtin-baseline": "1de2026f28ead93ff1773e6e680387643e914ea1"
}

0 comments on commit e44adb8

Please sign in to comment.