-
Notifications
You must be signed in to change notification settings - Fork 9
/
beforebuild.py
25 lines (19 loc) · 1.03 KB
/
beforebuild.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
# Import Build Environment
Import("env")
####################################################################################################
# Callback function to skip and ignore file from a build process
def skip_file_from_build(node):
'''Skip and ignore file from a build process.'''
return None
####################################################################################################
# Get used PIO Framework (Doesn't exists in Native)
build_framework = []
if "PIOFRAMEWORK" in env:
build_framework = env["PIOFRAMEWORK"]
print("Build framework - {}".format(build_framework))
# Check build and ignore custom mbedtls for ESP32 (To avoid conflict with esp-idf mbedtls component)
if ("arduino" in build_framework) or ("espidf" in build_framework):
print("Embedded Build detected, ignoring multihttpsclient/mbedtls.")
env.AddBuildMiddleware(skip_file_from_build, "*multihttpsclient/mbedtls/*")
else:
print("Generic Native Build detected, using src/utility/multihttpsclient/mbedtls.")