2022-01-01 16:34:35 +00:00
|
|
|
Import("env")
|
|
|
|
|
2024-06-22 12:37:20 +01:00
|
|
|
build_flags = env['BUILD_FLAGS']
|
|
|
|
chip = env.get("BOARD_MCU").lower()
|
|
|
|
|
2024-02-19 12:23:38 +00:00
|
|
|
# General options that are passed to the C++ compiler
|
|
|
|
env.Append(CXXFLAGS=["-Wno-volatile"])
|
|
|
|
|
2022-01-01 16:34:35 +00:00
|
|
|
# General options that are passed to the C compiler (C only; not C++).
|
2024-02-19 12:23:38 +00:00
|
|
|
env.Append(CFLAGS=["-Wno-discarded-qualifiers", "-Wno-implicit-function-declaration", "-Wno-incompatible-pointer-types"])
|
2024-06-20 15:22:49 +01:00
|
|
|
|
|
|
|
# Remove build flags which are not valid for risc-v
|
2024-06-22 12:37:20 +01:00
|
|
|
if chip in ("esp32c2", "esp32c3", "esp32c6", "esp32h2"):
|
|
|
|
try:
|
|
|
|
build_flags.pop(build_flags.index("-mno-target-align"))
|
|
|
|
except:
|
|
|
|
do_nothing=""
|
|
|
|
try:
|
|
|
|
build_flags.pop(build_flags.index("-mtarget-align"))
|
|
|
|
except:
|
|
|
|
do_nothing=""
|