The open source OpenXR runtime
0
fork

Configure Feed

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

scripts: Move add_defined above extension list

+22 -24
+22 -24
scripts/generate_oxr_ext_support.py
··· 5 5 6 6 from pathlib import Path 7 7 8 + def _add_defined(s): 9 + if "defined" in s: 10 + return s 11 + return "defined({})".format(s) 12 + 13 + def or_(*args): 14 + """ 15 + Create an "OR" in the definition condition list. 16 + 17 + Takes any number of strings directly or through e.g. "not_". 18 + """ 19 + return "({})".format(" || ".join(_add_defined(s) for s in args)) 20 + 21 + 22 + def not_(s): 23 + """ 24 + Create a "NOT" in the condition list. 25 + 26 + Takes a single string, directly or through e.g. "or_". 27 + """ 28 + return "(!{})".format(_add_defined(s)) 29 + 8 30 # Each extension that we implement gets an entry in this tuple. 9 31 # Each entry should be a list of defines that are checked for an extension: 10 32 # the first one must be the name of the extension itself. ··· 40 62 ['XR_MNDX_egl_enable', 'XR_USE_PLATFORM_EGL', 'XR_USE_GRAPHICS_API_OPENGL'], 41 63 ['XR_MNDX_force_feedback_curl'], 42 64 ) 43 - 44 - 45 - def or_(*args): 46 - """ 47 - Create an "OR" in the definition condition list. 48 - 49 - Takes any number of strings directly or through e.g. "not_". 50 - """ 51 - return "({})".format(" || ".join(_add_defined(s) for s in args)) 52 - 53 - 54 - def not_(s): 55 - """ 56 - Create a "NOT" in the condition list. 57 - 58 - Takes a single string, directly or through e.g. "or_". 59 - """ 60 - return "(!{})".format(_add_defined(s)) 61 - 62 - 63 - def _add_defined(s): 64 - if "defined" in s: 65 - return s 66 - return "defined({})".format(s) 67 65 68 66 69 67 ROOT = Path(__file__).resolve().parent.parent