-
Notifications
You must be signed in to change notification settings - Fork 9
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
Bugfix: CMake configuration #264
Conversation
nathanwbrei
commented
Nov 20, 2023
- Correctly specifies podio, podioRootIO as link library dependencies of JANA2 target
- Correctly propagates preprocessor (e.g. HAVE_PODIO) defines as compile options of JANA2 target
- Prefixes all preprocessor defines with JANA2 to avoid conflicts downstream
It's not necessarily the most obvious that it's |
That's because (in my opinion) it really should be I'm also very tempted to remove the target_compile_definitions from exported target entirely, and bake them into the generated |
@faustus123 @DraTeots @wdconinc @veprbl How would everyone feel if I moved |
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.
Not the objection but JANA2_HAVE_ROOT and <JANA/JEventProcessor.h>. Could it be possible to make a code style decision e.g. to use JANA in code (code should not carry the knowledge of the major version number) but e.g. JANA2 in... repository name? JANA2/JANA mixed around confuses and makes one remember where one should use each
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 "2" in "JANA2" needs to be part of the name (as opposed to the major version number) all the time, so that we can make breaking changes without turning it into "JANA3". It was an unambiguous mistake to organize our code as "JANA/JEventProcessor.h" to begin with, when we have identically named JANA1 headers. (For one thing, it prevents us from having system installs of JANA1 and JANA2 side-by-side). If I can't increment the major version number, I can't fix our broken naming conventions, hence I can't increment the major version number.
I agree. This sounds like the better solution to have it in the header. In principle, it allows non-cmake build systems to use the build. (Or at least have an easier time of it.) |
I don't really like the auto-generated header approach. It messes with code analysis tools, often causes more recompiles than needed, etc. Unless JANA2 gets to the scale of ROOT where you need two pages of defines in RConfigure.h to keep track of this, I'd just keep using the compile definitions and attach them to targets as properties. If you do go for the auto-generated header, it would be useful to allow for handling these options in full C++20 model with constexpr and consteval support instead of forcing this through preprocessor defines. |
Some consistency in jana_config.h would be desired anyway, if you do decide to overhaul that.
We are supposed to use |
This is exactly the mess I was referring to :) |