[cmake-developers] CMake daemon-mode
Brad King
brad.king at kitware.com
Tue Jun 7 09:21:57 EDT 2016
On 06/07/2016 09:07 AM, Tobias Hunger wrote:
>> We should be able to refactor things to share the flags computation.
>> Methods like
>>
>> cmLocalGenerator::GetTargetFlags
>> cmLocalGenerator::GetIncludeDirectories
>>
>> are meant to be used across multiple generators.
>
> So is that the complete picture?
No, just a starting point.
Note that we have no API to get all the flags for a source because
all the generators collect target-wide and per-source flags separately.
They are not combined until the native build tool constructs the final
command line. The implementation of CMAKE_EXPORT_COMPILE_COMMANDS may
already have some code to combine flags within CMake directly though.
> You can override compile time flags on a per-file basis, based on the
> code I ran across in the ninja generator:-) Do I still need to add
> those per-source-file flags somehow?
Yes. It looks like each generator currently does its own call to
source->GetProperty("COMPILE_FLAGS")
to get the per-source flags. The daemon would have to do something
similar, possibly by factoring the logic out of the generators into
a common helper.
-Brad
More information about the cmake-developers
mailing list