Skip to content

Commit

Permalink
[ENH] script: add get_clang_version.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Simonhancrew committed Sep 19, 2024
1 parent 11f364e commit 109f25e
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .gnfiles/build/scripts/get_clang_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#
# Copyright © 2024 Agora
# This file is part of TEN Framework, an open source project.
# Licensed under the Apache License, Version 2.0, with certain conditions.
# Refer to the "LICENSE" file in the root directory for more information.
#
import sys
import subprocess
import re

"""
# linux
Ubuntu clang version 14.0.0-1ubuntu1.1
# mac
Apple clang version 15.0.0 (clang-1500.3.9.4)
# win
clang version 14.0.1
"""

def main(argv):
version_string = subprocess.check_output(argv[0] + " --version", shell=True).decode('utf-8')
match = re.search(r'clang version (\d+)', version_string)
if match:
print(match.group(1))
return
print("")


if __name__ == "__main__":
main(sys.argv[1:])

0 comments on commit 109f25e

Please sign in to comment.