Sonkun, 19.04.2013 18:32:
> I rewrote the ext_build command of Cython to deal with these generated API
> headers. I want them to be generated and installed in a given location but
> this isn't my issue.
I assume you are referring to the xyz_api.h files that the "api" modifier
triggers.
> I noticed if the .cpp file still exists, the
> cytonization process is skipped and so won't generate these headers while
> it should, to regenerate these missing headers.
That sounds like a bug to me.
> If I'm right until here:
>
> 1. Can I write a patch or you prefer to handle it ?
This is an open source project. Please do.
> 2. How would you retrieve this information from a .pxd file
You can't. But you can use cythonize(), which parses for dependencies. Not
sure if it can figure out if an api header file needs to be generated. That
feature would have to be added then.
> any idea better than re-parsing the file to check for api/extern keywords ?
No. If any of the output files is outdated, the compiler must be run to
regenerate everything.
> PS: A while ago, I asked for adding an option to Cython to make it generate
> API headers in a given location, it was approved by Stephan Benhel. Is the
> idea accepted ?
No idea who that guy is, but I'd still approve it.
> Can I take care of this ?
What makes you think you have to ask?
> How would you name this option ?
Something like "api_output_dir" might work. "header_output_dir" sounds both
too generic and too specific, given that we might also put .pxd files there.
As usual, a pet name might be a more future proof option, but I think that
"api_output_dir" should work ok for now.
Stefan