Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] Configuring a Makefile project to use C++11

Hi Nathan,
The language dialect flag in Tool Settings enables "-std=c++98", "-std=c++0x" or "-std=c++1y". That flag gets passed to compiler during managed build and also gets passed to GCC Built-in Compiler Settings provider. Built-in Compiler Settings provider runs gcc with special options and captures include paths and macro definitions for the given dialect. As far as I know these includes and macros define whether this is C++03 or C++11 for indexer.

In order to provide these settings for makefile project it would be necessary to parse the build output with build output parser and then trigger running of Built-in Compiler Settings provider with appropriate -std= option. Since we support different set of includes/macros for different files and the same build could compile files with different options it might be necessary to run Built-in Compiler Settings provider with different options for different files.

Thanks,
Andrew

On Sun, Mar 15, 2015 at 10:57 PM, Nathan Ridge <zeratul976@xxxxxxxxxxx> wrote:
Hi,

I'm wondering what is the correct mechanism to configure a Makefile project to be parsed as C++11.

Specifically, I'd like the indexer to parse the C++11 portions of standard library headers.

In CDT 8.3, a mechanism was added for specifying the language standard in Tool Settings [1], but I recently realized [2] that it does not apply to Makefile projects.

It occurred to me that perhaps the intention for Makefile projects was to have the build output parser pick up the '-std=c++11' flag from the build output, but I tested this and it does not work - after building with the '-std=c++11' flag appearing in the build output and reindexing, headers are still parsed as C++03.

The only way I've found to get headers to be parsed as C++11 for a Makefile project is to manually add '-std=c++11' to the "Command to get compiler specs" of the CDT GCC Built-in Compiler Settings provider.

Is this the intended way? If so, can we give users a better way?

Thanks,
Nate

[1] https://wiki.eclipse.org/CDT/User/NewIn83#Build
[2] https://bugs.eclipse.org/bugs/show_bug.cgi?id=449542#c5

_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/cdt-dev


Back to the top