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

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers

Reply via email to