Reputation: 588
Let's say I build multiple cmake-based projects. I want to build them with a global property always defined.
For example, let's say I want to build always with sccache. For that, for each project, I need to do:
cmake <dir> -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache
I end up writing that a lot, so it'd be useful to avoid it. I know I can create a wrapper for my C compiler that calls into sccache
, and:
export CC=/path/to/sccache/gcc
(for example).
Similarly, I could write a wrapper or shell alias on top of cmake
that just called cmake -D...
.
But I would've expected to be able to do something like:
export CMAKE_CXX_COMPILER_LAUNCHER=sccache
export CMAKE_C_COMPILER_LAUNCHER=sccache
There doesn't seem to be a way to do this. Is there one? I generally don't like to change CC
and CXX
globally because they may cause issues with other build systems or what not.
Upvotes: 1
Views: 441