22
22
https://arduino.cc/en/Reference/HomePage
23
23
"""
24
24
25
+ # For SCons documentation, see:
26
+ # https://scons.org/doc/latest
27
+
25
28
# Extends: https://github.com/platformio/platform-espressif8266/blob/develop/builder/main.py
26
29
27
30
from os .path import isdir , join
@@ -58,16 +61,17 @@ def scons_patched_match_splitext(path, suffixes=None):
58
61
env .Append (
59
62
ASFLAGS = ["-x" , "assembler-with-cpp" ],
60
63
64
+ # General options that are passed to the C compiler (C only; not C++)
61
65
CFLAGS = [
62
66
"-std=gnu17" ,
63
67
"-Wpointer-arith" ,
64
68
"-Wno-implicit-function-declaration" ,
65
- "-Werror=return-type" ,
66
69
"-Wl,-EL" ,
67
70
"-fno-inline-functions" ,
68
71
"-nostdlib"
69
72
],
70
73
74
+ # General options that are passed to the C and C++ compilers
71
75
CCFLAGS = [
72
76
"-Os" , # optimize for size
73
77
"-mlongcalls" ,
@@ -78,15 +82,18 @@ def scons_patched_match_splitext(path, suffixes=None):
78
82
"-ffunction-sections" ,
79
83
"-fdata-sections" ,
80
84
"-Wall" ,
85
+ "-Werror=return-type" ,
81
86
"-free" ,
82
87
"-fipa-pta"
83
88
],
84
89
90
+ # General options that are passed to the C++ compiler
85
91
CXXFLAGS = [
86
92
"-fno-rtti" ,
87
93
"-std=gnu++17"
88
94
],
89
95
96
+ # General user options passed to the linker
90
97
LINKFLAGS = [
91
98
"-Os" ,
92
99
"-nostdlib" ,
@@ -105,6 +112,9 @@ def scons_patched_match_splitext(path, suffixes=None):
105
112
"-u" , "_UserExceptionVector"
106
113
],
107
114
115
+ # A platform independent specification of C preprocessor definitions as either:
116
+ # - -DFLAG as "FLAG"
117
+ # - -DFLAG=VALUE as ("FLAG", "VALUE")
108
118
CPPDEFINES = [
109
119
("F_CPU" , "$BOARD_F_CPU" ),
110
120
"__ets__" ,
@@ -115,18 +125,21 @@ def scons_patched_match_splitext(path, suffixes=None):
115
125
"LWIP_OPEN_SRC"
116
126
],
117
127
128
+ # The list of directories that the C preprocessor will search for include directories
118
129
CPPPATH = [
119
130
join (FRAMEWORK_DIR , "tools" , "sdk" , "include" ),
120
131
join (FRAMEWORK_DIR , "cores" , env .BoardConfig ().get ("build.core" )),
121
132
join (platform .get_package_dir ("toolchain-xtensa" ), "include" )
122
133
],
123
134
135
+ # The list of directories that will be searched for libraries
124
136
LIBPATH = [
125
137
join ("$BUILD_DIR" , "ld" ), # eagle.app.v6.common.ld
126
138
join (FRAMEWORK_DIR , "tools" , "sdk" , "lib" ),
127
139
join (FRAMEWORK_DIR , "tools" , "sdk" , "ld" )
128
140
],
129
141
142
+ # A list of one or more libraries that will be linked with any executable programs created by this environment
130
143
LIBS = [
131
144
"hal" , "phy" , "pp" , "net80211" , "wpa" , "crypto" , "main" ,
132
145
"wps" , "bearssl" , "espnow" , "smartconfig" , "airkiss" , "wpa2" ,
0 commit comments