forked from eclipse-zenoh/zenoh-pico
-
Notifications
You must be signed in to change notification settings - Fork 3
/
extra_script.py
55 lines (47 loc) · 1.51 KB
/
extra_script.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
Import('env', 'projenv')
from os.path import join, realpath
src_filter = []
cppdefines = []
framework = env.get("PIOFRAMEWORK")[0]
if framework == 'zephyr':
src_filter=["+<*>",
"-<tests/>",
"-<example/>",
"-<system/espidf>",
"-<system/unix/>",
"-<system/arduino/>"]
cppdefines=["ZENOH_ZEPHYR"]
elif framework == 'arduino':
platform = env.get("PIOPLATFORM")
if platform == 'espressif32':
src_filter=["+<*>",
"-<tests/>",
"-<example/>",
"-<system/espidf>",
"-<system/arduino/ststm32>",
"-<system/unix/>",
"-<system/zephyr/>"]
cppdefines=["ZENOH_ARDUINO_ESP32"]
if platform == 'ststm32':
src_filter=["+<*>",
"-<tests/>",
"-<example/>",
"-<system/espidf>",
"-<system/arduino/esp32>",
"-<system/unix/>",
"-<system/zephyr/>"]
cppdefines=["ZENOH_ARDUINO_STSTM32"]
elif framework == 'espidf':
src_filter=["+<*>",
"-<tests/>",
"-<example/>",
"-<system/unix/>",
"-<system/arduino/>",
"-<system/zephyr/>"]
cppdefines=["ZENOH_ESPIDF"]
env.Append(SRC_FILTER=src_filter)
env.Append(CPPDEFINES=cppdefines)
projenv.Append(CPPDEFINES=cppdefines)
# pass flags to a global build environment (for all libraries, etc)
global_env = DefaultEnvironment()
global_env.Append(CPPDEFINES=cppdefines)