Skip to content

Commit

Permalink
Add new cmake presets
Browse files Browse the repository at this point in the history
  • Loading branch information
leonp-s committed Jan 6, 2025
1 parent 2860dc1 commit 0d52495
Show file tree
Hide file tree
Showing 5 changed files with 187 additions and 50 deletions.
5 changes: 5 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
PROJECT_NAME=zones_client
PRODUCT_NAME=Zones
VERSION=0.0.1
BUNDLE_ID=com.zones.zones
COMPANY_NAME=Zones
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "build_and_test"
name: "build_and_test_arm"
description: "Setup VCKPG, CMake, build, test and cache"
runs:
using: "composite"
Expand All @@ -11,8 +11,8 @@ runs:
- name: Run CMake consuming CMakePreset.json and run vcpkg to build dependencies
uses: lukka/run-cmake@v10
with:
configurePreset: 'ninja-multi-vcpkg'
configurePreset: 'arm64-osx'
configurePresetAdditionalArgs: "['-DCMAKE_C_COMPILER_LAUNCHER=ccache', '-DCMAKE_CXX_COMPILER_LAUNCHER=ccache']"
buildPreset: 'build-release'
buildPreset: 'arm64-osx-release'
buildPresetAdditionalArgs: "['--parallel 4']"
testPreset: 'test-release'
testPreset: 'arm64-osx-debug'
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Thanks to Pamplejuce for getting this on the right track, https://github.com/sudara/pamplejuce/

name: build_and_release
name: build_and_release_arm

on:
workflow_dispatch:

env:
CMAKE_BUILD_PARALLEL_LEVEL: 3
BUILD_TYPE: Release
BUILD_DIR: builds/ninja-multi-vcpkg/client
BUILD_DIR: builds/arm64-osx/client

jobs:
build_and_package:
Expand All @@ -33,7 +33,7 @@ jobs:
uses: ./.github/actions/build_ui

- name: Build and Test
uses: ./.github/actions/build_and_test
uses: ./.github/actions/build_and_test_arm

