clang.py (SCons-4.3.0) | : | clang.py (SCons-4.4.0) | ||
---|---|---|---|---|
skipping to change at line 68 | skipping to change at line 68 | |||
msvc_setup_env_once(env) | msvc_setup_env_once(env) | |||
env['CC'] = env.Detect(compilers) or 'clang' | env['CC'] = env.Detect(compilers) or 'clang' | |||
if env['PLATFORM'] in ['cygwin', 'win32']: | if env['PLATFORM'] in ['cygwin', 'win32']: | |||
env['SHCCFLAGS'] = SCons.Util.CLVar('$CCFLAGS') | env['SHCCFLAGS'] = SCons.Util.CLVar('$CCFLAGS') | |||
else: | else: | |||
env['SHCCFLAGS'] = SCons.Util.CLVar('$CCFLAGS -fPIC') | env['SHCCFLAGS'] = SCons.Util.CLVar('$CCFLAGS -fPIC') | |||
# determine compiler version | # determine compiler version | |||
if env['CC']: | if env['CC']: | |||
#pipe = SCons.Action._subproc(env, [env['CC'], '-dumpversion'], | # pipe = SCons.Action._subproc(env, [env['CC'], '-dumpversion'], | |||
pipe = SCons.Action._subproc(env, [env['CC'], '--version'], | pipe = SCons.Action._subproc(env, [env['CC'], '--version'], | |||
stdin='devnull', | stdin='devnull', | |||
stderr='devnull', | stderr='devnull', | |||
stdout=subprocess.PIPE) | stdout=subprocess.PIPE) | |||
if pipe.wait() != 0: return | if pipe.wait() != 0: return | |||
# clang -dumpversion is of no use | # clang -dumpversion is of no use | |||
with pipe.stdout: | with pipe.stdout: | |||
line = pipe.stdout.readline() | line = pipe.stdout.readline() | |||
line = line.decode() | line = line.decode() | |||
match = re.search(r'clang +version +([0-9]+(?:\.[0-9]+)+)', line) | match = re.search(r'clang +version +([0-9]+(?:\.[0-9]+)+)', line) | |||
if match: | if match: | |||
env['CCVERSION'] = match.group(1) | env['CCVERSION'] = match.group(1) | |||
env['CCDEPFLAGS'] = '-MMD -MF ${TARGET}.d' | ||||
env["NINJA_DEPFILE_PARSE_FORMAT"] = 'clang' | ||||
def exists(env): | def exists(env): | |||
return env.Detect(compilers) | return env.Detect(compilers) | |||
# Local Variables: | # Local Variables: | |||
# tab-width:4 | # tab-width:4 | |||
# indent-tabs-mode:nil | # indent-tabs-mode:nil | |||
# End: | # End: | |||
# vim: set expandtab tabstop=4 shiftwidth=4: | # vim: set expandtab tabstop=4 shiftwidth=4: | |||
End of changes. 2 change blocks. | ||||
1 lines changed or deleted | 4 lines changed or added |