2 from __future__
import annotations
9 from ._version
import __version__
10 from .commands
import get_cmake_dir, get_include, get_pkgconfig_dir
13 if "posix" in sys.builtin_module_names:
14 from shlex
import quote
15 elif "nt" in sys.builtin_module_names:
20 UNSAFE = re.compile(
"[ \t\n\r]")
23 if s
and not UNSAFE.search(s):
28 return f
'"{s}\\"' if s.endswith(
"\\")
else f
'"{s}"'
31 def quote(s: str) -> str:
37 sysconfig.get_path(
"include"),
38 sysconfig.get_path(
"platinclude"),
45 if d
and d
not in unique_dirs:
48 print(
" ".join(
quote(f
"-I{d}")
for d
in unique_dirs))
52 parser = argparse.ArgumentParser()
57 help=
"Print the version and exit.",
62 help=
"Include flags for both pybind11 and Python headers.",
67 help=
"Print the CMake module directory, ideal for setting -Dpybind11_ROOT in CMake.",
72 help=
"Print the pkgconfig directory, ideal for setting $PKG_CONFIG_PATH.",
74 args = parser.parse_args()
85 if __name__ ==
"__main__":