Makefile project configuration [message #1828232] |
Thu, 04 June 2020 10:20  |
Eclipse User |
|
|
|
Hello,
My use case includes using Eclipse CDT basically as a very fancy text editor with superb indexer.
I have mixed C and C++ Makefile Corss ARM GCC project. I am not using Eclipse's builder, only invoking make.
Please help me configure my workspace. I have read a lot of resources online already.
I have:
1) created "Makefile Project with Existing source" (problem described below also applies to C or C++ projects as well)
2) enabled "CDT Cross GCC Built-in Compiler Settings" provider with following invoke command:
C:\_env\gcc\9-2019-q4-major\bin\arm-none-eabi-g++.exe ${FLAGS} -E -P -v -dD "${INPUTS}"
and it works by filling up settings entries.
The problem is that since it is g++, it adds same entries for both GNU C and GNU C++ languages (.c and .cpp files). That results in C sources having C++ defines (like __cplusplus), which breaks indexer itself.
Also, I once had header file, which had "Syntax error" on extern "C" linkage specification under #ifdef __cplusplus. It was only included in few C source files. When it got included into C++ source file, syntax errors where gone. Note that it is only Eclipse related, it was building successfully before and after.
How should I configure Eclipse properly, to be able to work with mixed C/C++ projects?
|
|
|
|
|
|
|
|
Re: Makefile project configuration [message #1828283 is a reply to message #1828280] |
Fri, 05 June 2020 11:06  |
Eclipse User |
|
|
|
Quote:Is it legit a way to not use MBS at all and only configure "C/C++ General -> Preprocessor Include Paths, Macros etc."? What other side effects it may have?
The Managed Build (assuming that's what you mean by MBS) is really to generate makefiles. The builtin provider borrows from it's toolchain but can be bypassed.
Quote:Is it possible to configure ${COMMAND} without setting a toolchain or other MBS settings?
I've never tried but suspect you can't. It seems to be dynamic.
---
I'm not quite sure what you are getting at with (3).
The Indexer isn't a compiler although it seems to act like one.
It remembers only the last definition of symbols it encounters.
Doing otherwise defeats the purpose of having an Indexer which is to quickly find things.
If you have multiple definitions that are arbitrarily selected for configuration purposes
then you might want to look into having separate projects with one for each configuration.
|
|
|
Powered by
FUDForum. Page generated in 0.03794 seconds