-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat: rewrite #19
feat: rewrite #19
Conversation
a7b332c
to
26b1889
Compare
3fd0a06
to
157e780
Compare
@vyasr, thoughts? |
4e9afe2
to
4c12c10
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the back-compat method that you meant? If you mean the add_cython_target
, yes I agree that should go. I read through #18 and I think as you noted that some of the ideas were already implemented in my original prototype, but also not all of them made it from my prototype into what's in this repo so there are probably additional improvements still to be made here. This was definitely one of the changes I had intended.
I don't have any powers in this repo unfortunately, but generally the changes look good to me.
# And the following target: | ||
# | ||
# ``Cython::Cython`` | ||
# The Cython executable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we stop documenting the CYTHON_EXECUTABLE
variable altogether and just say that the only supported way to get it is via this target?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They are different when cross compiling. Targets will use the cross-compiling emulator, while variables are just variables. Also, target's can't be used in some places like during the configure process, while variables can.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, I guess the cython command could itself have been cythonized and therefore be native to the target system.
endif() | ||
# Generated depfile is expected to have the ".dep" extension and be located | ||
# along side the generated source file. | ||
set(depfile_path "${CYTHON_OUTPUT}.dep") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We added depfile support in https://github.com/rapidsai/rapids-cmake/pull/579/files, so you may want to double-check there to see if we did anything differently from what you did here (good or bad) since both our code and the new code in this repo are very stripped down relative to what UseCython.cmake looked like before this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe all features have been added while maintaining the history and giving credits to the various contributors.
For reference, depfile support has indeed been added through 490f199
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only thing I saw I commented on that PR; that one is missing the depfile as output, while I think it's correct to list it there (since it's not always output, just usually, so CMake likely can't assume it's output).
ca5d208
to
b7e21ae
Compare
For reference, testing of the module using scikit-build-core is being added through: |
Added a few more fixes; you can now use UseCython directly if you want. I've also made an F2Py version at https://github.com/scikit-build/f2py-cmake. |
5fc97df
to
d971432
Compare
0b49dc7
to
d5e69e4
Compare
d5e69e4
to
a4e3676
Compare
Apologies, totally dropped the ball on this one. I'll take a pass at reviewing, but overall it seems like it's come a long way and is a definite improvement. |
a4e3676
to
0cfee10
Compare
0f19767
to
4d122ed
Compare
Signed-off-by: Henry Schreiner <[email protected]> feat: deduce C/CXX if possible Signed-off-by: Henry Schreiner <[email protected]> fix: better handling of output Signed-off-by: Henry Schreiner <[email protected]> docs: add info Signed-off-by: Henry Schreiner <[email protected]>
4d122ed
to
3c1b93d
Compare
I think most of this is in, minus some stylistic stuff |
Close #18.
Currently require 3.20 (for cmake_path), which was implicitly required before.Reduced to at least 3.15, probably 3.7, but DEPFILE only works on Ninja until Make was added in 3.20.Cython::Cython
targetAlong with this, this is the new syntax for the
Cython_compile_pyx
function:OUTPUT
sets the file path, otherwise it's the same name with new extension in the current binary dir.OUTPUT_VARIABLE
contains the file path to the generated output.CYTHON_ARGS
variable to set the default. It would be useful for adding things like annotation on all calls.If this works well, we can propose a
cythonize
function upstream to Cython; if they make changes to the signature, we can wrap those once it's released and provide "cythonize" for previous versions of Cython.