#!/usr/bin/python3 import glob import os from os.path import join, normpath Import("env") project_dir = env.subst("$PROJECT_DIR") meshcore_dir = normpath(join(project_dir, "..", "MeshCore")) # Add MeshCore source files via build_src_filter override # We need to add them before the build starts meshcore_glob_patterns = [ "src/*.cpp", "src/helpers/*.cpp", "src/helpers/radiolib/*.cpp", "src/helpers/bridges/BridgeBase.cpp", "src/helpers/nrf52/SerialBLEInterface.cpp", ] # Add source files to the build environment for pattern in meshcore_glob_patterns: full_pattern = normpath(join(meshcore_dir, pattern)) files = glob.glob(full_pattern) for f in sorted(files): env.Append(SOURCES=[f]) # Also add T114 variant files if they exist t114_pattern = normpath(join(meshcore_dir, "variants/heltec_t114/*.cpp")) t114_files = glob.glob(t114_pattern) for f in sorted(t114_files): env.Append(SOURCES=[f])