|
|
@ -15,28 +15,14 @@ src_filter = [ |
|
|
# add build and include dirs according to CPPDEFINES |
|
|
# add build and include dirs according to CPPDEFINES |
|
|
for item in menv.get("CPPDEFINES", []): |
|
|
for item in menv.get("CPPDEFINES", []): |
|
|
|
|
|
|
|
|
# STM32 |
|
|
# PLATFORM HANDLING |
|
|
if isinstance(item, str) and item == "STM32_PLATFORM": |
|
|
if item == "STM32_PLATFORM": |
|
|
menv.Append(CPPPATH=[realpath("src/helpers/stm32")]) |
|
|
|
|
|
menv.Append(BUILD_FLAGS=["-I src/helpers/stm32"]) |
|
|
|
|
|
src_filter.append("+<helpers/stm32/*>") |
|
|
src_filter.append("+<helpers/stm32/*>") |
|
|
|
|
|
elif item == "ESP32": |
|
|
# ESP32 |
|
|
|
|
|
elif isinstance(item, str) and item == "ESP32": |
|
|
|
|
|
menv.Append(CPPPATH=[realpath("src/helpers/esp32")]) |
|
|
|
|
|
menv.Append(BUILD_FLAGS=["-I src/helpers/esp32"]) |
|
|
|
|
|
src_filter.append("+<helpers/esp32/*>") |
|
|
src_filter.append("+<helpers/esp32/*>") |
|
|
|
|
|
elif item == "NRF52_PLATFORM": |
|
|
# NRF52 |
|
|
|
|
|
elif isinstance(item, str) and item == "NRF52_PLATFORM": |
|
|
|
|
|
menv.Append(CPPPATH=[realpath("src/helpers/nrf52")]) |
|
|
|
|
|
menv.Append(BUILD_FLAGS=["-I src/helpers/nrf52"]) |
|
|
|
|
|
src_filter.append("+<helpers/nrf52/*>") |
|
|
src_filter.append("+<helpers/nrf52/*>") |
|
|
|
|
|
elif item == "RP2040_PLATFORM": |
|
|
# RP2040 |
|
|
|
|
|
elif isinstance(item, str) and item == "RP2040_PLATFORM": |
|
|
|
|
|
menv.Append(CPPPATH=[realpath("src/helpers/rp2040")]) |
|
|
|
|
|
menv.Append(BUILD_FLAGS=["-I src/helpers/rp2040"]) |
|
|
|
|
|
src_filter.append("+<helpers/rp2040/*>") |
|
|
src_filter.append("+<helpers/rp2040/*>") |
|
|
|
|
|
|
|
|
# DISPLAY HANDLING |
|
|
# DISPLAY HANDLING |
|
|
@ -50,19 +36,29 @@ for item in menv.get("CPPDEFINES", []): |
|
|
# VARIANTS HANDLING |
|
|
# VARIANTS HANDLING |
|
|
elif isinstance(item, tuple) and item[0] == "MC_VARIANT": |
|
|
elif isinstance(item, tuple) and item[0] == "MC_VARIANT": |
|
|
variant_name = item[1] |
|
|
variant_name = item[1] |
|
|
menv.Append(BUILD_FLAGS=[f"-I variants/{variant_name}"]) |
|
|
|
|
|
src_filter.append(f"+<../variants/{variant_name}>") |
|
|
src_filter.append(f"+<../variants/{variant_name}>") |
|
|
|
|
|
|
|
|
# INCLUDE EXAMPLE CODE IN BUILD (to provide your own support files without touching the tree) |
|
|
# INCLUDE EXAMPLE CODE IN BUILD (to provide your own support files without touching the tree) |
|
|
elif isinstance(item, tuple) and item[0] == "BUILD_EXAMPLE": |
|
|
elif isinstance(item, tuple) and item[0] == "BUILD_EXAMPLE": |
|
|
example_name = item[1] |
|
|
example_name = item[1] |
|
|
src_filter.append(f"+<../examples/{example_name}>") |
|
|
src_filter.append(f"+<../examples/{example_name}/*.cpp>") |
|
|
|
|
|
|
|
|
# EXCLUDE A SOURCE FILE FROM AN EXAMPLE (must be placed after example name or boom) |
|
|
# EXCLUDE A SOURCE FILE FROM AN EXAMPLE (must be placed after example name or boom) |
|
|
elif isinstance(item, tuple) and item[0] == "EXCLUDE_FROM_EXAMPLE": |
|
|
elif isinstance(item, tuple) and item[0] == "EXCLUDE_FROM_EXAMPLE": |
|
|
exclude_name = item[1] |
|
|
exclude_name = item[1] |
|
|
|
|
|
if example_name is None: |
|
|
|
|
|
print("***** PLEASE DEFINE EXAMPLE FIRST *****") |
|
|
|
|
|
break |
|
|
src_filter.append(f"-<../examples/{example_name}/{exclude_name}>") |
|
|
src_filter.append(f"-<../examples/{example_name}/{exclude_name}>") |
|
|
|
|
|
|
|
|
|
|
|
# DEAL WITH UI VARIANT FOR AN EXAMPLE |
|
|
|
|
|
elif isinstance(item, tuple) and item[0] == "MC_UI_FLAVOR": |
|
|
|
|
|
ui_flavor = item[1] |
|
|
|
|
|
if example_name is None: |
|
|
|
|
|
print("***** PLEASE DEFINE EXAMPLE FIRST *****") |
|
|
|
|
|
break |
|
|
|
|
|
src_filter.append(f"+<../examples/{example_name}/{ui_flavor}/*.cpp>") |
|
|
|
|
|
|
|
|
menv.Replace(SRC_FILTER=src_filter) |
|
|
menv.Replace(SRC_FILTER=src_filter) |
|
|
|
|
|
|
|
|
#print (menv.Dump()) |
|
|
#print (menv.Dump()) |
|
|
|