mirror of
https://github.com/platformio/platformio-core.git
synced 2025-07-30 01:57:13 +02:00
Builder: append target suffix to the filename instead of replacing
This commit is contained in:
@ -19,6 +19,7 @@ from os import environ
|
|||||||
from os.path import expanduser, join
|
from os.path import expanduser, join
|
||||||
from time import time
|
from time import time
|
||||||
|
|
||||||
|
from SCons import Builder, Util
|
||||||
from SCons.Script import (ARGUMENTS, COMMAND_LINE_TARGETS, DEFAULT_TARGETS,
|
from SCons.Script import (ARGUMENTS, COMMAND_LINE_TARGETS, DEFAULT_TARGETS,
|
||||||
Action, AllowSubstExceptions, AlwaysBuild,
|
Action, AllowSubstExceptions, AlwaysBuild,
|
||||||
DefaultEnvironment, Variables)
|
DefaultEnvironment, Variables)
|
||||||
@ -27,6 +28,19 @@ from platformio import util
|
|||||||
|
|
||||||
AllowSubstExceptions(NameError)
|
AllowSubstExceptions(NameError)
|
||||||
|
|
||||||
|
|
||||||
|
def scons_patched_match_splitext(path, suffixes=None):
|
||||||
|
"""
|
||||||
|
Patch SCons version, append $OBJSUFFIX to the end of each target
|
||||||
|
"""
|
||||||
|
result = Util.splitext(path)
|
||||||
|
if result[1] in (suffixes or []):
|
||||||
|
return (path, result[1])
|
||||||
|
return result
|
||||||
|
|
||||||
|
|
||||||
|
Builder.match_splitext = scons_patched_match_splitext
|
||||||
|
|
||||||
# allow common variables from INI file
|
# allow common variables from INI file
|
||||||
commonvars = Variables(None)
|
commonvars = Variables(None)
|
||||||
commonvars.AddVariables(
|
commonvars.AddVariables(
|
||||||
|
Reference in New Issue
Block a user