- name: Setup Environment
uses: ./.github/actions/setup_environment
Expand Down
215 changes: 174 additions & 41 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,77 +2,210 @@
"version": 3,
"cmakeMinimumRequired": {
"major": 3,
"minor": 20,
"minor": 21,
"patch": 0
},
"configurePresets": [
{
"name": "ninja-multi-vcpkg",
"displayName": "Ninja Multi-Config",
"description": "Configure with vcpkg toolchain and generate Ninja project files for all configurations",
"name": "x64-msvc",
"generator": "Visual Studio 17 2022",
"architecture": "x64",
"binaryDir": "${sourceDir}/builds/${presetName}",
"toolchainFile": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake",
"cacheVariables": {
"BUILD_TESTING": true,
"BUILD_SHARED_LIBS": true,
"VCPKG_TARGET_TRIPLET": "x64-windows-static",
"CMAKE_SYSTEM_VERSION": "10.0.19041.0"
},
"environment": {
"VCPKG_ROOT": "./vcpkg",
"DEV_LOCALHOST": "OFF"
},
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Windows"
}
},
{
"name": "x64-msvc-debug",
"displayName": "x64-msvc-debug",
"inherits": "x64-msvc",
"binaryDir": "${sourceDir}/builds/${presetName}",
"environment": {
"DEV_LOCALHOST": "ON"
}
},
{
"name": "x64-linux",
"generator": "Ninja Multi-Config",
"binaryDir": "${sourceDir}/builds/${presetName}",
"toolchainFile": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake",
"cacheVariables": {
"CMAKE_TOOLCHAIN_FILE": {
"type": "FILEPATH",
"value": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake"
},
"BUILD_TESTING": true,
"BUILD_SHARED_LIBS": true,
"VCPKG_TARGET_TRIPLET": "x64-linux"
},
"environment": {
"VCPKG_ROOT": "./vcpkg",
"DEV_LOCALHOST": "OFF"
},
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Linux"
}
},
{
"name": "x64-linux-debug",
"displayName": "x64-linux-debug",
"inherits": "x64-linux",
"binaryDir": "${sourceDir}/builds/${presetName}",
"environment": {
"VCPKG_ROOT": "./vcpkg"
"DEV_LOCALHOST": "ON"
}
},
{
"name": "ninja-multi-vcpkg-debug",
"inherits": "ninja-multi-vcpkg",
"name": "x64-osx",
"generator": "Ninja Multi-Config",
"binaryDir": "${sourceDir}/builds/${presetName}",
"toolchainFile": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake",
"cacheVariables": {
"BUILD_TESTING": true,
"BUILD_SHARED_LIBS": true,
"CMAKE_OSX_ARCHITECTURES": "x86_64",
"VCPKG_TARGET_TRIPLET": "x64-osx"
},
"environment": {
"VCPKG_ROOT": "./vcpkg",
"DEV_LOCALHOST": "OFF"
},
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Darwin"
}
},
{
"name": "x64-osx-debug",
"displayName": "x64-osx-debug",
"inherits": "x64-osx",
"binaryDir": "${sourceDir}/builds/${presetName}",
"environment": {
"DEV_LOCALHOST": "ON"
}
},
{
"name": "arm64-osx",
"displayName": "arm64-osx",
"inherits": "x64-osx",
"binaryDir": "${sourceDir}/builds/${presetName}",
"cacheVariables": {
"CMAKE_OSX_ARCHITECTURES": "arm64",
"VCPKG_TARGET_TRIPLET": "arm64-osx"
}
},
{
"name": "arm64-osx-debug",
"displayName": "arm64-osx-debug",
"inherits": "arm64-osx",
"binaryDir": "${sourceDir}/builds/${presetName}",
"environment": {
"DEV_LOCALHOST": "ON"
}
}
],
"buildPresets": [
{
"name": "build-debug",
"configurePreset": "ninja-multi-vcpkg-debug",
"displayName": "Build (Debug)",
"description": "Build with Ninja/vcpkg (Debug)",
"configuration": "Debug",
"environment": {
"DEV_LOCALHOST": "OFF"
}
"name": "x64-msvc-debug",
"configurePreset": "x64-msvc-debug",
"configuration": "Debug"
},
{
"name": "x64-msvc-release",
"configurePreset": "x64-msvc",
"configuration": "Release"
},
{
"name": "x64-linux-debug",
"configurePreset": "x64-linux-debug",
"configuration": "Debug"
},
{
"name": "x64-linux-release",
"configurePreset": "x64-linux",
"configuration": "Release"
},
{
"name": "build-release",
"configurePreset": "ninja-multi-vcpkg",
"displayName": "Build (Release)",
"description": "Build with Ninja/vcpkg (Release)",
"name": "x64-osx-debug",
"configurePreset": "x64-osx-debug",
"configuration": "Debug"
},
{
"name": "x64-osx-release",
"configurePreset": "x64-osx",
"configuration": "Release"
},
{
"name": "arm64-osx-debug",
"configurePreset": "arm64-osx-debug",
"configuration": "Debug"
},
{
"name": "arm64-osx-release",
"configurePreset": "arm64-osx",
"configuration": "Release"
}
],
"testPresets": [
{
"name": "test-ninja-vcpkg",
"configurePreset": "ninja-multi-vcpkg",
"hidden": true
"name": "x64-msvc-debug",
"configurePreset": "x64-msvc-debug",
"configuration": "Debug",
"output": {
"outputOnFailure": true
},
"execution": {
"noTestsAction": "error",
"stopOnFailure": false
}
},
{
"name": "test-debug",
"description": "Test (Debug)",
"displayName": "Test (Debug)",
"name": "x64-linux-debug",
"configurePreset": "x64-linux-debug",
"configuration": "Debug",
"inherits": [
"test-ninja-vcpkg"
]
},
{
"name": "test-release",
"description": "Test (Release)",
"displayName": "Test (Release)",
"configuration": "Release",
"inherits": [
"test-ninja-vcpkg"
]
"output": {
"outputOnFailure": true
},
"execution": {
"noTestsAction": "error",
"stopOnFailure": false
}
},
{
"name": "x64-osx-debug",
"configurePreset": "x64-osx-debug",
"configuration": "Debug",
"output": {
"outputOnFailure": true
},
"execution": {
"noTestsAction": "error",
"stopOnFailure": false
}
},
{
"name": "arm64-osx-debug",
"configurePreset": "arm64-osx-debug",
"configuration": "Debug",
"output": {
"outputOnFailure": true
},
"execution": {
"noTestsAction": "error",
"stopOnFailure": false
}
}
]
}
3 changes: 1 addition & 2 deletions client/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ set(SOURCES
src/controllers/WebLoadController.cpp
)

option(DEV_LOCALHOST OFF)
set(ASSETS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/ui/dist/)

juce_add_plugin(
Expand All @@ -75,7 +74,7 @@ juce_add_plugin(

target_compile_definitions(${BINARY}
PRIVATE
"DEV_LOCALHOST=$<BOOL:${DEV_LOCALHOST}>"
"DEV_LOCALHOST=$<BOOL:$ENV{DEV_LOCALHOST}>"
JUCE_WEB_BROWSER=1
JUCE_USE_CURL=1
JUCE_USE_WIN_WEBVIEW2_WITH_STATIC_LINKING=1
Expand Down

0 comments on commit 0d52495

Please sign in to comment.