The open source OpenXR runtime
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

scripts: Add include-what-you-use (iwyu) related scripts and configs

+594 -2
+7
scripts/cppwinrt.imp
··· 1 + # Copyright 2022-2023, Collabora, Ltd. 2 + # 3 + # SPDX-License-Identifier: BSL-1.0 4 + # 5 + # GENERATED - edit generate_iwyu_mapping_cppwinrt.py instead of this file 6 + [ 7 + ]
+20
scripts/eigen.imp
··· 1 + # Copyright 2022-2023, Collabora, Ltd. 2 + # 3 + # SPDX-License-Identifier: BSL-1.0 4 + # 5 + # GENERATED - edit generate_iwyu_mapping.py instead of this file 6 + [ 7 + { include: ["@[<\"]src/Core/ArrayBase.h[>\"]", "private", "<Eigen/Core>", "public"] }, 8 + { include: ["@[<\"]src/Core/MatrixBase.h[>\"]", "private", "<Eigen/Core>", "public"] }, 9 + { include: ["@[<\"]src/Core/DenseBase.h[>\"]", "private", "<Eigen/Core>", "public"] }, 10 + { include: ["@[<\"]Eigen/src/Core/.*", "private", "<Eigen/Core>", "public"] }, 11 + { include: ["@[<\"]src/Core/.*", "private", "<Eigen/Core>", "public"] }, 12 + { include: ["@[<\"]Eigen/src/Geometry/.*", "private", "<Eigen/Geometry>", "public"] }, 13 + { include: ["@[<\"]src/Geometry/.*", "private", "<Eigen/Geometry>", "public"] }, 14 + { include: ["@[<\"]Eigen/src/LU/.*", "private", "<Eigen/LU>", "public"] }, 15 + { include: ["@[<\"]src/LU/.*", "private", "<Eigen/LU>", "public"] }, 16 + { include: ["@[<\"]Eigen/src/SparseCore/.*", "private", "<Eigen/SparseCore>", "public"] }, 17 + { include: ["@[<\"]src/SparseCore/.*", "private", "<Eigen/SparseCore>", "public"] }, 18 + { include: ["@[<\"]Eigen/src/Sparse/.*", "private", "<Eigen/Sparse>", "public"] }, 19 + { include: ["@[<\"]src/Sparse/.*", "private", "<Eigen/Sparse>", "public"] }, 20 + ]
+153
scripts/generate_iwyu_mapping.py
··· 1 + #!/usr/bin/env python3 2 + # Copyright 2022-2023, Collabora, Ltd. 3 + # 4 + # SPDX-License-Identifier: BSL-1.0 5 + # 6 + # Original author: Rylie Pavlik <rylie.pavlik@collabora.com 7 + """Script to set up mapping.imp, etc for include-what-you-use.""" 8 + from pathlib import Path 9 + from typing import List 10 + 11 + _REPO = Path(__file__).parent.parent.resolve() 12 + _SCRIPT_DIR = Path(__file__).parent.resolve() 13 + _OUTPUT_FILENAME = _SCRIPT_DIR / "mapping.imp" 14 + 15 + _FILE = Path(__file__).resolve() 16 + 17 + _WRAPPERS = [ 18 + """{ include: ["@[<\\"]vulkan/.+", "private", "\\"xrt/xrt_vulkan_includes.h\\"", "public"] },""", 19 + """{ include: ["\\"EGL/eglplatform.h\\"", "private", "\\"ogl/ogl_api.h\\"", "public"] },""", 20 + """{ include: ["<math.h>", "public", "\\"math/m_mathinclude.h\\"", "public"] },""", 21 + """{ include: ["<cmath>", "public", "\\"math/m_mathinclude.h\\"", "public"] },""", 22 + """{ symbol: ["M_PI", "public", "\\"math/m_mathinclude.h\\"", "public"] },""", 23 + """{ symbol: ["M_PIl", "public", "\\"math/m_mathinclude.h\\"", "public"] },""", 24 + """{ symbol: ["M_1_PI", "public", "\\"math/m_mathinclude.h\\"", "public"] },""", 25 + """{ symbol: ["ssize_t", "public", "\\"xrt/xrt_compiler.h\\"", "public"] },""", 26 + ] 27 + 28 + _MISC_ERRORS = [ 29 + """{ include: ["@[<\\"]bits/exception.h[>\\"]", "private", "<exception>", "public"] },""", 30 + """{ include: ["@[<\\"]ext/alloc_traits.h[>\\"]", "private", "<vector>", "public"] },""", 31 + """{ include: ["@[<\\"]bits/types/struct_iovec.h.", "private", "<sys/uio.h>", "public"] },""", 32 + ] 33 + 34 + _MISC_DEPS = [ 35 + """{ include: ["@[<\\"]jmoreconfig.h>\\"]", "private", "\\"jpeglib.h\\"", "public"] },""", 36 + ] 37 + 38 + _OPENCV_ENTRIES = [ 39 + """{ include: ["@<opencv2/core/.*.inl.hpp>", "private", "<opencv2/core.hpp>", "public"] },""", 40 + """{ include: ["@<opencv2/core/hal/.*", "private", "<opencv2/core.hpp>", "public"] },""", 41 + ] 42 + 43 + 44 + def _generate_openxr_entries(): 45 + for header in ("openxr_platform.h", "openxr_platform_defines.h"): 46 + yield """{ include: ["@[<\\"]openxr/%s.*", "private", "\\"xrt/xrt_openxr_includes.h\\"", "public"] },""" % header 47 + 48 + 49 + def _generate_eigen_entries(): 50 + for stubborn_header in ("ArrayBase", "MatrixBase", "DenseBase"): 51 + yield """{ include: ["@[<\\"]src/Core/%s.h[>\\"]", "private", "<Eigen/Core>", "public"] },""" % ( 52 + stubborn_header, 53 + ) 54 + for module in ("Core", "Geometry", "LU", "SparseCore", "Sparse"): 55 + yield """{ include: ["@[<\\"]Eigen/src/%s/.*", "private", "<Eigen/%s>", "public"] },""" % ( 56 + module, 57 + module, 58 + ) 59 + yield """{ include: ["@[<\\"]src/%s/.*", "private", "<Eigen/%s>", "public"] },""" % ( 60 + module, 61 + module, 62 + ) 63 + 64 + 65 + _CONFIG_HEADERS = ( 66 + "xrt_config_android.h", 67 + "xrt_config_build.h", 68 + "xrt_config_drivers.h", 69 + "xrt_config_have.h", 70 + "xrt_config_vulkan.h", 71 + ) 72 + 73 + 74 + def _generate_config_header_defines(): 75 + for header in _CONFIG_HEADERS: 76 + input_filename = header + ".cmake_in" 77 + input_file = _REPO / "src" / "xrt" / "include" / "xrt" / input_filename 78 + with open(str(input_file), "r", encoding="utf-8") as fp: 79 + for line in fp: 80 + if line.startswith("#cmakedefine"): 81 + parts = line.split(" ") 82 + symbol = parts[1].strip() 83 + yield """{ symbol: ["%s", "public", "\\"xrt/%s\\"", "public"] },""" % ( 84 + symbol, 85 + header, 86 + ) 87 + 88 + 89 + def get_all_entries(): 90 + entries = [] 91 + entries.extend(_WRAPPERS) 92 + entries.extend(_MISC_ERRORS) 93 + entries.extend(_MISC_DEPS) 94 + # entries.extend(_OPENCV_ENTRIES) 95 + # entries.extend(_generate_eigen_entries()) 96 + entries.extend(_generate_openxr_entries()) 97 + entries.extend(_generate_config_header_defines()) 98 + return entries 99 + 100 + 101 + # REUSE-IgnoreStart 102 + 103 + 104 + def _find_copyright_lines(fn: Path, *args): 105 + with open(fn, encoding="utf-8") as f: 106 + copyright_lines = [line.strip() for line in f if line.startswith("# Copyright")] 107 + 108 + known_lines = set(copyright_lines) 109 + for alt_fn in args: 110 + with open(_SCRIPT_DIR / alt_fn, encoding="utf-8") as f: 111 + new_lines = [line.strip() for line in f if line.startswith("# Copyright")] 112 + copyright_lines.extend(line for line in new_lines if line not in known_lines) 113 + known_lines.update(new_lines) 114 + 115 + return copyright_lines 116 + 117 + 118 + def write_mapping_file(entries: List[str], output_filename: Path, script_name: str): 119 + """Write an IWYU mapping file with the given entries.""" 120 + # Grab all lines from this and our other script. 121 + lines = _find_copyright_lines(_FILE, script_name) 122 + lines += [ 123 + """#""", 124 + "# SPDX-License" + "-Identifier: BSL-1.0", # split to avoid breaking REUSE tool 125 + """#""", 126 + """# GENERATED - edit %s instead of this file""" % script_name, 127 + "[", 128 + ] 129 + lines.extend(entries) 130 + lines += "]" 131 + content = "".join(line + "\n" for line in lines) 132 + with open(output_filename, "w", encoding="utf-8") as fp: 133 + fp.write(content) 134 + 135 + 136 + # REUSE-IgnoreEnd 137 + 138 + 139 + def write_file(): 140 + my_script_fn = Path(__file__).resolve().name 141 + eigen_path = _SCRIPT_DIR / "eigen.imp" 142 + write_mapping_file(list(_generate_eigen_entries()), eigen_path, my_script_fn) 143 + 144 + opencv_path = _SCRIPT_DIR / "opencv.imp" 145 + write_mapping_file(_OPENCV_ENTRIES, opencv_path, my_script_fn) 146 + entries = get_all_entries() 147 + for ref_path in (eigen_path, opencv_path): 148 + entries.append("""{ ref: "%s" },""" % ref_path.name) 149 + write_mapping_file(entries, _OUTPUT_FILENAME, my_script_fn) 150 + 151 + 152 + if __name__ == "__main__": 153 + write_file()
+65
scripts/generate_iwyu_mapping_cppwinrt.py
··· 1 + #!/usr/bin/env python3 2 + # Copyright 2022-2023, Collabora, Ltd. 3 + # 4 + # SPDX-License-Identifier: BSL-1.0 5 + # 6 + # Original author: Rylie Pavlik <rylie.pavlik@collabora.com 7 + """Script to set up cppwinrt.imp for include-what-you-use.""" 8 + from pathlib import Path 9 + import sys 10 + import re 11 + from generate_iwyu_mapping import write_mapping_file 12 + 13 + _SCRIPT_DIR = Path(__file__).parent.resolve() 14 + _OUTPUT_FILENAME = _SCRIPT_DIR / "cppwinrt.imp" 15 + 16 + header_guard = re.compile(r"#ifndef WINRT_([a-zA-Z0-9_]+)_H\s*") 17 + 18 + 19 + def find_namespace_name(header: Path) -> str: 20 + with open(header, "r", encoding="utf-8") as fp: 21 + for line in fp: 22 + result = header_guard.match(line) 23 + if not result: 24 + continue 25 + define_insides = result.group(1) 26 + return define_insides.replace("_", ".") 27 + 28 + raise RuntimeError("Could not figure out namespace name for " + str(header)) 29 + 30 + 31 + def make_canonical_include(namespace_name: str) -> str: 32 + return "<winrt/%s.h>" % namespace_name 33 + 34 + 35 + def make_private_include_pattern(namespace_name: str) -> str: 36 + def munge_character(c: str): 37 + if c == ".": 38 + return "[.]" 39 + if c.isupper(): 40 + return "[%s%s]" % (c, c.lower()) 41 + return c 42 + 43 + munged_namespace = "".join(munge_character(c) for c in namespace_name) 44 + return "@<winrt/impl/%s[.][0-9][.]h>" % munged_namespace 45 + 46 + 47 + def get_all_cppwinrt_entries(cppwinrt_root: str): 48 + root = Path(cppwinrt_root) 49 + for header in root.glob("*.h"): 50 + namespace_name = find_namespace_name(header) 51 + pattern = make_private_include_pattern(namespace_name) 52 + canonical = make_canonical_include(namespace_name) 53 + yield """{ include: ["%s", "private", "%s", "public"] },""" % ( 54 + pattern, 55 + canonical, 56 + ) 57 + 58 + 59 + def write_file(cppwinrt_root: str): 60 + entries = list(get_all_cppwinrt_entries(cppwinrt_root)) 61 + write_mapping_file(entries, _OUTPUT_FILENAME, Path(__file__).resolve().name) 62 + 63 + 64 + if __name__ == "__main__": 65 + write_file(sys.argv[1])
+57
scripts/generate_iwyu_mapping_msvc.py
··· 1 + #!/usr/bin/env python3 2 + # Copyright 2022-2023, Collabora, Ltd. 3 + # 4 + # SPDX-License-Identifier: BSL-1.0 5 + # 6 + # Original author: Rylie Pavlik <rylie.pavlik@collabora.com 7 + """Script to set up msvc.imp for include-what-you-use.""" 8 + from pathlib import Path 9 + from generate_iwyu_mapping import write_mapping_file 10 + 11 + _SCRIPT_DIR = Path(__file__).parent.resolve() 12 + _OUTPUT_FILENAME = _SCRIPT_DIR / "msvc.imp" 13 + 14 + _STL_EQUIVS = { 15 + "<xutility>": ["<utility>"], 16 + "<xstring>": ["<string>"], 17 + "<xatomic.h>": ["<atomic>"], 18 + "<xtr1common>": ["<type_traits>"], 19 + "<corecrt_math.h>": ["<math.h>", "<cmath>"], 20 + "<vcruntime_exceptions.h>": ["<exception>"], 21 + # This header contains common functionality used by a ton of containers 22 + "<xmemory>": [ 23 + "<deque>", 24 + "<filesystem>", 25 + "<forward_list>", 26 + "<functional>", 27 + "<future>", 28 + "<hash_map>", 29 + "<hash_set>", 30 + "<list>", 31 + "<map>", 32 + "<memory>", 33 + "<set>", 34 + "<string>", 35 + "<unordered_map>", 36 + "<unordered_set>", 37 + "<vector>", 38 + ], 39 + } 40 + 41 + 42 + def get_all_stl_entries(): 43 + for src, dests in _STL_EQUIVS.items(): 44 + for dest in dests: 45 + yield """{ include: ["%s", "private", "%s", "public"] },""" % ( 46 + src, 47 + dest, 48 + ) 49 + 50 + 51 + def write_file(): 52 + entries = list(get_all_stl_entries()) 53 + write_mapping_file(entries, _OUTPUT_FILENAME, Path(__file__).resolve().name) 54 + 55 + 56 + if __name__ == "__main__": 57 + write_file()
+32
scripts/generate_iwyu_mapping_windows.py
··· 1 + #!/usr/bin/env python3 2 + # Copyright 2022-2023, Collabora, Ltd. 3 + # 4 + # SPDX-License-Identifier: BSL-1.0 5 + # 6 + # Original author: Rylie Pavlik <rylie.pavlik@collabora.com 7 + """Script to set up windows.imp for include-what-you-use.""" 8 + from pathlib import Path 9 + from generate_iwyu_mapping import write_mapping_file 10 + 11 + _SCRIPT_DIR = Path(__file__).parent.resolve() 12 + _OUTPUT_FILENAME = _SCRIPT_DIR / "windows.imp" 13 + 14 + 15 + _SYMBOLS = {"IUnknown": "<Unknwn.h>"} 16 + 17 + 18 + def get_all_entries(): 19 + for sym, header in _SYMBOLS.items(): 20 + yield """{ symbol: ["%s", "public", "%s", "public"] },""" % ( 21 + sym, 22 + header, 23 + ) 24 + 25 + 26 + def write_file(): 27 + entries = list(get_all_entries()) 28 + write_mapping_file(entries, _OUTPUT_FILENAME, Path(__file__).resolve().name) 29 + 30 + 31 + if __name__ == "__main__": 32 + write_file()
+103
scripts/mapping.imp
··· 1 + # Copyright 2022-2023, Collabora, Ltd. 2 + # 3 + # SPDX-License-Identifier: BSL-1.0 4 + # 5 + # GENERATED - edit generate_iwyu_mapping.py instead of this file 6 + [ 7 + { include: ["@[<\"]vulkan/.+", "private", "\"xrt/xrt_vulkan_includes.h\"", "public"] }, 8 + { include: ["\"EGL/eglplatform.h\"", "private", "\"ogl/ogl_api.h\"", "public"] }, 9 + { include: ["<math.h>", "public", "\"math/m_mathinclude.h\"", "public"] }, 10 + { include: ["<cmath>", "public", "\"math/m_mathinclude.h\"", "public"] }, 11 + { symbol: ["M_PI", "public", "\"math/m_mathinclude.h\"", "public"] }, 12 + { symbol: ["M_PIl", "public", "\"math/m_mathinclude.h\"", "public"] }, 13 + { symbol: ["M_1_PI", "public", "\"math/m_mathinclude.h\"", "public"] }, 14 + { symbol: ["ssize_t", "public", "\"xrt/xrt_compiler.h\"", "public"] }, 15 + { include: ["@[<\"]bits/exception.h[>\"]", "private", "<exception>", "public"] }, 16 + { include: ["@[<\"]ext/alloc_traits.h[>\"]", "private", "<vector>", "public"] }, 17 + { include: ["@[<\"]bits/types/struct_iovec.h.", "private", "<sys/uio.h>", "public"] }, 18 + { include: ["@[<\"]jmoreconfig.h>\"]", "private", "\"jpeglib.h\"", "public"] }, 19 + { include: ["@[<\"]openxr/openxr_platform.h.*", "private", "\"xrt/xrt_openxr_includes.h\"", "public"] }, 20 + { include: ["@[<\"]openxr/openxr_platform_defines.h.*", "private", "\"xrt/xrt_openxr_includes.h\"", "public"] }, 21 + { symbol: ["XRT_ANDROID_PACKAGE", "public", "\"xrt/xrt_config_android.h\"", "public"] }, 22 + { symbol: ["XRT_MODULE_AUX_VIVE", "public", "\"xrt/xrt_config_build.h\"", "public"] }, 23 + { symbol: ["XRT_MODULE_COMPOSITOR", "public", "\"xrt/xrt_config_build.h\"", "public"] }, 24 + { symbol: ["XRT_MODULE_COMPOSITOR_MAIN", "public", "\"xrt/xrt_config_build.h\"", "public"] }, 25 + { symbol: ["XRT_MODULE_COMPOSITOR_NULL", "public", "\"xrt/xrt_config_build.h\"", "public"] }, 26 + { symbol: ["XRT_MODULE_MERCURY_HANDTRACKING", "public", "\"xrt/xrt_config_build.h\"", "public"] }, 27 + { symbol: ["XRT_MODULE_IPC", "public", "\"xrt/xrt_config_build.h\"", "public"] }, 28 + { symbol: ["XRT_MODULE_MONADO_GUI", "public", "\"xrt/xrt_config_build.h\"", "public"] }, 29 + { symbol: ["XRT_MODULE_MONADO_CLI", "public", "\"xrt/xrt_config_build.h\"", "public"] }, 30 + { symbol: ["XRT_FEATURE_CLIENT_DEBUG_GUI", "public", "\"xrt/xrt_config_build.h\"", "public"] }, 31 + { symbol: ["XRT_FEATURE_COLOR_LOG", "public", "\"xrt/xrt_config_build.h\"", "public"] }, 32 + { symbol: ["XRT_FEATURE_DEBUG_GUI", "public", "\"xrt/xrt_config_build.h\"", "public"] }, 33 + { symbol: ["XRT_FEATURE_OPENXR", "public", "\"xrt/xrt_config_build.h\"", "public"] }, 34 + { symbol: ["XRT_FEATURE_OPENXR_DEBUG_UTILS", "public", "\"xrt/xrt_config_build.h\"", "public"] }, 35 + { symbol: ["XRT_FEATURE_OPENXR_DISPLAY_REFRESH_RATE", "public", "\"xrt/xrt_config_build.h\"", "public"] }, 36 + { symbol: ["XRT_FEATURE_OPENXR_FORCE_FEEDBACK_CURL", "public", "\"xrt/xrt_config_build.h\"", "public"] }, 37 + { symbol: ["XRT_FEATURE_OPENXR_HEADLESS", "public", "\"xrt/xrt_config_build.h\"", "public"] }, 38 + { symbol: ["XRT_FEATURE_OPENXR_INTERACTION_EXT_EYE_GAZE", "public", "\"xrt/xrt_config_build.h\"", "public"] }, 39 + { symbol: ["XRT_FEATURE_OPENXR_INTERACTION_EXT_HAND", "public", "\"xrt/xrt_config_build.h\"", "public"] }, 40 + { symbol: ["XRT_FEATURE_OPENXR_INTERACTION_EXT_PALM_POSE", "public", "\"xrt/xrt_config_build.h\"", "public"] }, 41 + { symbol: ["XRT_FEATURE_OPENXR_INTERACTION_ML2", "public", "\"xrt/xrt_config_build.h\"", "public"] }, 42 + { symbol: ["XRT_FEATURE_OPENXR_INTERACTION_MNDX", "public", "\"xrt/xrt_config_build.h\"", "public"] }, 43 + { symbol: ["XRT_FEATURE_OPENXR_INTERACTION_MSFT_HAND", "public", "\"xrt/xrt_config_build.h\"", "public"] }, 44 + { symbol: ["XRT_FEATURE_OPENXR_INTERACTION_OPPO", "public", "\"xrt/xrt_config_build.h\"", "public"] }, 45 + { symbol: ["XRT_FEATURE_OPENXR_INTERACTION_WINMR", "public", "\"xrt/xrt_config_build.h\"", "public"] }, 46 + { symbol: ["XRT_FEATURE_OPENXR_LAYER_CUBE", "public", "\"xrt/xrt_config_build.h\"", "public"] }, 47 + { symbol: ["XRT_FEATURE_OPENXR_LAYER_CYLINDER", "public", "\"xrt/xrt_config_build.h\"", "public"] }, 48 + { symbol: ["XRT_FEATURE_OPENXR_LAYER_DEPTH", "public", "\"xrt/xrt_config_build.h\"", "public"] }, 49 + { symbol: ["XRT_FEATURE_OPENXR_LAYER_EQUIRECT1", "public", "\"xrt/xrt_config_build.h\"", "public"] }, 50 + { symbol: ["XRT_FEATURE_OPENXR_LAYER_EQUIRECT2", "public", "\"xrt/xrt_config_build.h\"", "public"] }, 51 + { symbol: ["XRT_FEATURE_OPENXR_OVERLAY", "public", "\"xrt/xrt_config_build.h\"", "public"] }, 52 + { symbol: ["XRT_FEATURE_OPENXR_SPACE_LOCAL_FLOOR", "public", "\"xrt/xrt_config_build.h\"", "public"] }, 53 + { symbol: ["XRT_FEATURE_OPENXR_SPACE_UNBOUNDED", "public", "\"xrt/xrt_config_build.h\"", "public"] }, 54 + { symbol: ["XRT_FEATURE_OPENXR_VISIBILITY_MASK", "public", "\"xrt/xrt_config_build.h\"", "public"] }, 55 + { symbol: ["XRT_FEATURE_RENDERDOC", "public", "\"xrt/xrt_config_build.h\"", "public"] }, 56 + { symbol: ["XRT_FEATURE_SERVICE", "public", "\"xrt/xrt_config_build.h\"", "public"] }, 57 + { symbol: ["XRT_FEATURE_SERVICE_SYSTEMD", "public", "\"xrt/xrt_config_build.h\"", "public"] }, 58 + { symbol: ["XRT_FEATURE_SLAM", "public", "\"xrt/xrt_config_build.h\"", "public"] }, 59 + { symbol: ["XRT_FEATURE_SSE2", "public", "\"xrt/xrt_config_build.h\"", "public"] }, 60 + { symbol: ["XRT_FEATURE_STEAMVR_PLUGIN", "public", "\"xrt/xrt_config_build.h\"", "public"] }, 61 + { symbol: ["XRT_FEATURE_TRACING", "public", "\"xrt/xrt_config_build.h\"", "public"] }, 62 + { symbol: ["XRT_FEATURE_WINDOW_PEEK", "public", "\"xrt/xrt_config_build.h\"", "public"] }, 63 + { symbol: ["XRT_IPC_MSG_SOCK_FILENAME", "public", "\"xrt/xrt_config_build.h\"", "public"] }, 64 + { symbol: ["XRT_IPC_SERVICE_PID_FILENAME", "public", "\"xrt/xrt_config_build.h\"", "public"] }, 65 + { symbol: ["XRT_HAVE_BASALT", "public", "\"xrt/xrt_config_have.h\"", "public"] }, 66 + { symbol: ["XRT_HAVE_BLUETOOTH", "public", "\"xrt/xrt_config_have.h\"", "public"] }, 67 + { symbol: ["XRT_HAVE_D3D11", "public", "\"xrt/xrt_config_have.h\"", "public"] }, 68 + { symbol: ["XRT_HAVE_D3D12", "public", "\"xrt/xrt_config_have.h\"", "public"] }, 69 + { symbol: ["XRT_HAVE_DBUS", "public", "\"xrt/xrt_config_have.h\"", "public"] }, 70 + { symbol: ["XRT_HAVE_DXGI", "public", "\"xrt/xrt_config_have.h\"", "public"] }, 71 + { symbol: ["XRT_HAVE_EGL", "public", "\"xrt/xrt_config_have.h\"", "public"] }, 72 + { symbol: ["XRT_HAVE_FFMPEG", "public", "\"xrt/xrt_config_have.h\"", "public"] }, 73 + { symbol: ["XRT_HAVE_GST", "public", "\"xrt/xrt_config_have.h\"", "public"] }, 74 + { symbol: ["XRT_HAVE_HIDAPI", "public", "\"xrt/xrt_config_have.h\"", "public"] }, 75 + { symbol: ["XRT_HAVE_JPEG", "public", "\"xrt/xrt_config_have.h\"", "public"] }, 76 + { symbol: ["XRT_HAVE_KIMERA", "public", "\"xrt/xrt_config_have.h\"", "public"] }, 77 + { symbol: ["XRT_HAVE_LIBBSD", "public", "\"xrt/xrt_config_have.h\"", "public"] }, 78 + { symbol: ["XRT_HAVE_LIBUDEV", "public", "\"xrt/xrt_config_have.h\"", "public"] }, 79 + { symbol: ["XRT_HAVE_LIBUSB", "public", "\"xrt/xrt_config_have.h\"", "public"] }, 80 + { symbol: ["XRT_HAVE_LIBUVC", "public", "\"xrt/xrt_config_have.h\"", "public"] }, 81 + { symbol: ["XRT_HAVE_OPENCV", "public", "\"xrt/xrt_config_have.h\"", "public"] }, 82 + { symbol: ["XRT_HAVE_OPENGL", "public", "\"xrt/xrt_config_have.h\"", "public"] }, 83 + { symbol: ["XRT_HAVE_OPENGLES", "public", "\"xrt/xrt_config_have.h\"", "public"] }, 84 + { symbol: ["XRT_HAVE_OPENVR", "public", "\"xrt/xrt_config_have.h\"", "public"] }, 85 + { symbol: ["XRT_HAVE_PERCETTO", "public", "\"xrt/xrt_config_have.h\"", "public"] }, 86 + { symbol: ["XRT_HAVE_SDL2", "public", "\"xrt/xrt_config_have.h\"", "public"] }, 87 + { symbol: ["XRT_HAVE_SYSTEMD", "public", "\"xrt/xrt_config_have.h\"", "public"] }, 88 + { symbol: ["XRT_HAVE_TRACY", "public", "\"xrt/xrt_config_have.h\"", "public"] }, 89 + { symbol: ["XRT_HAVE_V4L2", "public", "\"xrt/xrt_config_have.h\"", "public"] }, 90 + { symbol: ["XRT_HAVE_VULKAN", "public", "\"xrt/xrt_config_have.h\"", "public"] }, 91 + { symbol: ["XRT_HAVE_WAYLAND", "public", "\"xrt/xrt_config_have.h\"", "public"] }, 92 + { symbol: ["XRT_HAVE_WAYLAND_DIRECT", "public", "\"xrt/xrt_config_have.h\"", "public"] }, 93 + { symbol: ["XRT_HAVE_WIL", "public", "\"xrt/xrt_config_have.h\"", "public"] }, 94 + { symbol: ["XRT_HAVE_WINRT", "public", "\"xrt/xrt_config_have.h\"", "public"] }, 95 + { symbol: ["VK_USE_PLATFORM_ANDROID_KHR", "public", "\"xrt/xrt_config_vulkan.h\"", "public"] }, 96 + { symbol: ["VK_USE_PLATFORM_WAYLAND_KHR", "public", "\"xrt/xrt_config_vulkan.h\"", "public"] }, 97 + { symbol: ["VK_USE_PLATFORM_XCB_KHR", "public", "\"xrt/xrt_config_vulkan.h\"", "public"] }, 98 + { symbol: ["VK_USE_PLATFORM_XLIB_XRANDR_EXT", "public", "\"xrt/xrt_config_vulkan.h\"", "public"] }, 99 + { symbol: ["VK_USE_PLATFORM_WIN32_KHR", "public", "\"xrt/xrt_config_vulkan.h\"", "public"] }, 100 + { symbol: ["VK_USE_PLATFORM_DISPLAY_KHR", "public", "\"xrt/xrt_config_vulkan.h\"", "public"] }, 101 + { ref: "eigen.imp" }, 102 + { ref: "opencv.imp" }, 103 + ]
+28
scripts/msvc.imp
··· 1 + # Copyright 2022, Collabora, Ltd. 2 + # SPDX-License-Identifier: BSL-1.0 3 + # 4 + # GENERATED - edit generate_iwyu_mapping_msvc.py instead of this file 5 + [ 6 + { include: ["<xutility>", "private", "<utility>", "public"] }, 7 + { include: ["<xstring>", "private", "<string>", "public"] }, 8 + { include: ["<xatomic.h>", "private", "<atomic>", "public"] }, 9 + { include: ["<xtr1common>", "private", "<type_traits>", "public"] }, 10 + { include: ["<corecrt_math.h>", "private", "<math.h>", "public"] }, 11 + { include: ["<corecrt_math.h>", "private", "<cmath>", "public"] }, 12 + { include: ["<vcruntime_exceptions.h>", "private", "<exception>", "public"] }, 13 + { include: ["<xmemory>", "private", "<deque>", "public"] }, 14 + { include: ["<xmemory>", "private", "<filesystem>", "public"] }, 15 + { include: ["<xmemory>", "private", "<forward_list>", "public"] }, 16 + { include: ["<xmemory>", "private", "<functional>", "public"] }, 17 + { include: ["<xmemory>", "private", "<future>", "public"] }, 18 + { include: ["<xmemory>", "private", "<hash_map>", "public"] }, 19 + { include: ["<xmemory>", "private", "<hash_set>", "public"] }, 20 + { include: ["<xmemory>", "private", "<list>", "public"] }, 21 + { include: ["<xmemory>", "private", "<map>", "public"] }, 22 + { include: ["<xmemory>", "private", "<memory>", "public"] }, 23 + { include: ["<xmemory>", "private", "<set>", "public"] }, 24 + { include: ["<xmemory>", "private", "<string>", "public"] }, 25 + { include: ["<xmemory>", "private", "<unordered_map>", "public"] }, 26 + { include: ["<xmemory>", "private", "<unordered_set>", "public"] }, 27 + { include: ["<xmemory>", "private", "<vector>", "public"] }, 28 + ]
+9
scripts/opencv.imp
··· 1 + # Copyright 2022-2023, Collabora, Ltd. 2 + # 3 + # SPDX-License-Identifier: BSL-1.0 4 + # 5 + # GENERATED - edit generate_iwyu_mapping.py instead of this file 6 + [ 7 + { include: ["@<opencv2/core/.*.inl.hpp>", "private", "<opencv2/core.hpp>", "public"] }, 8 + { include: ["@<opencv2/core/hal/.*", "private", "<opencv2/core.hpp>", "public"] }, 9 + ]
+82
scripts/run_iwyu.ps1
··· 1 + # Copyright 2022, Collabora, Ltd. 2 + # SPDX-License-Identifier: BSL-1.0 3 + [CmdletBinding()] 4 + param ( 5 + [Parameter()] 6 + [string] 7 + $IwyuBinDir, 8 + 9 + [Parameter()] 10 + [string] 11 + $Python 12 + ) 13 + 14 + $ErrorActionPreference = 'Stop' 15 + Push-Location $PSScriptRoot/.. 16 + 17 + if (!$IwyuBinDir) { 18 + $cmd = Get-Command "iwyu" -ErrorAction SilentlyContinue 19 + if ($cmd) { 20 + $IwyuBinDir = $cmd.Source 21 + } 22 + } 23 + if (!$IwyuBinDir) { 24 + Write-Error "Please specify IwyuBinDir - could not find on path" 25 + return -1 26 + } 27 + 28 + if (!$Python) { 29 + $cmd = Get-Command "python3" -ErrorAction SilentlyContinue 30 + if ($cmd) { 31 + $Python = $cmd.Source 32 + } 33 + } 34 + if (!$Python) { 35 + $cmd = Get-Command "python" -ErrorAction SilentlyContinue 36 + if ($cmd) { 37 + $Python = $cmd.Source 38 + } 39 + } 40 + if (!$Python) { 41 + Write-Error "Please specify Python - could not find on path" 42 + return -1 43 + } 44 + 45 + $iwyuShareDir = Get-Item -Path $IwyuBinDir/../share/include-what-you-use 46 + 47 + function Create-Args { 48 + 49 + [CmdletBinding()] 50 + Param( 51 + 52 + [Parameter(ValueFromPipeline)] 53 + $FullName 54 + ) 55 + 56 + process { 57 + $item = Get-Item $FullName 58 + Write-Output '-Xiwyu' 59 + Write-Output ("--mapping_file=" + $item.FullName) 60 + } 61 + } 62 + 63 + $python_args = @( 64 + (Join-Path $IwyuBinDir "iwyu_tool.py") 65 + "-p" 66 + "build" 67 + "src/xrt" 68 + "--" 69 + ) 70 + $python_args = $python_args + (Join-Path $iwyuShareDir 'iwyu.gcc.imp' | Create-Args) 71 + $python_args = $python_args + (Get-ChildItem -Path $iwyuShareDir -Filter "*intrinsics.imp" | Create-Args) 72 + $python_args = $python_args + (Get-ChildItem -Path $iwyuShareDir -Filter "libcxx.imp" | Create-Args) 73 + Write-Host $python_args 74 + $our_mapping_file = Join-Path (Get-Location) scripts/mapping.imp 75 + 76 + $python_args = $python_args + @("-Xiwyu", "--mapping_file=$our_mapping_file") 77 + # & $Python (Join-Path $IwyuBinDir "iwyu_tool.py") -p build src/xrt -- -Xiwyu "--mapping_file=$our_mapping_file" @python_args | Tee-Object -FilePath iwyu.txt -Encoding utf8 78 + 79 + Start-Process -FilePath $Python -ArgumentList $python_args -PassThru -Wait -NoNewWindow 80 + 81 + Pop-Location 82 +
+13
scripts/run_iwyu.sh
··· 1 + #!/bin/sh 2 + # Copyright 2022, Collabora, Ltd. 3 + # SPDX-License-Identifier: BSL-1.0 4 + 5 + ( 6 + set -e 7 + cd "$(dirname $0)" && cd .. 8 + extra_args="" 9 + for fn in /usr/share/include-what-you-use/iwyu.gcc.imp /usr/share/include-what-you-use/*intrinsics.imp /usr/share/include-what-you-use/libcxx*.imp; do 10 + extra_args="${extra_args} -Xiwyu --mapping_file=$fn" 11 + done 12 + iwyu_tool -p build src/xrt/ "$@" -- -Xiwyu "--mapping_file=$(pwd)/scripts/mapping.imp" ${extra_args} | tee iwyu.txt 13 + )
+7
scripts/windows.imp
··· 1 + # Copyright 2022, Collabora, Ltd. 2 + # SPDX-License-Identifier: BSL-1.0 3 + # 4 + # GENERATED - edit generate_iwyu_mapping_windows.py instead of this file 5 + [ 6 + { symbol: ["IUnknown", "public", "<Unknwn.h>", "public"] }, 7 + ]
+18 -2
src/xrt/.clang-format
··· 1 1 --- 2 2 # SPDX-License-Identifier: CC0-1.0 3 - # SPDX-FileCopyrightText: 2020, Collabora, Ltd. 3 + # SPDX-FileCopyrightText: 2020-2022, Collabora, Ltd. 4 4 Language: Cpp 5 5 BasedOnStyle: LLVM 6 6 Standard: Auto 7 7 8 8 # Includes 9 - SortIncludes: false 9 + SortIncludes: false 10 + # SortIncludes: true 11 + # IncludeBlocks: Regroup 12 + # # IncludeBlocks: Preserve 13 + # IncludeCategories: 14 + # # xrt includes first, they set up defines, clean up after messy headers, etc. 15 + # - Regex: "^[<\"](xrt)/" 16 + # Priority: 2 17 + # # Then, any other internal library 18 + # - Regex: "^[<\"](util|vk|os|math|render|multi)/" 19 + # Priority: 3 20 + # # system includes 21 + # - Regex: "<([[:alnum:].]+|type_traits)>" 22 + # Priority: 5 23 + # # Everything else (local includes) 24 + # - Regex: ".*" 25 + # Priority: 2 10 26 11 27 # Spacing and Blank Lines 12 28 DerivePointerAlignment: false