-
Notifications
You must be signed in to change notification settings - Fork 470
allow :include in include_dirs field #3993
Copy link
Copy link
Closed
ocaml/opam-repository
#22317Labels
enhancementgood first issueGood for contributing for the first time to the Dune codebaseGood for contributing for the first time to the Dune codebase
Description
Desired Behavior
the include_dirs subfield of the foreign_stubs field of the library stanza should accept :include files.
this would be useful when running a script to find out the necessary include dirs, to include the results of that step.
Example
i was trying to link to the python headers corresponding to the installed python executable. the directory is readily obtained from python with a rule like this:
(rule
(target python-includes)
(mode promote)
(alias get-python-includes)
(action
(with-stdout-to
python-includes
(run python -c "import sysconfig; print(sysconfig.get_paths()['include'])"))))i then wanted to read this file like this:
(library
(name python_ocaml_init)
(foreign_stubs
(language c)
(names python_init)
(flags :standard -w -fPIC -Wall -O2)
(include_dirs (:include python-includes)))
(modules python_init)
[...]
which failed. i found a workaround using the flags field which does accept :include but the solution above is cleaner IMO.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementgood first issueGood for contributing for the first time to the Dune codebaseGood for contributing for the first time to the Dune codebase