-
Notifications
You must be signed in to change notification settings - Fork 90
[CMake] Build system improvements #357
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
Conversation
…ing to safer target includes and defines
…ludes, and libs did not propagate to projects using libocca. Condensed some extra cmake files to the main project
Codecov Report
@@ Coverage Diff @@
## master #357 +/- ##
==========================================
- Coverage 76.07% 75.83% -0.25%
==========================================
Files 246 241 -5
Lines 17973 18255 +282
==========================================
+ Hits 13673 13843 +170
- Misses 4300 4412 +112
|
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.
Looks good, thanks for adding these changes!
I have 2 questions regarding the OCCA_SOURCE_DIR / OCCA_BUILD_DIR usage below
| if (OCCA_DIR.size() == 0) { | ||
| #ifdef USE_CMAKE | ||
| OCCA_DIR = OCCA_SOURCE_DIR; | ||
| #else |
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.
@dmed256 The behavior here is different for the cmake build. We could add an OCCA_SOURCE_DIR to the compiledDefines for the GNU make system build to align the behavior.
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 use an ifdef like you had before or is this always defined for cmake?
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.
It's definitely always defined fr the cmake build. But I suppose in theory you could use OCCA_SOURCE_DIR define in the other build as well in the case you wanted to move the lib and include locations for some reason. I'll revert back to the original way.
|
Looks good, I'm ready to merge if we want to use USE_CMAKE vs OCCA_BUILD_DIR on the check. Thanks @noelchalmers ! |
…, rather than only in cmake build
|
Ready to go |
|
@noelchalmers Thanks for the PR + making the changes! |
Description
This PR does some clean up of the cmake build system to align more closely with OCCA's standard make build behaviors, as well as keep things like libraries, defines, includes, and flags private to the libocca target to avoid them bleeding out to other projects which include libocca as a dependency.
The new behaviors of the cmake build are:
-DENABLE_CUDA=OFF-DENABLE_EXAMPLES=ONand-DENABLE_TESTS=ON-DENABLE_UTILITY=OFF. This is useful for GPU-less headnodes where invoking the CUDA/HIP/OpenCL runtime can errors in the default make system after runningocca infoocca infocommand is run after making the occa binary, emulating the GNU make system.The majority of these changes in this PR are restricted only to OCCA's cmake files, save for two exceptions: