···5566from pathlib import Path
7788+def _add_defined(s):
99+ if "defined" in s:
1010+ return s
1111+ return "defined({})".format(s)
1212+1313+def or_(*args):
1414+ """
1515+ Create an "OR" in the definition condition list.
1616+1717+ Takes any number of strings directly or through e.g. "not_".
1818+ """
1919+ return "({})".format(" || ".join(_add_defined(s) for s in args))
2020+2121+2222+def not_(s):
2323+ """
2424+ Create a "NOT" in the condition list.
2525+2626+ Takes a single string, directly or through e.g. "or_".
2727+ """
2828+ return "(!{})".format(_add_defined(s))
2929+830# Each extension that we implement gets an entry in this tuple.
931# Each entry should be a list of defines that are checked for an extension:
1032# the first one must be the name of the extension itself.
···4062 ['XR_MNDX_egl_enable', 'XR_USE_PLATFORM_EGL', 'XR_USE_GRAPHICS_API_OPENGL'],
4163 ['XR_MNDX_force_feedback_curl'],
4264)
4343-4444-4545-def or_(*args):
4646- """
4747- Create an "OR" in the definition condition list.
4848-4949- Takes any number of strings directly or through e.g. "not_".
5050- """
5151- return "({})".format(" || ".join(_add_defined(s) for s in args))
5252-5353-5454-def not_(s):
5555- """
5656- Create a "NOT" in the condition list.
5757-5858- Takes a single string, directly or through e.g. "or_".
5959- """
6060- return "(!{})".format(_add_defined(s))
6161-6262-6363-def _add_defined(s):
6464- if "defined" in s:
6565- return s
6666- return "defined({})".format(s)
676568666967ROOT = Path(__file__).resolve().parent.parent