Commit 653eade8 authored by Stefan Hackenberg's avatar Stefan Hackenberg
Browse files

Add fastbuild option

parent 6f59f10f
......@@ -28,6 +28,7 @@ http://mbed.org/
import os
from SCons.Script import Import, SConscript
import os
Import("env")
......@@ -66,7 +67,27 @@ def applymbedignore():
applymbedignore()
oldbuild = env.BuildSources
def fastbuild(variant_dir, src_dir, src_filter=None):
env.Append(
LINKOBJS=[
env.subst(f'$PROJECT_DIR/mbedos/{f}')
for f in os.listdir(env.subst('$PROJECT_DIR/mbedos'))
if f.endswith('.o')
]
)
if env.GetBuildType() == 'release' and os.path.exists(env.subst('$PROJECT_DIR/mbedos')):
env.Replace(
LINKCOM="${TEMPFILE('$LINK -o $TARGET $LINKFLAGS $__RPATH $LINKOBJS $SOURCES $_LIBDIRFLAGS $_LIBFLAGS','$LINKCOMSTR')}"
)
env.BuildSources = fastbuild
# https://github.com/platformio/builder-framework-mbed.git
SConscript(
os.path.join(env.PioPlatform().get_package_dir("framework-mbed"), "platformio",
"platformio-build.py"))
env.BuildSources = oldbuild
......@@ -134,3 +134,13 @@ AlwaysBuild(env.Alias('upload', target_elf, upload_actions))
#
Default([target_buildprog, target_size])
#
# Custom targets
#
env.AddCustomTarget(
'Unpack Mbed OS',
None,
'cd mbedos; $AR x mbedos.lib',
)
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