Skip to content

Commit

Permalink
Example Harness some infrastructure (#145)
Browse files Browse the repository at this point in the history
1. Add it to CI for both build and format
2. Add a command line parser and make some args
3. Builds on windows, fix some c++ semi-compliance
  • Loading branch information
baconpaul authored Oct 8, 2024
1 parent a416617 commit d180bf7
Show file tree
Hide file tree
Showing 6 changed files with 321 additions and 144 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/build-examples.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Build Tests

on:
pull_request:
branches:
- main

jobs:
build_feature:
name: Build Examples
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
include:
- os: ubuntu-latest
name: linux

- os: macos-latest
name: mac

- os: windows-latest
name: win

steps:

- name: Checkout code
uses: actions/checkout@v2
with:
submodules: recursive

- name: Build Example Harness
run: |
cmake -S . -B ./build -DCMAKE_BUILD_TYPE=Debug -DSST_EFFECTS_BUILD_EXAMPLES=TRUE -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64"
cmake --build ./build --config Debug --target voice-effect-example
2 changes: 1 addition & 1 deletion .github/workflows/code-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
path: [ 'tests', 'include' ]
path: [ 'tests', 'include', 'examples'' ]
steps:
- name: Checkout code
uses: actions/checkout@v3
Expand Down
16 changes: 13 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
cmake_minimum_required(VERSION 3.10)
project(sst-effects VERSION 0.5 LANGUAGES C CXX)

option(SST_EFFECTS_BUILD_EXAMPLES "Build the example drivers (which will also acivate tests)" OFF)
option(SST_EFFECTS_BUILD_TESTS "Build the test harness" OFF)

set(CMAKE_CXX_STANDARD 17)

add_library(${PROJECT_NAME} INTERFACE)
Expand All @@ -12,6 +15,7 @@ if (${SST_EFFECTS_BUILD_EXAMPLES})
endif()

if (${SST_EFFECTS_BUILD_TESTS})
message(STATUS "Building tests")
include(cmake/CPM.cmake)

if (NOT TARGET sst-basic-blocks)
Expand Down Expand Up @@ -81,20 +85,26 @@ if (${SST_EFFECTS_BUILD_TESTS})


if(${SST_EFFECTS_BUILD_EXAMPLES})
message(STATUS "Building Examples / CLI Driver")
if (NOT TARGET dr_libs)
CPMAddPackage(NAME dr_libs
GITHUB_REPOSITORY mackron/dr_libs
GIT_TAG master
)
add_library(dr_libs INTERFACE)
target_include_directories(dr_libs INTERFACE ${dr_libs_SOURCE_DIR})

CPMAddPackage(NAME CL11
GITHUB_REPOSITORY CLIUtils/CLI11
GIT_TAG main)

endif ()

add_executable(voice-effet-example
add_executable(voice-effect-example
examples/voice-effect-example.cpp
)
target_link_libraries(voice-effet-example PUBLIC dr_libs simde sst-basic-blocks sst-filters sst-waveshapers fmt ${PROJECT_NAME})
target_compile_definitions(voice-effet-example PUBLIC _USE_MATH_DEFINES=1)
target_link_libraries(voice-effect-example PUBLIC dr_libs CLI11::CLI11 simde sst-basic-blocks sst-filters sst-waveshapers fmt ${PROJECT_NAME})
target_compile_definitions(voice-effect-example PUBLIC _USE_MATH_DEFINES=1)
endif()

endif ()
Expand Down
Loading

0 comments on commit d180bf7

Please sign in to comment.