← Back to team overview

kicad-developers team mailing list archive

Re: [PATCH] Build fixes: bitmaps and polygon

 

Le 31/01/2019 à 17:27, John Beard a écrit :
> Hmm,
> 
> Perhaps this:
> 
> target_include_directories( pcbnew_kiface_objects PRIVATE
>    $<TARGET_PROPERTY:common,INCLUDE_DIRECTORIES>
> )
> 
> This gives the desired effect of providing the transitive include
> dirs, but doesn't require the recent CMake ability to link OBJECT
> libraries.

Unfortunately, does not work.

> 
> If every target specifies the correct libraries, we can also
> eventually avoid the sledgehammer approach of "${INC_BEFORE}" and
> "${INC_AFTER}".
> 
> Cheers,
> 
> John
> 
> On Thu, Jan 31, 2019 at 3:52 PM jp charras <jp.charras@xxxxxxxxxx> wrote:
>>
>> Le 31/01/2019 à 16:29, Wayne Stambaugh a écrit :
>>> JP,
>>>
>>> On 1/31/2019 10:11 AM, jp charras wrote:
>>>> Le 31/01/2019 à 15:40, John Beard a écrit :
>>>>> Hi,
>>>>>
>>>>> Two patches for building these libs:
>>>>>
>>>>> 1) Make bitmaps a "Proper" library. By splitting it off like this, the
>>>>> includes for each of the hundreds of XPM cpp files do not need to suck
>>>>> in WX headers. This speeds compilation by something like 10x or more
>>>>> (it now builds in <5 seconds with -j6), with a similar reduction in
>>>>> the size of libbitmaps.a. Also, making it a proper library allows to
>>>>> use the CMake dependency mechanism better.
>>>>> 2) Do the same for the CMake of the polygon libraries, again
>>>>> simplifying all the "downstream" targets - they no longer need to
>>>>> manually specify the linkage to polygon or the include dirs.
>>>>>
>>>>> Apparently, both these libraries were setting off static analysers, as
>>>>> they were a circular dependency. For example, bitmaps required common
>>>>> for the defs, but common required bitmaps for the images. This ended
>>>>> up pushing all the linkage down to the final executables, which is now
>>>>> much simpler (just link common, and you should get what you need, with
>>>>> includes set correctly).
>>>>>
>>>>> Jenkins passes (MSVC and Msys2), but might be worth getting an OSX
>>>>> build as there is a different CMake command in there!
>>>>>
>>>>> Cheers,
>>>>>
>>>>> John
>>>>
>>>> Hi John,
>>>>
>>>> I have this cmake error when trying to build Kicad with these patches:
>>>>
>>>> "CMake Error at pcbnew/CMakeLists.txt:645 (target_link_libraries):
>>>>   Object library target "pcbnew_kiface_objects" may not link to anything."
>>>>
>>>> (cmake version 3.7.2, W7 32bits, msys2)
>>>>
>>>>
>>>
>>> I didn't have any problem creating a 32 bit build using msys2.  It maybe
>>> your CMake version.  I'm using CMake 3.12.4.  I also did a clean build
>>> so that could the issue.  This change works pretty well so I hope it's
>>> not a CMake version issue.  I don't want to bump the CMake version if we
>>> don't have to.
>>>
>>> Cheers,
>>>
>>> Wayne
>>
>> I just tested with a more recent msys2 version (using cmake 3.11) on a
>> clean build, but no success.
>>
>>
>> --
>> Jean-Pierre CHARRAS


-- 
Jean-Pierre CHARRAS


Follow ups

References