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.

On 06/17/2011 10:44 PM, James Blackburn wrote:
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.
Seems like starting/restarting workspace will also trigger CExternalSettingProvider#getSettings. At least on my debug trials.
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...).

It just happens that in my case the tool's options only appear when running the code in a thread. I can't explain why this happens. However library files and paths won't appear at all. Not even if passing the library array alone in CExternalSetting, The debug shows ICLanguageSettingEntry array correctly with [libraryFile], [libraryPath] annotations. Sometimes consecutive package checks won't work (nothing gets added to tool's options).
Well seems like more trial and error testing is needed here.
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
_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev



Back to the top