2022-01-01 16:34:35 +00:00
|
|
|
Import("env")
|
|
|
|
|
2024-06-22 12:37:20 +01:00
|
|
|
build_flags = env['BUILD_FLAGS']
|
2024-10-07 17:36:46 +01:00
|
|
|
mcu = env.get("BOARD_MCU").lower()
|
2024-06-22 12:37:20 +01:00
|
|
|
|
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-10-07 17:36:46 +01:00
|
|
|
if mcu in ("esp32c2", "esp32c3", "esp32c6", "esp32h2", "esp32p4"):
|
2024-06-22 12:37:20 +01:00
|
|
|
try:
|
|
|
|
build_flags.pop(build_flags.index("-mno-target-align"))
|
|
|
|
except:
|
2024-10-07 17:36:46 +01:00
|
|
|
pass
|
2024-06-22 12:37:20 +01:00
|
|
|
try:
|
|
|
|
build_flags.pop(build_flags.index("-mtarget-align"))
|
|
|
|
except:
|
2024-10-07 17:36:46 +01:00
|
|
|
pass
|