Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor tweaks to tools/mkdoc.py #1788

Merged
merged 10 commits into from
Jun 11, 2019
Merged

Minor tweaks to tools/mkdoc.py #1788

merged 10 commits into from
Jun 11, 2019

Conversation

drmoose
Copy link
Contributor

@drmoose drmoose commented May 16, 2019

This PR contains an assortment of minor changes to tools/mkdoc.py intended to make it easier to integrate into automated build workflows:

  • Adds compatibility with Clang 8.x
  • Accepts the -o option, so the output can be written to a file instead of stderr
  • Detects and loads the clang system include dir (e.g. /usr/lib/clang/8.0.0/include) on Linux
  • Tries to get as much of the functionality as possible out of if __name__ == '__main__' and into functions that can be called by other python scripts.

Because this is a grab bag of minor tweaks, I've tried to organize the commits so that it's easy to pick and choose -- if there's something I've done here that you don't like, I'm happy to rebase that commit out of the branch.

drmoose added 10 commits May 15, 2019 17:58
Recent versions of clang.cindex include [code][1] that converts
the internal byte strings to python str for you.

  [1]: https://github.com/llvm-mirror/clang/blob/master/bindings/python/clang/cindex.py#L72
On some linuxes, /usr/include belongs to GCC and the standard
libraries that work with clang are in /usr/lib/clang/8.0.0 or
some variation thereof.

This results in errors such as:

```
/../lib64/gcc/x86_64-pc-linux-gnu/8.3.0/../../../../include/c++/8.3.0/bits/cxxabi_init_exception.h:38:10: fatal error: 'stddef.h' file not found

```

during extraction.
@wjakob
Copy link
Member

wjakob commented Jun 11, 2019

This looks really great! I'm happy with all of these changes.

@wjakob wjakob merged commit 41f29cc into pybind:master Jun 11, 2019
@wjakob
Copy link
Member

wjakob commented Jun 11, 2019

(The reorganization into small commits was nice, so I rebased your commits rather than squashing them)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants