Skip to content

Cleanup ideas #18

Open
Open
@henryiii

Description

@henryiii

I have some ideas on the redesign, and want to put them down:

First, I think we should not hard-code flags, and instead allow them to be passed through, like TARGET_LANGUAGE and LANGUAGE_LEVEL unless there's a benefit for us (possibly with TARGET_LANGUAGE? Edit: Yes, we set the extension from this). Users should generally set these options in source files anyway, and if not, they can just as easily pass them through CYTHON_ARGS without us adding lots of custom options. We should also not try to set defaults for the user, and leave that up to Cython.

The command supports adding multiple input files and a single output file - not sure what that does, but if it's useful, we should mimic that here. I don't think there's a lot of benefit in supporting multiple outputs (users can just write a loop) - I'd like to mimic cythonize as closely as possible, just trying to bring it into CMake.

I think instead of an output variable, maybe we should support setting the OUTPUT file directly? That way users can choose where to put the output file location easily. (This also would work best if we don't support multiple input files to multiple output files, above)

Once these are addressed, I think the back-compat "add_cython_target" could be designed using "cython_compile_pyx" Ahh, nice, already done. It could even only exist in scikit-build (classic), as it has a really poor name (it doesn't have anything to do with targets). The "official" version upstreamed to Cython could be called "cythonize".

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions