Unverified Commit bde2d643 authored by Valerii Koval's avatar Valerii Koval Committed by GitHub

Sync PlatformIO build scripts (#8488)

Added special handling of the `ARDUINO_BUILD_CORE` macro required only for the core files
parent 21b88659
...@@ -172,6 +172,10 @@ SConscript( ...@@ -172,6 +172,10 @@ SConscript(
# Target: Build Core Library # Target: Build Core Library
# #
# Set -DARDUINO_CORE_BUILD only for the core library
corelib_env = env.Clone()
corelib_env.Append(CPPDEFINES=["ARDUINO_CORE_BUILD"])
libs = [] libs = []
variants_dir = join(FRAMEWORK_DIR, "variants") variants_dir = join(FRAMEWORK_DIR, "variants")
...@@ -181,13 +185,14 @@ if "build.variants_dir" in board_config: ...@@ -181,13 +185,14 @@ if "build.variants_dir" in board_config:
if "build.variant" in board_config: if "build.variant" in board_config:
env.Append(CPPPATH=[join(variants_dir, board_config.get("build.variant"))]) env.Append(CPPPATH=[join(variants_dir, board_config.get("build.variant"))])
env.BuildSources( corelib_env.Append(CPPPATH=[join(variants_dir, board_config.get("build.variant"))])
corelib_env.BuildSources(
join("$BUILD_DIR", "FrameworkArduinoVariant"), join("$BUILD_DIR", "FrameworkArduinoVariant"),
join(variants_dir, board_config.get("build.variant")), join(variants_dir, board_config.get("build.variant")),
) )
libs.append( libs.append(
env.BuildLibrary( corelib_env.BuildLibrary(
join("$BUILD_DIR", "FrameworkArduino"), join("$BUILD_DIR", "FrameworkArduino"),
join(FRAMEWORK_DIR, "cores", board_config.get("build.core")), join(FRAMEWORK_DIR, "cores", board_config.get("build.core")),
) )
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment