build: split the 1423-line root CMakeLists into per-directory files with shared target helpers
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
# The pure substrate — see root CLAUDE.md's architecture section for the core/ purity invariant.
|
||||
#
|
||||
# Declaration order below runs base-first so the file reads as a dependency ladder; CMake
|
||||
# itself does not require it (link names resolve at generate time), and a few edges do run
|
||||
# backwards — core/wire's instrument_drop reuses the instrument's own state codec.
|
||||
|
||||
add_subdirectory(json)
|
||||
add_subdirectory(util)
|
||||
add_subdirectory(wire)
|
||||
add_subdirectory(audio)
|
||||
add_subdirectory(model)
|
||||
add_subdirectory(capture)
|
||||
add_subdirectory(reclaim)
|
||||
add_subdirectory(version)
|
||||
add_subdirectory(view)
|
||||
add_subdirectory(ui)
|
||||
add_subdirectory(instrument)
|
||||
@@ -0,0 +1,2 @@
|
||||
reasampler_pure_library(peaks SOURCES peaks.cpp)
|
||||
reasampler_test(peaks LINK peaks)
|
||||
@@ -0,0 +1,22 @@
|
||||
reasampler_pure_library(capture_paths SOURCES capture_paths.cpp)
|
||||
reasampler_test(capture_paths LINK capture_paths)
|
||||
|
||||
reasampler_pure_library(insert_plan SOURCES insert_plan.cpp)
|
||||
reasampler_test(insert_plan LINK insert_plan)
|
||||
|
||||
reasampler_pure_library(render_settings SOURCES render_settings.cpp LINK PUBLIC bank_model)
|
||||
reasampler_test(render_settings LINK render_settings)
|
||||
|
||||
reasampler_pure_library(batch_capture SOURCES batch_capture.cpp)
|
||||
reasampler_test(batch_capture LINK batch_capture)
|
||||
|
||||
reasampler_pure_library(tail_control
|
||||
SOURCES tail_control.cpp
|
||||
LINK PUBLIC render_settings PRIVATE json)
|
||||
reasampler_test(tail_control LINK tail_control)
|
||||
|
||||
reasampler_pure_library(capture_realtime SOURCES capture_realtime.cpp LINK PUBLIC bank_model)
|
||||
reasampler_test(capture_realtime LINK capture_realtime)
|
||||
|
||||
reasampler_pure_library(wav_codec SOURCES wav_codec.cpp LINK PUBLIC peaks)
|
||||
reasampler_test(wav_codec LINK wav_codec)
|
||||
@@ -0,0 +1,3 @@
|
||||
add_subdirectory(engine)
|
||||
add_subdirectory(map)
|
||||
add_subdirectory(ui)
|
||||
@@ -0,0 +1,26 @@
|
||||
# The shifter is hand-rolled rather than WDL_SimplePitchShifter because that header drags
|
||||
# <windows.h> in via wdltypes.h, which cannot enter the pure engine.
|
||||
reasampler_pure_library(pitch_shift SOURCES pitch_shift.cpp LINK PUBLIC peaks)
|
||||
# Links only pitch_shift: linking more would break the plain-data-boundary proof — and
|
||||
# specifically the compile-time proof it does not drag in the WDL <windows.h> chain.
|
||||
reasampler_test(pitch_shift LINK pitch_shift)
|
||||
|
||||
reasampler_pure_library(velocity_curve SOURCES velocity_curve.cpp)
|
||||
# Links only velocity_curve, deliberately not editor_geometry: the proof the engine can
|
||||
# depend on the curve without inheriting the editor's layout types.
|
||||
reasampler_test(velocity_curve LINK velocity_curve)
|
||||
|
||||
reasampler_pure_library(master_gain SOURCES master_gain.cpp)
|
||||
reasampler_test(master_gain LINK master_gain)
|
||||
|
||||
# Two TUs on the engine's own responsibility seam (per-note setup vs. note routing and
|
||||
# block render). The per-sample render half stays inline in voice.h precisely so this TU
|
||||
# boundary costs the hot path nothing.
|
||||
reasampler_pure_library(sampler_core
|
||||
SOURCES voice.cpp voice_engine.cpp
|
||||
LINK PUBLIC peaks pitch_shift velocity_curve)
|
||||
# Links only sampler_core: linking more would break the plain-data-boundary proof — a VST3
|
||||
# or REAPER type reaching the core would fail to compile or link here.
|
||||
reasampler_test(sampler_core LINK sampler_core)
|
||||
|
||||
add_subdirectory(filter)
|
||||
@@ -0,0 +1,15 @@
|
||||
# Control mapping, SVF coefficients, morph weights, and the filter type each get their own
|
||||
# TU; VoiceFilter::process stays header-inline so the kernel still inlines at the call site.
|
||||
reasampler_pure_library(filter SOURCES
|
||||
filter_params.cpp
|
||||
filter_coeffs.cpp
|
||||
filter_morph.cpp
|
||||
voice_filter.cpp)
|
||||
|
||||
# Four test targets along the module's own seams so each asserts one domain. filter_tests
|
||||
# alone owns the analytic reference and the steady-state gain measurement — a forked copy of
|
||||
# a measurement reference is a worse defect than a long file.
|
||||
reasampler_test(filter_params LINK filter)
|
||||
reasampler_test(filter_morph LINK filter)
|
||||
reasampler_test(filter_state LINK filter)
|
||||
reasampler_test(filter LINK filter)
|
||||
@@ -0,0 +1,31 @@
|
||||
reasampler_pure_library(bridge_marshal SOURCES bridge_marshal.cpp)
|
||||
reasampler_test(bridge_marshal LINK bridge_marshal)
|
||||
|
||||
reasampler_pure_library(trigger_seam SOURCES trigger_seam.cpp)
|
||||
# Links only trigger_seam — not even editor_geometry — the plainest data-boundary proof
|
||||
# available.
|
||||
reasampler_test(trigger_seam LINK trigger_seam)
|
||||
|
||||
reasampler_pure_library(bank_sync
|
||||
SOURCES bank_sync.cpp
|
||||
LINK PUBLIC assignment_request PRIVATE wire)
|
||||
# Links only bank_sync (+ its assignment_request dep): linking more would break the
|
||||
# plain-data-boundary proof.
|
||||
reasampler_test(bank_sync LINK bank_sync)
|
||||
|
||||
# The state codec is shared with the extension's preset-blob path, so it must link WITHOUT
|
||||
# the voice engine: velocity_curve (the curve field) and master_gain (the wire gain cap) only.
|
||||
reasampler_pure_library(component_state_io
|
||||
SOURCES component_state_io.cpp
|
||||
LINK PUBLIC velocity_curve master_gain)
|
||||
# Links only component_state_io, deliberately no sampler_core/pitch_shift: the structural
|
||||
# proof the codec is engine-free, which is what keeps engine object code out of the extension.
|
||||
reasampler_test(component_state_io LINK component_state_io)
|
||||
|
||||
# The mapping's product is plain SampleData, so the voice engine is not a dependency.
|
||||
reasampler_pure_library(sample_map
|
||||
SOURCES sample_map.cpp
|
||||
LINK PUBLIC bank_book wav_codec velocity_curve peaks)
|
||||
# Links only sample_map + component_state_io: the same plain-data-boundary proof, spanning
|
||||
# both halves of the mapping/codec split where the frozen-format assertions live.
|
||||
reasampler_test(sample_map LINK sample_map component_state_io)
|
||||
@@ -0,0 +1,48 @@
|
||||
# The geometry vocabulary every instrument UI module speaks (the Rect alias + contains())
|
||||
# is header-only, hence INTERFACE.
|
||||
add_library(editor_geometry INTERFACE)
|
||||
target_include_directories(editor_geometry INTERFACE ${REASAMPLER_SRC_DIR})
|
||||
|
||||
reasampler_pure_library(sample_bands SOURCES sample_bands.cpp LINK PUBLIC editor_geometry)
|
||||
reasampler_test(sample_bands LINK sample_bands)
|
||||
|
||||
reasampler_pure_library(sample_chrome SOURCES sample_chrome.cpp LINK PUBLIC sample_bands)
|
||||
reasampler_test(sample_chrome LINK sample_chrome)
|
||||
|
||||
reasampler_pure_library(embed_strip SOURCES embed_strip.cpp LINK PUBLIC editor_geometry)
|
||||
reasampler_test(embed_strip LINK embed_strip)
|
||||
|
||||
reasampler_pure_library(capture_browser SOURCES capture_browser.cpp LINK PUBLIC editor_geometry)
|
||||
reasampler_test(capture_browser LINK capture_browser)
|
||||
|
||||
reasampler_pure_library(keyboard_strip SOURCES keyboard_strip.cpp LINK PUBLIC editor_geometry)
|
||||
reasampler_test(keyboard_strip LINK keyboard_strip sample_bands sample_chrome)
|
||||
|
||||
# sample_bands is PRIVATE: the lane split is used internally and nothing in the public
|
||||
# header needs it.
|
||||
reasampler_pure_library(waveform_view
|
||||
SOURCES waveform_view.cpp
|
||||
LINK PUBLIC editor_geometry peaks PRIVATE sample_bands)
|
||||
# sample_bands is linked directly here because the test exercises the lane metrics that
|
||||
# waveform_view does not re-export.
|
||||
reasampler_test(waveform_view LINK waveform_view sample_bands)
|
||||
|
||||
reasampler_pure_library(browser_scroll
|
||||
SOURCES browser_scroll.cpp
|
||||
LINK PUBLIC capture_browser sample_chrome)
|
||||
reasampler_test(browser_scroll LINK browser_scroll)
|
||||
|
||||
reasampler_pure_library(param_slider SOURCES param_slider.cpp LINK PUBLIC editor_geometry)
|
||||
reasampler_test(param_slider LINK param_slider)
|
||||
|
||||
reasampler_pure_library(envelope_overlay SOURCES envelope_overlay.cpp LINK PUBLIC editor_geometry)
|
||||
reasampler_test(envelope_overlay LINK envelope_overlay)
|
||||
|
||||
reasampler_pure_library(envelope_edit SOURCES envelope_edit.cpp LINK PUBLIC envelope_overlay)
|
||||
reasampler_test(envelope_edit LINK envelope_edit)
|
||||
|
||||
reasampler_pure_library(knob_deck SOURCES knob_deck.cpp LINK PUBLIC editor_geometry)
|
||||
reasampler_test(knob_deck LINK knob_deck)
|
||||
|
||||
reasampler_pure_library(curve_popup SOURCES curve_popup.cpp LINK PUBLIC editor_geometry)
|
||||
reasampler_test(curve_popup LINK curve_popup)
|
||||
@@ -0,0 +1,2 @@
|
||||
reasampler_pure_library(json SOURCES json.cpp)
|
||||
reasampler_test(json LINK json)
|
||||
@@ -0,0 +1,17 @@
|
||||
reasampler_pure_library(bank_model SOURCES bank_model.cpp LINK PRIVATE json)
|
||||
reasampler_test(bank_model LINK bank_model)
|
||||
|
||||
reasampler_pure_library(slot_map SOURCES slot_map.cpp LINK PRIVATE json)
|
||||
reasampler_test(slot_map LINK slot_map json)
|
||||
|
||||
reasampler_pure_library(bank_book
|
||||
SOURCES bank_book.cpp bank_book_json.cpp
|
||||
LINK PUBLIC bank_model slot_map PRIVATE json)
|
||||
reasampler_test(bank_book LINK bank_book)
|
||||
|
||||
reasampler_pure_library(owned_manifest SOURCES owned_manifest.cpp LINK PRIVATE json)
|
||||
reasampler_test(owned_manifest LINK owned_manifest)
|
||||
|
||||
reasampler_pure_library(provenance SOURCES provenance.cpp LINK PRIVATE wire)
|
||||
# bank_model: the test proves the recorded recipe survives the Sample-JSON round-trip.
|
||||
reasampler_test(provenance LINK provenance bank_model)
|
||||
@@ -0,0 +1,3 @@
|
||||
reasampler_pure_library(prune_reconcile SOURCES prune_reconcile.cpp)
|
||||
# bank_book supplies the cross-bank referenced-file union the orphan set is computed against.
|
||||
reasampler_test(prune_reconcile LINK prune_reconcile bank_book)
|
||||
@@ -0,0 +1,40 @@
|
||||
reasampler_pure_library(bank_grid SOURCES bank_grid.cpp)
|
||||
reasampler_test(bank_grid LINK bank_grid)
|
||||
|
||||
reasampler_pure_library(tab_strip SOURCES tab_strip.cpp)
|
||||
reasampler_test(tab_strip LINK tab_strip)
|
||||
|
||||
reasampler_pure_library(prune_button SOURCES prune_button.cpp)
|
||||
reasampler_test(prune_button LINK prune_button)
|
||||
|
||||
reasampler_pure_library(drag_out SOURCES drag_out.cpp)
|
||||
reasampler_test(drag_out LINK drag_out)
|
||||
|
||||
reasampler_pure_library(theme SOURCES theme.cpp)
|
||||
reasampler_test(theme LINK theme)
|
||||
|
||||
reasampler_pure_library(component_geometry SOURCES component_geometry.cpp)
|
||||
reasampler_test(component_geometry LINK component_geometry)
|
||||
|
||||
reasampler_pure_library(action_bar SOURCES action_bar.cpp)
|
||||
reasampler_test(action_bar LINK action_bar)
|
||||
|
||||
# prune_button owns the FooterRect input type the footer layout reuses.
|
||||
reasampler_pure_library(footer_bar SOURCES footer_bar.cpp LINK PUBLIC prune_button)
|
||||
reasampler_test(footer_bar LINK footer_bar)
|
||||
|
||||
reasampler_pure_library(overflow_menu SOURCES overflow_menu.cpp)
|
||||
reasampler_test(overflow_menu LINK overflow_menu)
|
||||
|
||||
# view_mode_model owns the seed mode ids the predicate compares against.
|
||||
reasampler_pure_library(mode_enable SOURCES mode_enable.cpp LINK PUBLIC view_mode_model)
|
||||
reasampler_test(mode_enable LINK mode_enable)
|
||||
|
||||
reasampler_pure_library(tooltip SOURCES tooltip.cpp)
|
||||
reasampler_test(tooltip LINK tooltip)
|
||||
|
||||
reasampler_pure_library(card_meta SOURCES card_meta.cpp)
|
||||
reasampler_test(card_meta LINK card_meta)
|
||||
|
||||
reasampler_pure_library(card_drag SOURCES card_drag.cpp LINK PUBLIC drag_out bank_grid)
|
||||
reasampler_test(card_drag LINK card_drag)
|
||||
@@ -0,0 +1,2 @@
|
||||
reasampler_pure_library(file_bytes SOURCES file_bytes.cpp)
|
||||
reasampler_test(file_bytes LINK file_bytes)
|
||||
@@ -0,0 +1,42 @@
|
||||
reasampler_pure_library(app_version SOURCES app_version.cpp)
|
||||
# version_generated.h, configured at the root from the one REASAMPLER_VERSION string.
|
||||
# PUBLIC so every consumer of the channel bit sees it.
|
||||
target_include_directories(app_version PUBLIC ${PROJECT_BINARY_DIR}/generated)
|
||||
reasampler_test(app_version LINK app_version)
|
||||
|
||||
# Anti-normalization padding canary (rationale in tests/test_app_version_padding.cpp). The
|
||||
# live-version assertions in app_version_tests are version-shape-blind — relative checks
|
||||
# such as appVersion() == stampVersion() hold whether the string was threaded verbatim or
|
||||
# reconstructed from numeric components — so that suite cannot detect a
|
||||
# reconstruct-from-components regression at all. So: run the SAME template through
|
||||
# configure_file a second time with a SYNTHETIC padded version, and compile the SAME
|
||||
# app_version.cpp against it.
|
||||
#
|
||||
# "0.9.01" is a permanent test fixture, NOT the shipped version. It must match the literals
|
||||
# in test_app_version_padding.cpp and must NEVER be bumped on release.
|
||||
#
|
||||
# Coverage boundary: this catches reconstruct-from-components inside app_version.cpp. It
|
||||
# cannot see the live source-of-truth line becoming a CMake variable derivation — the
|
||||
# comment block at the top of the root CMakeLists.txt guards that half.
|
||||
function(_configure_padding_canary)
|
||||
# set() inside a function is function-scoped, so this clobber cannot leak to the parent
|
||||
# scope — no save/restore dance needed. REASAMPLER_CHANNEL_IS_BETA and the directory
|
||||
# variables are inherited read-only.
|
||||
set(REASAMPLER_VERSION "0.9.01")
|
||||
configure_file(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/version_generated.h.in
|
||||
${PROJECT_BINARY_DIR}/generated_padding_canary/version_generated.h
|
||||
@ONLY)
|
||||
endfunction()
|
||||
_configure_padding_canary()
|
||||
|
||||
# Longhand rather than reasampler_test: the canary RECOMPILES app_version.cpp instead of
|
||||
# linking the library, which is what lets the include-dir substitution work — it must see
|
||||
# generated_padding_canary/ in place of the live generated/ dir. If app_version ever gains
|
||||
# a link dependency, mirror it here.
|
||||
add_executable(app_version_padding_tests
|
||||
${REASAMPLER_TESTS_DIR}/test_app_version_padding.cpp
|
||||
app_version.cpp)
|
||||
target_include_directories(app_version_padding_tests PRIVATE
|
||||
${PROJECT_BINARY_DIR}/generated_padding_canary ${REASAMPLER_SRC_DIR})
|
||||
add_test(NAME app_version_padding_tests COMMAND app_version_padding_tests)
|
||||
@@ -0,0 +1,18 @@
|
||||
reasampler_pure_library(lane_keys SOURCES lane_keys.cpp)
|
||||
reasampler_test(lane_keys LINK lane_keys)
|
||||
|
||||
# lane_keys is PUBLIC: the lane-minting plan names managed lanes through the one durable-key
|
||||
# convention, so every consumer has to resolve that symbol too.
|
||||
reasampler_pure_library(view_mode_model
|
||||
SOURCES view_mode_model.cpp
|
||||
LINK PRIVATE json PUBLIC lane_keys)
|
||||
reasampler_test(view_mode_model LINK view_mode_model)
|
||||
|
||||
reasampler_pure_library(view_tree SOURCES view_tree.cpp LINK PUBLIC view_mode_model)
|
||||
reasampler_test(view_tree LINK view_tree)
|
||||
|
||||
reasampler_pure_library(guid_diff SOURCES guid_diff.cpp)
|
||||
reasampler_test(guid_diff LINK guid_diff)
|
||||
|
||||
reasampler_pure_library(mode_switch SOURCES mode_switch.cpp)
|
||||
reasampler_test(mode_switch LINK mode_switch)
|
||||
@@ -0,0 +1,18 @@
|
||||
reasampler_pure_library(wire SOURCES wire.cpp)
|
||||
reasampler_test(wire LINK wire)
|
||||
|
||||
reasampler_pure_library(assignment_request SOURCES assignment_request.cpp LINK PRIVATE wire)
|
||||
reasampler_test(assignment_request LINK assignment_request)
|
||||
|
||||
reasampler_pure_library(sample_usage SOURCES sample_usage.cpp LINK PRIVATE wire)
|
||||
# prune_reconcile composes the protection proof at the pure layer: a capture held by a live
|
||||
# instance lands in the referenced union, so pruneOrphans can never emit it.
|
||||
reasampler_test(sample_usage LINK sample_usage prune_reconcile)
|
||||
|
||||
# The drop payload is built through the instrument's OWN state serializer rather than a
|
||||
# parallel byte writer, so the cross-artifact contract cannot drift — hence the link to
|
||||
# component_state_io, which stays engine-free. The class-ID string derives from the frozen
|
||||
# UID macros, channel-selected via the generated version header, hence its include dir.
|
||||
reasampler_pure_library(instrument_drop SOURCES instrument_drop.cpp LINK PUBLIC component_state_io)
|
||||
target_include_directories(instrument_drop PUBLIC ${PROJECT_BINARY_DIR}/generated)
|
||||
reasampler_test(instrument_drop LINK instrument_drop)
|
||||
Reference in New Issue
Block a user