← Back to team overview

kicad-developers team mailing list archive

Re: [RFC] pcbnew internals refactoring for testing

 

On 03/11/17 00:52, Wayne Stambaugh wrote:
> Tom,
> 
> I fine with all of this except the boost option change.  Copying the
> boost files into the KiCad source is not really removing boost.  Why not
> just create a simple header that includes the boost option header and
> your OPT() macro.  Wouldn't this work just as well when we transition to
> C++17?  Boost isn't going away any time soon so I see no advantage to
> copying boost code into KiCad.

Hi Wayne,


The goal of this patch is to limit the inclusion of boost headers, which
cause a huge slowdown in compilation time. Including as simple feature
as the optional<> drags in ~3MB (!) of Boost headers through include
dependencies. The implementation I used is not taken from Boost, instead
I took a reference implementation submitted for the C++ standard [1].

I found two main reasons why Kicad takes so long to build:
- boost libs present in pretty much any header file
- wxPoint and wxSize classes (#include <wx/gdicmn.h> which defines
wxPoint drags in ~2.5MB of dependencies on my system).

That's why in the longer run, I'd like to see boost inclusion limited to
.cpp files or a select set of headers and all wxPoints/wxSizes replaced
by VECTOR2<>.

Cheers,
Tom

[1] https://github.com/akrzemi1/Optional


Follow ups

References