diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-01-04 08:20:15 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-01-04 09:40:05 +0300 |
commit | f17184bfeb2bfc1d6fe44308e4008454d5a19df0 (patch) | |
tree | c1972b1a363a1c2394a5585b38069656975a7c19 /build_files/cmake | |
parent | 3254a63218dd0ace82bca0b578ee74827bf2fa6d (diff) |
Fix clang_array_check checking utility
Use python3 which is now supported,
only use CLANG_BIND_DIR & CLANG_LIB_DIR when they are set.
Also add immediate mode GPU API function calls.
Diffstat (limited to 'build_files/cmake')
-rw-r--r-- | build_files/cmake/clang_array_check.py | 34 | ||||
-rw-r--r-- | build_files/cmake/cmake_static_check_clang_array.py | 2 |
2 files changed, 32 insertions, 4 deletions
diff --git a/build_files/cmake/clang_array_check.py b/build_files/cmake/clang_array_check.py index 2456f099640..57311623cda 100644 --- a/build_files/cmake/clang_array_check.py +++ b/build_files/cmake/clang_array_check.py @@ -13,7 +13,7 @@ Invocation: export CLANG_BIND_DIR="/dsk/src/llvm/tools/clang/bindings/python" export CLANG_LIB_DIR="/opt/llvm/lib" - python2 clang_array_check.py somefile.c -DSOME_DEFINE -I/some/include + python clang_array_check.py somefile.c -DSOME_DEFINE -I/some/include ... defines and includes are optional @@ -76,6 +76,32 @@ defs_precalc = { "glNormal3bv": {0: 3}, "glNormal3iv": {0: 3}, "glNormal3sv": {0: 3}, + + # GPU immediate mode. + "immVertex2iv": {1: 2}, + + "immVertex2fv": {1: 2}, + "immVertex3fv": {1: 3}, + + "immAttr2fv": {1: 2}, + "immAttr3fv": {1: 3}, + "immAttr4fv": {1: 4}, + + "immAttr3ubv": {1: 3}, + "immAttr4ubv": {1: 4}, + + "immUniform2fv": {1: 2}, + "immUniform3fv": {1: 3}, + "immUniform4fv": {1: 4}, + + "immUniformColor3fv": {0: 3}, + "immUniformColor4fv": {0: 4}, + + "immUniformColor3ubv": {1: 3}, + "immUniformColor4ubv": {1: 4}, + + "immUniformColor3fvAlpha": {0: 3}, + "immUniformColor4fvAlpha": {0: 4}, } # ----------------------------------------------------------------------------- @@ -100,7 +126,8 @@ else: if CLANG_LIB_DIR is None: print("$CLANG_LIB_DIR clang lib dir not set") -sys.path.append(CLANG_BIND_DIR) +if CLANG_BIND_DIR: + sys.path.append(CLANG_BIND_DIR) import clang import clang.cindex @@ -108,7 +135,8 @@ from clang.cindex import (CursorKind, TypeKind, TokenKind) -clang.cindex.Config.set_library_path(CLANG_LIB_DIR) +if CLANG_LIB_DIR: + clang.cindex.Config.set_library_path(CLANG_LIB_DIR) index = clang.cindex.Index.create() diff --git a/build_files/cmake/cmake_static_check_clang_array.py b/build_files/cmake/cmake_static_check_clang_array.py index 61eee360d6e..59743f0244b 100644 --- a/build_files/cmake/cmake_static_check_clang_array.py +++ b/build_files/cmake/cmake_static_check_clang_array.py @@ -32,7 +32,7 @@ CHECKER_IGNORE_PREFIX = [ "intern/moto", ] -CHECKER_BIN = "python2" +CHECKER_BIN = "python3" CHECKER_ARGS = [ os.path.join(os.path.dirname(__file__), "clang_array_check.py"), |