Replies: 3 comments
-
Why not use
I don't see a reason why the built system should handle the usage of ccache at all. Of course you can also use the |
Beta Was this translation helpful? Give feedback.
-
If I would need to guess, I'd say the reason CMake is involved, is convenience. You want to give new developers / users the chance to use ccache, but not enforce it. For experienced ccache users like you, of course you can use the manual injection-from-the-outside method. To my knowledge, the whole reason cmake implemented these In the end I don't want to discuss WHY it is there, but HOW. Thanks for pointing out yet another option. As for your question, you can also seed this variable from an environment variable, without support of the cmake script. Again, it's convenience why you let cmake look for ccache automatically and enable it when found. |
Beta Was this translation helpful? Give feedback.
-
But you can use |
Beta Was this translation helpful? Give feedback.
-
In spirit of this stackoverflow question, I want to raise awareness about how Ccache is activated in openvdb:
There seem to be two approaches, with only a slight tendency to the second one (CMAKE_*_COMPILER_LAUNCHER).
You can select it per language, leave users the freedom to overwrite it with ENV variables and change it per directory + target.
This book also recommends the second one.
If you have a parent project using this second approach, for some reason you end up with nested
ccache ccache
calls (which fail).My current workaround is to
set(USE_CCACHE OFF)
for openvdb to avoid the recursive calls. But it would be cleaner to have openvdb also use the compatible approach. I can prepare a PR after a discussion, but it should be only changing:openvdb/CMakeLists.txt
Lines 404 to 405 in 5ecc250
Beta Was this translation helpful? Give feedback.
All reactions