Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] Passing build configuration options to a project template via a method.

Hi Petri,

On 17 June 2011 14:24, Petri Tuononen <petri.tuononen@xxxxxxxxx> wrote:
> Ok. I can easily get checked packages and just compute paths again and set
> external settings again. However this leads to a new dilemma at which point
> should the paths be recalculated (without too much overhead).

I think I found the settings are updated when projects are imported
and opened, as well as manually (by me) when the user changes a
setting which has a knock-on on the contributed paths.

The slowness here (in my experience) is the overhead of forking
pkg-config and reading it's output.  For a given set of arguments to
pkg-config I'd memoize the answer behind some soft-references, perhaps
clearing them every 5 mins.   It's unlikely that paths change with any
regularity for a given version of tools on the OS.

> For Windows -mms-bitfields and e.g -pthread for Linux. I guess I can (and
> have to) pass these other way.

Ah, I see.  I think we'll need an additional optional attribute to
pass generic options to various tools.  Perhaps an entry type
tool_type (e.g. compiler) -> additional option (string).  This
shouldn't be too hard to wire up.

> Thanks for this code excerpt. Maybe running the code in thread prevents the
> freezing of property pages and hopefully the problem that prevents showing
> the values in Settings tab in the first place.

Have a go without doing it in a job first. If it's slow we should
profile it and find out where time is going.  For example time your
#getSettings method to see how long it takes for each invocation (as
well as how many times its invoked...).

> Computation time. Although I can only confirm this after the whole
> functionality I plan to do is implemented. The main reason is probably that
> all flags need to be recalculated for every checked package every time
> there's any related chance.

Caching the output from running pkg-config with a given set of
switches should help here.

Cheers,
James


Back to the top