|
1 | 1 | -- ///////////////////////////////////////////////////////////////////////////// |
2 | | --- bci/ build configuration — Brain-Computer Interface bridge |
3 | | --- Merged: src/bci adapter + plugins/bci pipeline (DSP, metrics, sources) |
| 2 | +-- bci/ build configuration — Brain-Computer Interface bridge (hosted-only) |
| 3 | +-- |
| 4 | +-- The acquisition and analysis backends pull in host-only third-party |
| 5 | +-- libraries: |
| 6 | +-- * Eigen — covariance / Riemannian geometry (math, metrics) |
| 7 | +-- * liblsl — Lab Streaming Layer source and outlet |
| 8 | +-- * BrainFlow (opt.) — OpenBCI / BrainFlow acquisition backend |
| 9 | +-- |
| 10 | +-- The DSP acquisition ring buffer uses the engine's own SPSC lpl-container |
| 11 | +-- RingBuffer (no Boost dependency — see container/RingBuffer.hpp). |
| 12 | +-- |
| 13 | +-- This module is hosted-only: the freestanding kernel build does not compile |
| 14 | +-- it, so these dependencies never reach the kernel target. |
4 | 15 | -- ///////////////////////////////////////////////////////////////////////////// |
| 16 | + |
| 17 | +add_repositories("laplace-xmake-repo https://github.com/MasterLaplace/xmake-repo.git feat/brainflow-liblsl") |
| 18 | + |
| 19 | +add_requires("eigen") |
| 20 | +add_requires("liblsl") |
| 21 | +add_requires("brainflow", { optional = true }) |
| 22 | + |
| 23 | +option("with_brainflow") |
| 24 | + set_default(true) |
| 25 | + set_showmenu(true) |
| 26 | + set_description("Enable the BrainFlow acquisition backend in lpl-bci") |
| 27 | +option_end() |
| 28 | + |
5 | 29 | target("lpl-bci") |
6 | 30 | set_kind("static") |
7 | 31 | set_group("modules") |
8 | | - add_deps("lpl-core", "lpl-math", "lpl-input") |
| 32 | + set_warnings("all", "error") |
| 33 | + add_deps("lpl-core", "lpl-math", "lpl-input", "lpl-container") |
9 | 34 | add_includedirs("include", { public = true }) |
10 | 35 | add_files("src/**.cpp") |
11 | 36 | add_headerfiles("include/(lpl/bci/**.hpp)") |
12 | | - add_headerfiles("include/(lpl/bci/**.inl)") |
13 | | - |
14 | | - -- Exclude files requiring external dependencies not yet installed |
15 | | - -- These will be re-enabled when Eigen, Boost, liblsl, BrainFlow are added |
16 | | - remove_files("src/math/Covariance.cpp") |
17 | | - remove_files("src/math/Riemannian.cpp") |
18 | | - remove_files("src/metric/StabilityMetric.cpp") |
19 | | - remove_files("src/openvibe/StabilityMonitorBox.cpp") |
20 | | - remove_files("src/source/BrainFlowSource.cpp") |
21 | | - remove_files("src/source/OpenBciSource.cpp") |
22 | | - remove_files("src/source/LslSource.cpp") |
23 | | - remove_files("src/source/SourceFactory.cpp") |
24 | | - remove_files("src/stream/LslOutlet.cpp") |
25 | | - remove_files("src/source/serial/**.cpp") |
| 37 | + |
| 38 | + if is_plat("windows") then |
| 39 | + remove_files("src/source/serial/SerialPortPosix.cpp") |
| 40 | + else |
| 41 | + remove_files("src/source/serial/SerialPortWin32.cpp") |
| 42 | + end |
| 43 | + |
| 44 | + add_cxxflags("-fexceptions", { force = true }) |
| 45 | + |
| 46 | + add_packages("eigen", "liblsl", { public = true }) |
| 47 | + |
| 48 | + if has_config("with_brainflow") then |
| 49 | + add_packages("brainflow", { public = true }) |
| 50 | + end |
| 51 | + |
| 52 | + on_config(function (target) |
| 53 | + if target:pkg("brainflow") then |
| 54 | + target:add("defines", "LPL_HAS_BRAINFLOW", { public = true }) |
| 55 | + end |
| 56 | + end) |
26 | 57 | target_end() |
0 commit comments