Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,8 @@ ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
---
Language: JavaScript
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
DisableFormat: true
---
Language: Json
DisableFormat: true
...

2 changes: 2 additions & 0 deletions .cmake-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
with section("format"):
tab_size = 4
15 changes: 14 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@ on:
pull_request:

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/setup-python@v5
- uses: pre-commit/action@v3.0.1

build:
strategy:
matrix:
Expand Down Expand Up @@ -58,12 +67,16 @@ jobs:
cmake --build build/consumer-b --config ${{ matrix.build_type }}

all-passed:
needs: build
needs: [pre-commit, build]
runs-on: ubuntu-latest
if: always()
steps:
- name: Check all matrix jobs passed
run: |
if [ "${{ needs.pre-commit.result }}" != "success" ]; then
echo "pre-commit failed"
exit 1
fi
if [ "${{ needs.build.result }}" != "success" ]; then
echo "build matrix failed"
exit 1
Expand Down
16 changes: 16 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,25 @@
exclude: ^external_libraries/
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: check-yaml
args: [--allow-multiple-documents]
- id: end-of-file-fixer
- id: trailing-whitespace
- id: pretty-format-json
args: [--autofix, --no-sort-keys]

- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v19.1.7
hooks:
- id: clang-format

- repo: https://github.com/cheshirekow/cmake-format-precommit
rev: v0.6.13
hooks:
- id: cmake-format

- repo: https://github.com/psf/black
rev: 25.1.0
hooks:
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- `docs/osc-api.md` (moved from `doc/OSC API.md`)
- `examples/README.md` describing the thADDeus and sampler examples

### Removed

- PNaCl test harness (`tests/pnacl/`, `examples/common/`)
- Duplicate `tinydir` copy in `examples/sampler/libs/`; Xcode projects now reference `external_libraries/tinydir`

### Changed

- Disabled clang-format for JavaScript files
- Dependency management modernised: `FetchContent` for oscpp and googletest; Boost 1.91.0 vendored with `methcla_boost` namespace to avoid symbol collisions (#129)
- C++ standard raised to C++17
- `Driver::Options` channel and buffer size fields changed from `int` to `size_t` (#80)
Expand Down
26 changes: 11 additions & 15 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,14 @@ endif()
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_C_STANDARD 99)

set(methcla_warnings
-Wall
-Wextra
-Wstrict-aliasing
-Werror)
set(methcla_warnings -Wall -Wextra -Wstrict-aliasing -Werror)

function(methcla_target_warnings target)
target_compile_options(${target} PRIVATE
"$<$<CXX_COMPILER_ID:Clang>:${methcla_warnings}>"
"$<$<CXX_COMPILER_ID:AppleClang>:${methcla_warnings}>"
"$<$<CXX_COMPILER_ID:GNU>:${methcla_warnings}>"
)
target_compile_options(
${target}
PRIVATE "$<$<CXX_COMPILER_ID:Clang>:${methcla_warnings}>"
"$<$<CXX_COMPILER_ID:AppleClang>:${methcla_warnings}>"
"$<$<CXX_COMPILER_ID:GNU>:${methcla_warnings}>")
endfunction()

include(GNUInstallDirs)
Expand All @@ -44,7 +40,8 @@ if(PROJECT_IS_TOP_LEVEL)
add_subdirectory(tools)
endif()

install(EXPORT methclaTargets
install(
EXPORT methclaTargets
NAMESPACE methcla::
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/methcla)

Expand All @@ -53,7 +50,6 @@ write_basic_package_version_file(
VERSION ${PROJECT_VERSION}
COMPATIBILITY SameMajorVersion)

install(FILES
cmake/methclaConfig.cmake
"${CMAKE_CURRENT_BINARY_DIR}/methclaConfigVersion.cmake"
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/methcla)
install(FILES cmake/methclaConfig.cmake
"${CMAKE_CURRENT_BINARY_DIR}/methclaConfigVersion.cmake"
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/methcla)
6 changes: 5 additions & 1 deletion CMakePresets.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
{
"version": 3,
"cmakeMinimumRequired": { "major": 3, "minor": 24, "patch": 0 },
"cmakeMinimumRequired": {
"major": 3,
"minor": 24,
"patch": 0
},
"configurePresets": [
{
"name": "base",
Expand Down
16 changes: 9 additions & 7 deletions cmake/dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,22 @@ include(FetchContent)
# oscpp — header-only OSC library, part of methcla's public API.
# OSCPP_BUILD_TESTS defaults to PROJECT_IS_TOP_LEVEL, so tests are off when
# consumed via FetchContent.
FetchContent_Declare(oscpp
FetchContent_Declare(
oscpp
GIT_REPOSITORY https://github.com/kaoskorobase/oscpp.git
GIT_TAG a62fe7690ce3563c997d7c9915d8cb54ff8f79b0
FIND_PACKAGE_ARGS CONFIG
)
FIND_PACKAGE_ARGS CONFIG)
FetchContent_MakeAvailable(oscpp)

if(METHCLA_BUILD_TESTS)
# googletest — test-only dependency
FetchContent_Declare(googletest
FetchContent_Declare(
googletest
GIT_REPOSITORY https://github.com/google/googletest.git
GIT_TAG v1.14.0
FIND_PACKAGE_ARGS NAMES GTest
)
set(INSTALL_GTEST OFF CACHE BOOL "" FORCE)
FIND_PACKAGE_ARGS NAMES GTest)
set(INSTALL_GTEST
OFF
CACHE BOOL "" FORCE)
FetchContent_MakeAvailable(googletest)
endif()
8 changes: 4 additions & 4 deletions docs/osc-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ Encode a `Methcla_Time` value as a 64 bit unsigned integer for use as an OSC bun
* `kMethcla_BusMappingFeedback = 0x02`

Don't zero bus before reading, allowing feedback loops with a delay of one block size.

* `kMethcla_BusMappingReplace = 0x04`

Zero bus before reading (default).

* `/synth/map/output i:node-id i:index i:bus-id i:flags`
Expand All @@ -67,9 +67,9 @@ Encode a `Methcla_Time` value as a 64 bit unsigned integer for use as an OSC bun
* `kMethcla_BusMappingFeedback = 0x02`

Mix output with previous bus contents (default).

* `kMethcla_BusMappingReplace = 0x04`

Replace bus contents by output.

* `/node/free` i:node-id
Expand Down
Loading
Loading