mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-09-14 02:03:12 +02:00
This reverts commits 9d077c9ba5a3616e1aff0da7397edd0f0ec5f954 and b4938f5198193f08276edbc10d6dc6dcb068cf94. They cause a crash-on-startup on Mac ARM machines, failing to get the locale encoding (nl_langinfo(CODESET) failed).
53 lines
1.1 KiB
Python
53 lines
1.1 KiB
Python
# -*- coding: utf-8 -*-
|
|
from __future__ import print_function
|
|
|
|
import argparse
|
|
import sys
|
|
import sysconfig
|
|
|
|
from .commands import get_cmake_dir, get_include
|
|
|
|
|
|
def print_includes():
|
|
# type: () -> None
|
|
dirs = [
|
|
sysconfig.get_path("include"),
|
|
sysconfig.get_path("platinclude"),
|
|
get_include(),
|
|
]
|
|
|
|
# Make unique but preserve order
|
|
unique_dirs = []
|
|
for d in dirs:
|
|
if d and d not in unique_dirs:
|
|
unique_dirs.append(d)
|
|
|
|
print(" ".join("-I" + d for d in unique_dirs))
|
|
|
|
|
|
def main():
|
|
# type: () -> None
|
|
|
|
parser = argparse.ArgumentParser()
|
|
parser.add_argument(
|
|
"--includes",
|
|
action="store_true",
|
|
help="Include flags for both pybind11 and Python headers.",
|
|
)
|
|
parser.add_argument(
|
|
"--cmakedir",
|
|
action="store_true",
|
|
help="Print the CMake module directory, ideal for setting -Dpybind11_ROOT in CMake.",
|
|
)
|
|
args = parser.parse_args()
|
|
if not sys.argv[1:]:
|
|
parser.print_help()
|
|
if args.includes:
|
|
print_includes()
|
|
if args.cmakedir:
|
|
print(get_cmake_dir())
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|