-
Notifications
You must be signed in to change notification settings - Fork 69
Propagate CXXFLAGS correctly to setup.py #1188
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
base: master
Are you sure you want to change the base?
Conversation
…om CMake), and remove flag trace
if(CMAKE_BUILD_TYPE MATCHES Debug) | ||
set(GUDHI_COMPILATION_FLAGS_STRING ${CMAKE_CXX_FLAGS_DEBUG}) | ||
else() | ||
set(GUDHI_COMPILATION_FLAGS_STRING ${CMAKE_CXX_FLAGS_RELEASE}) | ||
endif() |
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 don't like hard-coding that there are only Debug and Release, there are more build types in CMake. Sadly, I think any clean way to handle it would require non-trivial changes (for instance delaying some operations from configuration to generation or even build, so we can use generator expressions). So I guess we could go with this temporarily 🙈
# Compilation flags are in a string. Transform it to a list and append them to GUDHI_PYTHON_EXTRA_COMPILE_ARGS | ||
string(REPLACE " " ";" GUDHI_COMPILATION_FLAGS_LIST ${GUDHI_COMPILATION_FLAGS_STRING}) |
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 assume it breaks if the flags contain -I/some/dir with/a space/
? It is probably already broken elsewhere in our build stuff though.
When CXXFLAGS environment variable is set, with setuptools >= 74.0.0, python compilation flags are removed.
Take the ones coming from CFLAGS (as setuptools is doing before overwriting them with the CXXFLAGS environment variable value).
It also adds
CMAKE_CXX_FLAGS_RELEASE
|CMAKE_CXX_FLAGS_DEBUG
to setup.pyextra_compile_args
in order to add '-O3' in release mode and speed up computation.Could fix conda-forge/gudhi-feedstock#71 (to investigate)