Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Can Eclipse deduce compiler flags in a Makefile/autotools project?
Can Eclipse deduce compiler flags in a Makefile/autotools project? [message #1784739] Tue, 03 April 2018 11:52 Go to next message
Ilya Basin is currently offline Ilya BasinFriend
Messages: 25
Registered: October 2011
Junior Member
Hi.
Is there a feature in Eclipse that would let Eclipse "guess" the compiler flags used by "make" to compiler a certain c/c++ source file during the last build of the active configuration?

This could be implemented by calling make with a substituted the $(SHELL) or $(CC) variables or by parsing the output of make with V=1.
Re: Can Eclipse deduce compiler flags in a Makefile/autotools project? [message #1784745 is a reply to message #1784739] Tue, 03 April 2018 13:33 Go to previous messageGo to next message
David VavraFriend
Messages: 1426
Registered: October 2012
Senior Member
When using autotools, the makefile is generated by automake.
Since Eclipse isn't generating the makefile, why should it need to guess at anything?

Re: Can Eclipse deduce compiler flags in a Makefile/autotools project? [message #1784762 is a reply to message #1784745] Tue, 03 April 2018 17:24 Go to previous messageGo to next message
Ilya Basin is currently offline Ilya BasinFriend
Messages: 25
Registered: October 2011
Junior Member
David, the IDE must know the flags related to the C preprocessor to correctly resolve include paths and macro conditionals.
Re: Can Eclipse deduce compiler flags in a Makefile/autotools project? [message #1784773 is a reply to message #1784762] Tue, 03 April 2018 22:22 Go to previous messageGo to next message
David VavraFriend
Messages: 1426
Registered: October 2012
Senior Member
There is already a provider which will examine the build output.
It's appropriately called the Build Output Parser.
I believe it only works with GCC.
There is also one for Libtool.


It won't give builtin values and requires at least one build.
It will find the ones that are actually in the compile commands.
No guessing needed.









Re: Can Eclipse deduce compiler flags in a Makefile/autotools project? [message #1784825 is a reply to message #1784773] Wed, 04 April 2018 13:38 Go to previous messageGo to next message
Ilya Basin is currently offline Ilya BasinFriend
Messages: 25
Registered: October 2011
Junior Member
Thank you David. I have the libtool gcc builld output parser enabled and it indeed adds the include and define entries to my source files. However, in the C/C++ Editor there's still the marker "Unresolved inclusion: <glib.h>", even though the file properties show the system include directory "/usr/include/glib-2.0" under the build output parser entries.

It seems that in multi-configuration project the editor doesn't take these settings from the active configuration, but instead from the initial configuration, which is called "Build (GNU)".

[Updated on: Wed, 04 April 2018 13:44]

Report message to a moderator

Re: Can Eclipse deduce compiler flags in a Makefile/autotools project? [message #1784841 is a reply to message #1784825] Wed, 04 April 2018 17:31 Go to previous message
Ilya Basin is currently offline Ilya BasinFriend
Messages: 25
Registered: October 2011
Junior Member
Nevermind, found the indexer setting and the 10 years old bug 205299
Previous Topic:Restart Button
Next Topic:Reading USB with C++
Goto Forum:
  


Current Time: Thu Mar 28 19:57:09 GMT 2024

Powered by FUDForum. Page generated in 0.02887 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top