mirror of
https://github.com/DarkFlippers/unleashed-firmware
synced 2024-11-23 13:03:13 +00:00
20 lines
467 B
Python
20 lines
467 B
Python
|
import SCons
|
||
|
from SCons.Subst import quote_spaces
|
||
|
|
||
|
import re
|
||
|
|
||
|
|
||
|
WINPATHSEP_RE = re.compile(r"\\([^\"'\\]|$)")
|
||
|
|
||
|
|
||
|
def tempfile_arg_esc_func(arg):
|
||
|
arg = quote_spaces(arg)
|
||
|
if SCons.Platform.platform_default() != "win32":
|
||
|
return arg
|
||
|
# GCC requires double Windows slashes, let's use UNIX separator
|
||
|
return WINPATHSEP_RE.sub(r"/\1", arg)
|
||
|
|
||
|
|
||
|
def wrap_tempfile(env, command):
|
||
|
env[command] = '${TEMPFILE("' + env[command] + '","$' + command + 'STR")}'
|