[cmake-developers] Ninja passes all tests on OS X

Nicolas Desprès nicolas.despres at gmail.com
Tue Jul 17 13:31:03 EDT 2012


On Tue, Jul 17, 2012 at 7:21 PM, Peter Kümmel <syntheticpp at gmx.net> wrote:
> On 17.07.2012 19:11, Nicolas Desprès wrote:
>>
>>
>> I don't like the friend keyword either but I try to follow the current
>> architecture of CMake.
>
>
> Yes, I know.
>
>
>> In cmLocalUnixMakefileGenerator you can see that:
>>
>>    friend class cmMakefileTargetGenerator;
>>    friend class cmMakefileExecutableTargetGenerator;
>>    friend class cmMakefileLibraryTargetGenerator;
>>    friend class cmMakefileUtilityTargetGenerator;
>>    friend class cmGlobalUnixMakefileGenerator3;
>>
>> So it does in cmLocalNinjaGenerator.
>>
>> I have an alternate approach to factor this code without using a
>> function object but it is much more complicated. See
>>
>> https://github.com/polrop/CMake/commit/525ec73fa765b7ee55cd89799ba81410da0dab34
>>
>
> OK, maybe it is simpler to add a the functions to cmNinjaTargetGenerator
> which
> forwards the call to the Local/Global classes.
>

I tried that first but this imply the use of function pointer which is
not appropriated with non-static member functions. That's why I have
used a function object.

-Nico



More information about the cmake-developers mailing list