Sysprogs forums › Forums › VisualGDB › Separate CFLAGS and CXXFLAGS with MSBuild
- This topic has 4 replies, 3 voices, and was last updated 7 years ago by UdoEberhardt.
-
AuthorPosts
-
September 26, 2017 at 11:24 #12513bojanpotocnikParticipant
Hello,
I would like to suggest a possibility of separate C++ and C flags configuration or ask how to enable it.
In the VisualGDB Project Properties -> Embedded Project -> Makefiles flags section there are fields for CFLAGS, LDFLAGS, ASFLAGS and Common flags, which are written to the MCU.xml file on save in the associated fields:
<em>CFLAGS</em> input field content
<em>CFLAGS</em> input field content
<em>LDFLAGS</em> input field content
<em>ASFLAGS</em> input field content
<em>Common flags </em>input field content
CXXFLAGS field can be edited here but it is always overwritten with the content of the CFLAGS field. Is there a possibility to add CXXFLAGS input field to the properties with Same as CFLAGS checkbox (enabled by default)?
- This topic was modified 7 years, 1 month ago by bojanpotocnik. Reason: Grammar
September 26, 2017 at 21:43 #12519supportKeymasterHi,
Having 2 separate sets of flags would unfortunately overcomplicate the VS property pages for MSBuild projects, so instead we have the same flags, but automatically filter out options like -fno-exceptions and also allow specifying C/C++ standards separately (use the VS project properties for that).
If you are trying to specify some other option that is only supported on C (or C++) files, let us know and we will add it to the VS property pages for MSBuild projects (unless this is something very rarely used in which case you can simply add a custom target to your project for adding those options similar to RemoveIncompatibleCompilerSwitches).
November 14, 2017 at 21:54 #12993UdoEberhardtParticipantHi,
I do have the same problem and found this thread. I want to use gcc option -fno-use-cxa-atexit which is a very useful one for embedded C++ projects. I added -fno-use-cxa-atexit in project properties under C/C++ – Command Line. The project contains C++ and C files. For C files this option causes a gcc warning:
gcc command line option ‘-fno-use-cxa-atexit’ is valid for c++/objc++ but not for c
which cannot be suppressed with another option.
Is there any chance that you will add this option to the prop page, or filter it out automatically for C files?
My suggestion is to enhance the C/C++ – Command Line dialog to offer separate options for C and C++. Alternatively, you could support some proprietary syntax to support filtering of options specified under Additional Options, for example: $CPPFLAG(-fno-use-cxa-atexit) $CFLAG(-some-useful-option).
Udo
November 17, 2017 at 05:40 #13007supportKeymasterHi,
OK, please try this build: http://sysprogs.com/files/tmp/VisualGDB-5.3.16.1933.msi
We have added new options under C/C++->Advanced:
- Additional Options (C files)
- Additional Options (C++ files)
November 19, 2017 at 16:11 #13015UdoEberhardtParticipantHi,
This works. Thanks for your great support!
Udo
-
AuthorPosts
- You must be logged in to reply to this topic.