Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

platformio: use CCFLAGS for -Werror #8175

Merged
merged 1 commit into from
Jun 26, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion tools/platformio-build.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
https://arduino.cc/en/Reference/HomePage
"""

# For SCons documentation, see:
# https://scons.org/doc/latest

# Extends: https://github.com/platformio/platform-espressif8266/blob/develop/builder/main.py

from os.path import isdir, join
Expand Down Expand Up @@ -58,16 +61,17 @@ def scons_patched_match_splitext(path, suffixes=None):
env.Append(
ASFLAGS=["-x", "assembler-with-cpp"],

# General options that are passed to the C compiler (C only; not C++)
CFLAGS=[
"-std=gnu17",
"-Wpointer-arith",
"-Wno-implicit-function-declaration",
"-Werror=return-type",
"-Wl,-EL",
"-fno-inline-functions",
"-nostdlib"
],

# General options that are passed to the C and C++ compilers
CCFLAGS=[
"-Os", # optimize for size
"-mlongcalls",
Expand All @@ -78,15 +82,18 @@ def scons_patched_match_splitext(path, suffixes=None):
"-ffunction-sections",
"-fdata-sections",
"-Wall",
"-Werror=return-type",
"-free",
"-fipa-pta"
],

# General options that are passed to the C++ compiler
CXXFLAGS=[
"-fno-rtti",
"-std=gnu++17"
],

# General user options passed to the linker
LINKFLAGS=[
"-Os",
"-nostdlib",
Expand All @@ -105,6 +112,9 @@ def scons_patched_match_splitext(path, suffixes=None):
"-u", "_UserExceptionVector"
],

# A platform independent specification of C preprocessor definitions as either:
# - -DFLAG as "FLAG"
# - -DFLAG=VALUE as ("FLAG", "VALUE")
CPPDEFINES=[
("F_CPU", "$BOARD_F_CPU"),
"__ets__",
Expand All @@ -115,18 +125,21 @@ def scons_patched_match_splitext(path, suffixes=None):
"LWIP_OPEN_SRC"
],

# The list of directories that the C preprocessor will search for include directories
CPPPATH=[
join(FRAMEWORK_DIR, "tools", "sdk", "include"),
join(FRAMEWORK_DIR, "cores", env.BoardConfig().get("build.core")),
join(platform.get_package_dir("toolchain-xtensa"), "include")
],

# The list of directories that will be searched for libraries
LIBPATH=[
join("$BUILD_DIR", "ld"), # eagle.app.v6.common.ld
join(FRAMEWORK_DIR, "tools", "sdk", "lib"),
join(FRAMEWORK_DIR, "tools", "sdk", "ld")
],

# A list of one or more libraries that will be linked with any executable programs created by this environment
LIBS=[
"hal", "phy", "pp", "net80211", "wpa", "crypto", "main",
"wps", "bearssl", "espnow", "smartconfig", "airkiss", "wpa2",
Expand Down