Esempio n. 1
0
def ProcessGeneral(env):
    corelibs = []
    if "BUILD_FLAGS" in env:
        env.MergeFlags(env['BUILD_FLAGS'])

    if "FRAMEWORK" in env:
        if env['FRAMEWORK'] in ("arduino", "energia"):
            env.ConvertInoToCpp()
        SConscriptChdir(0)
        corelibs = SConscript(env.subst(
            join("$PIOBUILDER_DIR", "scripts", "frameworks",
                 "${FRAMEWORK}.py")),
                              exports="env")
    return corelibs
Esempio n. 2
0
def BuildFramework(env):
    if "FRAMEWORK" not in env:
        return

    if env['FRAMEWORK'].lower() in ("arduino", "energia"):
        env.ConvertInoToCpp()

    for f in env['FRAMEWORK'].split(","):
        framework = f.strip().lower()
        if framework in env.get("BOARD_OPTIONS", {}).get("frameworks"):
            SConscriptChdir(0)
            SConscript(
                env.subst(
                    join("$PIOBUILDER_DIR", "scripts", "frameworks",
                         "%s.py" % framework)))
        else:
            Exit("Error: This board doesn't support %s framework!" % framework)
Esempio n. 3
0
def ProcessGeneral(env):
    corelibs = []
    if "BUILD_FLAGS" in env:
        env.MergeFlags(env['BUILD_FLAGS'])

    env.PrependENVPath(
        "PATH", join(env.subst("$PLATFORMTOOLS_DIR"), "toolchain", "bin"))

    if "FRAMEWORK" in env:
        if env['FRAMEWORK'] in ("arduino", "energia"):
            env.ConvertInotoCpp()
        SConscriptChdir(0)
        corelibs = SConscript(env.subst(
            join("$PIOBUILDER_DIR", "scripts", "frameworks",
                 "${FRAMEWORK}.py")),
                              exports="env")
    return corelibs
Esempio n. 4
0
            ) else join("$PIOHOME_DIR", "packages", "ldscripts",
                        "${BOARD_OPTIONS['build']['ldscript']}")))

    if env['PLATFORM'] != env.get("BOARD_OPTIONS", {}).get("platform"):
        Exit("Error: '%s' platform doesn't support this board. "
             "Use '%s' platform instead." %
             (env['PLATFORM'], env.get("BOARD_OPTIONS", {}).get("platform")))

for opt in ("LIB_IGNORE", "LIB_USE"):
    if opt not in env:
        continue
    env[opt] = [l.strip() for l in env[opt].split(",") if l.strip()]

env.PrependENVPath(
    "PATH", env.subst(join("$PIOPACKAGES_DIR", "$PIOPACKAGE_TOOLCHAIN",
                           "bin")))

SConscriptChdir(0)
SConscript(env.subst("$BUILD_SCRIPT"))

if getenv("PLATFORMIO_EXTRA_SCRIPT", env.get("EXTRA_SCRIPT", None)):
    SConscript(getenv("PLATFORMIO_EXTRA_SCRIPT", env.get("EXTRA_SCRIPT")))

if "envdump" in COMMAND_LINE_TARGETS:
    print env.Dump()
    Exit()

if "idedata" in COMMAND_LINE_TARGETS:
    print json.dumps(env.DumpIDEData())
    Exit()