scripts: add a way to provide libclang include dirs externally#63
Conversation
julian-smith-artifex-com
left a comment
There was a problem hiding this comment.
Many thanks for this PR.
Some minor suggestions:
- Could you call the environment variable
MUPDF_LIBCLANG_ARGS? as it isn't inherently limited to include directories. - Use
shlex.split()instead of splitting simply by spaces, in case we ever need to pass args with spaces etc. - We tend to use
os.environ.get()instead ofos.getenv().
So something like:
import shlex
...
libclang_args = os.environ.get('MUPDF_LIBCLANG_ARGS', '')
args += shlex.split(libclang_args)
Some non-technical things:
-
To accept your PR we'll need you to agree to our Artifex Contributor License Agreement - see:
https://artifex.com/contributor/ -
This Github repostitory is really a readonly copy of the main repository ghostscript.com:/home/git/mupdf.git, so when your PR is ok i will push your commit to the main repository manually instead of merging the PR here.
-
If you prefer, i can create a commit independently to save you from worrying about the CLA etc.
When cross-compiling, libclang doesn't necessarily have the right include directories configured by default. See for example: https://bugs.ghostscript.com/show_bug.cgi?id=708041 Since we also have no way to figure out the right include directories from our scripts, add a new environment variable that can be used to provide them externally. Signed-off-by: Raphaël Mélotte <raphael.melotte@mind.be>
048855a to
b2483d9
Compare
|
Thanks for your excellent suggestions, I applied them and updated the PR. Regarding the CLA, I actually already signed it using the CLA Assistant in the PyMuPDF project in pymupdf/PyMuPDF#3173. |
|
Hi @julian-smith-artifex-com , |
|
Apologies for the delay. Yes, you've already signed the CLA so there's no need to do so again. I'm off work for the next few days, but i've added a todo item to submit your commit for internal review, hopefully by the end of next week. |
When cross-compiling, libclang doesn't necessarily have the right include directories configured by default.
See for example: https://bugs.ghostscript.com/show_bug.cgi?id=708041
Since we also have no way to figure out the right include directories from our scripts, add a new environment variable that can be used to provide them externally.