Skip to content

Commit b88a360

Browse files
committed
lib_build: add nrf52 and RP2040
1 parent 228bac0 commit b88a360

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

build_as_lib.py

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,39 @@
66
src_filter = [
77
'+<*.cpp>',
88
'+<helpers/*.cpp>',
9+
'+<helpers/sensors>'
910
'+<helpers/radiolib/*.cpp>',
1011
'+<helpers/ui/MomentaryButton.cpp>',
1112
]
1213

14+
# add build and include dirs according to CPPDEFINES
1315
for item in menv.get("CPPDEFINES", []):
16+
17+
# STM32
1418
if isinstance(item, str) and item == "STM32_PLATFORM":
15-
# add STM32 specific sources
1619
menv.Append(CPPPATH=[realpath("src/helpers/stm32")])
1720
menv.Append(BUILD_FLAGS=["-I src/helpers/stm32"])
1821
src_filter.append("+<helpers/stm32/*>")
22+
23+
# ESP32
1924
elif isinstance(item, str) and item == "ESP32":
2025
menv.Append(CPPPATH=[realpath("src/helpers/esp32")])
2126
menv.Append(BUILD_FLAGS=["-I src/helpers/esp32"])
2227
src_filter.append("+<helpers/esp32/*>")
28+
29+
# NRF52
30+
elif isinstance(item, str) and item == "NRF52_PLATFORM":
31+
menv.Append(CPPPATH=[realpath("src/helpers/nrf52")])
32+
menv.Append(BUILD_FLAGS=["-I src/helpers/nrf52"])
33+
src_filter.append("+<helpers/nrf52/*>")
34+
35+
# RP2040
36+
elif isinstance(item, str) and item == "RP2040_PLATFORM":
37+
menv.Append(CPPPATH=[realpath("src/helpers/rp2040")])
38+
menv.Append(BUILD_FLAGS=["-I src/helpers/rp2040"])
39+
src_filter.append("+<helpers/rp2040/*>")
40+
41+
# VARIANTS HANDLING
2342
elif isinstance(item, tuple) and item[0] == "MC_VARIANT":
2443
variant_name = item[1]
2544
menv.Append(BUILD_FLAGS=[f"-I variants/{variant_name}"])

0 commit comments

Comments
 (0)