If I'm using the clang compiler in CMake, I would like to prepend the option -cc1
to it for every possible invocation (better: only for a certain target)
I tried using
set(CMAKE_CXX_COMPILER "${CMAKE_CXX_COMPILER} -cc1")
But this wraps the invocation in quotes; consequently this doesn't get recognized as a valid command in my shell.
If I use
set(CMAKE_CXX_COMPILER ${CMAKE_CXX_COMPILER} -cc1)
then I get a semicolon between the clang invocation and the -cc1
option. This also doesn't work.
How do I get CMake to change /path/to/clang
into /path/to/clang -cc1
?