From 0ecbe661224e615031cb2f036dbfc0b084b8d845 Mon Sep 17 00:00:00 2001 From: TheMarpe Date: Tue, 27 Apr 2021 00:28:21 +0200 Subject: [PATCH] Added additional C++ include directories --- pybind11_mkdoc/mkdoc_lib.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/pybind11_mkdoc/mkdoc_lib.py b/pybind11_mkdoc/mkdoc_lib.py index 9d2fd08..b4ceb37 100755 --- a/pybind11_mkdoc/mkdoc_lib.py +++ b/pybind11_mkdoc/mkdoc_lib.py @@ -283,7 +283,7 @@ def folder_version(d): # useful when installing LLVM to non standard directories if 'LLVM_DIR_PATH' in os.environ: llvm_dir = os.environ['LLVM_DIR_PATH'] - else: + else: llvm_dir = max(( path for libdir in ['lib64', 'lib', 'lib32'] @@ -302,6 +302,21 @@ def folder_version(d): parameters.extend(['-isystem', clang_include_dir]) + # Add additional C++ include directories + cpp_dirs = [] + + cpp_dirs.append(max( + glob('/usr/include/c++/*' + ), default=None, key=folder_version)) + + cpp_dirs.append(max( + glob('/usr/include/%s-linux-gnu/c++/*' % platform.machine() + ), default=None, key=folder_version)) + + for cpp_dir in cpp_dirs : + if cpp_dir is not None : + parameters.extend(['-isystem', cpp_dir]) + parameters.extend(['-isystem', '/usr/include/%s-linux-gnu' % platform.machine(), '-isystem', '/usr/include'])