[cmake-developers] linked-usage-cleanup regressed automoc

Brad King brad.king at kitware.com
Tue Mar 12 17:45:53 EDT 2013


On 03/11/2013 06:54 PM, Stephen Kelly wrote:
> Alexander Neundorf wrote:
>> Unfortunately this patch creates bug (
>> http://public.kitware.com/Bug/view.php?id=13999 ) and doesn't fix the
>> actual problem, the crash is still there.
>>
>> Before this patch, void cmQtAutomoc::SetupAutomocTarget(cmTarget* target)
>> returned early if no Qt was present, and nothing bad happened in this
>> case.
> 
> I think the better solution is to return early from InitializeMocSourceFile 
> in that case. I implemented that as the fix-automoc-no-qt branch.

Yes, that preserves the GetIncludeDirectories part mentioned in the
original commit 79568f95.

The original use case in this thread has a header-only target whose
C++ linker language comes from the automoc source.  This preserves
that functionality too.

> Yes, the problem is that CMake errors at generate-time do not actually 
> abort. All bets are off after hitting an error like that. Some if() { 
> return; } code could be added, but I don't think that would improve the 
> situation. It could just be delaying the occurance of another segfault.
> 
> Can something be done about generate-time errors instead?

Lots of generation APIs exit early and tolerate missing info.
Without C++ exceptions and proper RAII we will not be able to
have a general solution.

Every use of GetLinkInformation should return early if it is NULL.
See the patches linked in my previous response to this thread.

I've rebased Alex's AutomocFixWithoutQt topic on those changes
for reference.  However, your fix-automoc-no-qt is the correct
solution IMO.  I've rebased that too and merged to next.

Thanks,
-Brad



More information about the cmake-developers mailing list