This repository has been archived by the owner on Jul 13, 2022. It is now read-only.
forked from eclipse-zenoh/zenoh-pico
-
Notifications
You must be signed in to change notification settings - Fork 0
/
extra_script.py
57 lines (50 loc) · 1.62 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
56
57
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/opencr>",
"-<system/unix/>",
"-<system/zephyr/>"]
cppdefines=["ZENOH_ARDUINO_ESP32"]
if platform == 'ststm32':
board = env.get("PIOENV")
if board == 'opencr':
src_filter=["+<*>",
"-<tests/>",
"-<example/>",
"-<system/espidf>",
"-<system/arduino/esp32>",
"-<system/unix/>",
"-<system/zephyr/>"]
cppdefines=["ZENOH_ARDUINO_OPENCR"]
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)
# pass flags to the main project environment
projenv.Append(CPPDEFINES=cppdefines)
# pass flags to a global build environment (for all libraries, etc)
global_env = DefaultEnvironment()
global_env.Append(CPPDEFINES=cppdefines)