Last active
August 29, 2015 14:10
-
-
Save Daxx/117b5279f41e1b299aad to your computer and use it in GitHub Desktop.
shared.py uses "clang++ -v" but Ubuntu returns (e.g.) "Ubuntu clang version 3.3-16ubuntu1" rather than "clang version 3.3-16ubuntu1" which confuses the check and emits an unnecessary warning
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- /usr/share/emscripten/tools/shared_ORIG.py 2014-02-06 00:18:33.000000000 | |
+++ /usr/share/emscripten/tools/shared.py 2014-11-21 02:58:05.000000000 | |
@@ -274,19 +274,20 @@ | |
actual_clang_version = None | |
def get_clang_version(): | |
global actual_clang_version | |
if actual_clang_version is None: | |
- actual_clang_version = Popen([CLANG, '-v'], stderr=PIPE).communicate()[1].split('\n')[0].split(' ')[2] | |
+ mv = re.search(r'\s+[Vv]ersion\s+(\d+\.\d+)', Popen([CLANG, '-v'], stderr=PIPE).communicate()[1]) | |
+ actual_clang_version = mv and mv.group(1) | |
return actual_clang_version | |
def check_clang_version(): | |
expected = '.'.join(map(str, EXPECTED_LLVM_VERSION)) | |
actual = get_clang_version() | |
- if expected in actual: | |
+ if actual and float(actual) >= float(expected): | |
return True | |
logging.warning('LLVM version appears incorrect (seeing "%s", expected "%s")' % (actual, expected)) | |
return False | |
def check_llvm_version(): | |
try: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
... & Apple example ...
Apple clang version 4.1 (tags/Apple/clang-421.11.65) (based on LLVM 3.1svn)
Target: x86_64-apple-darwin12.2.0
Thread model: posix