forked from platformio/platformio-core
Remove redundant code
This commit is contained in:
@ -14,7 +14,6 @@
|
||||
|
||||
import glob
|
||||
import os
|
||||
import shlex
|
||||
|
||||
import SCons.Defaults # pylint: disable=import-error
|
||||
import SCons.Subst # pylint: disable=import-error
|
||||
@ -139,14 +138,9 @@ def dump_svd_path(env):
|
||||
return None
|
||||
|
||||
|
||||
def _subst_cmd(env, cmd):
|
||||
args = env.subst_list(cmd, SCons.Subst.SUBST_CMD)[0]
|
||||
return " ".join([SCons.Subst.quote_spaces(arg) for arg in args])
|
||||
|
||||
|
||||
def _split_flags_string(s):
|
||||
flags = shlex.split(s, posix=False)
|
||||
return [f[1:-1] if f.startswith('"') and f.endswith('"') else f for f in flags]
|
||||
def _split_flags_string(env, s):
|
||||
args = env.subst_list(s, SCons.Subst.SUBST_CMD)[0]
|
||||
return [str(arg) for arg in args]
|
||||
|
||||
|
||||
def DumpIntegrationData(*args):
|
||||
@ -159,12 +153,8 @@ def DumpIntegrationData(*args):
|
||||
],
|
||||
"defines": dump_defines(projenv),
|
||||
"includes": projenv.DumpIntegrationIncludes(),
|
||||
"cc_flags": _split_flags_string(
|
||||
_subst_cmd(projenv, "$CFLAGS $CCFLAGS $CPPFLAGS")
|
||||
),
|
||||
"cxx_flags": _split_flags_string(
|
||||
_subst_cmd(projenv, "$CXXFLAGS $CCFLAGS $CPPFLAGS")
|
||||
),
|
||||
"cc_flags": _split_flags_string(projenv, "$CFLAGS $CCFLAGS $CPPFLAGS"),
|
||||
"cxx_flags": _split_flags_string(projenv, "$CXXFLAGS $CCFLAGS $CPPFLAGS"),
|
||||
"cc_path": where_is_program(
|
||||
globalenv.subst("$CC"), globalenv.subst("${ENV['PATH']}")
|
||||
),
|
||||
|
Reference in New Issue
Block a user