I'm working with a third-party-modified version of clang 7.0.0 that has hijacked the -c option, replacing it with a flag -ccdsp for... reasons...
This has created two problems for CMake:
The
-ccdspoption seems to be required to be the very first option toclang, before anything else, including-D...and-I...parameters. There is aBEFOREmodifier fortarget_compile_optionsthat I can use to make sure it appears at the start of the option list, but I don't seem to have any control over the ordering of non-options like definitions and include-paths, which results in-ccdspoccurring later in the overall set of parameters. I haven't been able to find a way to ensure that this is the very first option using modern CMake methods. Instead I have had to resort to settingCMAKE_CXX_FLAGSexplicitly.Now that the
-coption to specify a source file is no longer available, I need to find a way to get CMake to omit it. It turns out that, as far as I can tell, this flag isn't really required, asclang -c foo.cpp -o foo.oandclang foo.cpp -o foo.oappear to do much the same thing. So I need a way to get CMake to drop the-coption.
I realise that this is an unusual question and it's a situation entirely created by the organisation that provided the modified version of clang. Unfortunately my support requests to them remain (to date) unanswered.
Does anyone know of a way I can work around this issue? Can I create a custom compiler handler in CMake, based on clang, where I add -ccdsp and remove -c somehow?