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

cython as a CMake Language #46

Open
LecrisUT opened this issue Aug 6, 2024 · 2 comments
Open

cython as a CMake Language #46

LecrisUT opened this issue Aug 6, 2024 · 2 comments

Comments

@LecrisUT
Copy link
Collaborator

LecrisUT commented Aug 6, 2024

Quite some time ago I was researching adding a CMake language using CMake<Lang>Information.cmake with a prototype using Fypp. I don't remember where I've left off in that process, but iirc the issue was on the Fortran side. Probably for C/C++ adding a language as a preprocessor would still work.

Alternatively, for fypp I ended up writing it as Fypp_target_sources instead. That could also be a more CMakey way of implementing this support.

Has anyone else looked into the adding custom language approach?

@henryiii
Copy link
Contributor

henryiii commented Sep 6, 2024

I don't think this is the correct approach. Cython is a transpiler. You still need a language compiler (C or CXX) to compile the file that Cython transpiles. You'd still need C or CXX settings, etc, on the targets.

@LecrisUT
Copy link
Collaborator Author

LecrisUT commented Sep 6, 2024

You can combine compiled objects from different languages. The issue that I've encountered is that even aa I generate the C/CXX file, I cannot trick CMake to add it as a source when inside the CMake<Lang>Information.cmake. This would need some patches upstream to allow chaining of target_spurces based on input and output extensions.

Any specific concerns about an Cython_target_sources which simply chains the transpile and target_sources command?

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

No branches or pull requests

2 participants