diff options
Diffstat (limited to 'methods.py')
-rw-r--r-- | methods.py | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/methods.py b/methods.py index 42eac7ca75..ec9ecdb17f 100644 --- a/methods.py +++ b/methods.py @@ -4,7 +4,6 @@ import sys import re import glob import string -import datetime import subprocess from compat import iteritems, isbasestring, decode_utf8 @@ -55,7 +54,7 @@ def update_version(module_version_string=""): f.write("#define VERSION_STATUS \"" + str(version.status) + "\"\n") f.write("#define VERSION_BUILD \"" + str(build_name) + "\"\n") f.write("#define VERSION_MODULE_CONFIG \"" + str(version.module_config) + module_version_string + "\"\n") - f.write("#define VERSION_YEAR " + str(2018) + "\n") + f.write("#define VERSION_YEAR " + str(version.year) + "\n") f.close() # NOTE: It is safe to generate this file here, since this is still executed serially @@ -660,3 +659,16 @@ def detect_darwin_sdk_path(platform, env): print("Failed to find SDK path while running xcrun --sdk {} --show-sdk-path.".format(sdk_name)) raise +def get_compiler_version(env): + version = decode_utf8(subprocess.check_output([env['CXX'], '--version']).strip()) + match = re.search('[0-9][0-9.]*', version) + if match is not None: + return match.group().split('.') + else: + return None + +def using_gcc(env): + return 'gcc' in os.path.basename(env["CC"]) + +def using_clang(env): + return 'clang' in os.path.basename(env["CC"]) |