Move espidf specific flags to appropriate builder

This commit is contained in:
Valeriy Koval
2017-02-20 21:59:41 +02:00
parent 3ac9499b02
commit 3ecf698255
2 changed files with 28 additions and 30 deletions
+25 -13
View File
@@ -98,15 +98,8 @@ def build_component(path):
def build_espidf_bootloader():
envsafe = env.Clone()
envsafe.Append(CPPDEFINES=[("BOOTLOADER_BUILD", 1)])
envsafe.Replace(
CPPDEFINES=[
"ESP_PLATFORM",
"WITH_POSIX",
("BOOTLOADER_BUILD", 1),
("IDF_VER", '\\"%s\\"' %
platform.get_package_version("framework-espidf"))
],
LIBPATH=[
join(FRAMEWORK_DIR, "components", "esp32", "ld"),
join(FRAMEWORK_DIR, "components", "esp32", "lib"),
@@ -237,12 +230,31 @@ for root, dirs, _ in walk(join(
env.Append(CPPPATH=[join(root, d)])
env.Append(
LIBSOURCE_DIRS=[
join(FRAMEWORK_DIR, "libraries")
env.Prepend(
CFLAGS=["-Wno-old-style-declaration"],
CPPDEFINES=[
"WITH_POSIX",
("IDF_VER", '\\"%s\\"' %
platform.get_package_version("framework-espidf"))
],
CCFLAGS=[
"-Wall",
"-Werror=all",
"-Wno-error=deprecated-declarations",
"-Wextra",
"-Wno-unused-parameter",
"-Wno-sign-compare",
"-Wno-error=unused-function"
],
LIBSOURCE_DIRS=[join(FRAMEWORK_DIR, "libraries")]
)
env.Append(
LINKFLAGS=[
"-u", "__cxa_guard_dummy",
"-T", "esp32.common.ld",
"-T", "esp32.rom.ld",
"-T", "esp32.peripherals.ld"
@@ -265,11 +277,11 @@ partition_table = env.Command(
"partitions_singleapp.csv"),
env.VerboseAction('"$PYTHONEXE" "%s" -q $SOURCE $TARGET' % join(
FRAMEWORK_DIR, "components", "partition_table", "gen_esp32part.py"),
"Generating partitions $TARGET"))
"Generating partitions $TARGET"))
env.Depends("$BUILD_DIR/$PROGNAME$PROGSUFFIX", partition_table)
#
# Generate linker script
#
+3 -17
View File
@@ -42,22 +42,13 @@ env.Replace(
ASFLAGS=["-x", "assembler-with-cpp"],
CFLAGS=[
"-std=gnu99",
"-Wno-old-style-declaration"
],
CFLAGS=["-std=gnu99"],
CCFLAGS=[
"%s" % "-Os" if env.subst("$PIOFRAMEWORK") == "arduino" else "-Og",
"-g3",
"-nostdlib",
"-Wall",
"-Werror=all",
"-Wno-error=deprecated-declarations",
"-Wextra",
"-Wno-unused-parameter",
"-Wno-sign-compare",
"-Wno-error=unused-function",
"-Wpointer-arith",
"-Wno-error=unused-but-set-variable",
"-Wno-error=unused-variable",
"-mlongcalls",
@@ -77,17 +68,13 @@ env.Replace(
"ESP_PLATFORM",
("F_CPU", "$BOARD_F_CPU"),
"HAVE_CONFIG_H",
("MBEDTLS_CONFIG_FILE", '\\"mbedtls/esp_config.h\\"'),
"WITH_POSIX",
("IDF_VER", '\\"%s\\"' %
platform.get_package_version("framework-espidf"))
("MBEDTLS_CONFIG_FILE", '\\"mbedtls/esp_config.h\\"')
],
LINKFLAGS=[
"-nostdlib",
"-Wl,-static",
"-u", "call_user_start_cpu0",
"-u", "__cxa_guard_dummy",
"-Wl,--undefined=uxTopUsedPriority",
"-Wl,--gc-sections"
],
@@ -174,7 +161,6 @@ target_upload = env.Alias(
env.VerboseAction("$UPLOADCMD", "Uploading $SOURCE")])
env.AlwaysBuild(target_upload)
#
# Default targets
#