News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

XML based compilers

Started by Alpha, June 15, 2012, 01:00:36 PM

Previous topic - Next topic

Alpha

I am working on a patch to deal with C-only and C++-only flags; when I complete it, actually seeing its results will probably better explain it than I can by writing a description.

Quote from: MortenMacFly on August 06, 2012, 07:09:36 AM
Quote from: Alpha on August 04, 2012, 09:54:56 PM
By the way, am I correct in assuming the revert of this means that a visible note is preferred over a tool tip?
For such important things, yes. Most people don'T wait long enough that the tooltip shows. Also, there are platforms where there is no tooltip. So tooltip should really be a "tip", not to worry about if you don't know it.
In that case, the tip is redundant (this also removes the double separator from the context menu when right-clicking on the name of a project).

Index: src/plugins/compilergcc/compilergcc.cpp
===================================================================
--- src/plugins/compilergcc/compilergcc.cpp (revision 8193)
+++ src/plugins/compilergcc/compilergcc.cpp (working copy)
@@ -563,7 +563,9 @@
     else if (data && data->GetKind() == FileTreeData::ftdkProject)
     {
         // popup menu on a project
-        menu->AppendSeparator();
+        wxMenuItem* itm = menu->FindItemByPosition(menu->GetMenuItemCount() - 1);
+        if (itm && !itm->IsSeparator())
+            menu->AppendSeparator();
         menu->Append(idMenuCompileFromProjectManager, _("Build"));
         menu->Append(idMenuRebuildFromProjectManager, _("Rebuild"));
         menu->Append(idMenuCleanFromProjectManager,   _("Clean"));
Index: src/plugins/compilergcc/resources/compiler_options.xrc
===================================================================
--- src/plugins/compilergcc/resources/compiler_options.xrc (revision 8193)
+++ src/plugins/compilergcc/resources/compiler_options.xrc (working copy)
@@ -150,7 +159,6 @@
</object>
<object class="sizeritem">
<object class="wxCheckListBox" name="lstCompilerOptions">
- <tooltip>Right-click to setup or edit compiler flags</tooltip>
<style>wxLB_HSCROLL</style>
</object>
<flag>wxTOP|wxLEFT|wxRIGHT|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP</flag>
Index: src/plugins/compilergcc/resources/compilers/compiler_clang.xml
===================================================================
--- src/plugins/compilergcc/resources/compilers/compiler_clang.xml (revision 8193)
+++ src/plugins/compilergcc/resources/compilers/compiler_clang.xml (working copy)
@@ -7,6 +7,8 @@
         <Search envVar="PATH"
                 for="C"/>
         <if platform="windows">
+            <Search path="%ProgramFiles%\LLVM"
+                    for="C"/>
             <Fallback path="C:\MinGW"/>
         </if>
         <else>

oBFusCATed

#106
Quote from: MortenMacFly on August 06, 2012, 07:13:08 AM
Why would you do that?
Because it will be easier in the longer period of time. You won't have to worry if the options is C or C++.
Another benefit is that this will bring us one step closer to multy-language/multi-compiler support in a single project.

Quote from: MortenMacFly on August 06, 2012, 07:13:08 AM
MSVC for example is one compiler for all.
In fact MSVC is MSVC++, I doubt there is any support for C provided by Microsoft, and if I remember correctly, they stated that C11 won't be supported by them.

Edit: I'm talking about the options added in "compiler->other options", because  you can't add "-Werror=return-type" in the normal options. So thinking about this again, splitting the compilers in C and C++ ones is the only available option.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

MortenMacFly

Quote from: oBFusCATed on August 06, 2012, 02:03:06 PM
multy-language/multi-compiler support in a single project.
Using different targets and custom build commands we have that already - and I am using it.
But if you believe there is an extra benefit - I won't mind as long as I don't have to open twice as much settings dialogs for a mixed C/C++ project.

Quote from: MortenMacFly on August 06, 2012, 07:13:08 AM
I doubt there is any support for C provided by Microsoft,
Oh dear... I thought the Windows core was still plain C - it seems it isn't... or they are using another compiler for it.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

Alpha

Here is a patch with an initial implementation for the first option I described (it is functional, but has poor API and is not user configurable).  This patch also includes the minor changes from my last post and another logging tweak.

MortenMacFly

Quote from: Alpha on August 07, 2012, 05:30:21 AM
Here is a patch [...]
Giving it a try< leads to tons of errors at startup of C::B, that compiler_options_sort.xml could not be fund. Why? Did I forget to copy / create a file?
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

Alpha

Strange... are you certain that was the name it warned about?  I did add options_common_sort.xml; try running update(.bat) again to see if that fixes it.

(Speaking of which, I forgot to add the file to the .cbp's.)

Alpha

Added/changed:

  • C/C++ - only flag listings can be configured
  • Clarify logging of command failed to execute case
  • Minor logging tweaks (1 second vs. 2 seconds, etc)
  • Tweak GCC auto-detect and compiler flags

Quote from: MortenMacFly on August 07, 2012, 07:36:38 PM
Giving it a try< leads to tons of errors at startup of C::B, that compiler_options_sort.xml could not be fund.
By the way, has this been resolved?

MortenMacFly

Quote from: Alpha on August 07, 2012, 07:54:44 PM
Strange... are you certain that was the name it warned about?  I did add options_common_sort.xml; try running update(.bat) again to see if that fixes it.
Oh - I missed hat post. And yes: That was it I figured it out myself when updating from SVN.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

Alpha

On the compiler toolbar, the label "Build target:" takes up a lot of space, and no other toolbar has any such label.  Does anyone have a reason why this text should not be removed (switched to a tooltip)?

Alpha

This patch makes first run a little more friendly, and removes the static text from the compiler toolbar.

(By the way, I just got a blue screen of death... in safemode.  So I have decided to try Linux again.  When I use Autotools to build Code::Blocks, the resulting executable can be run by clicking on it.  If I use Code::Blocks to build Code::Blocks, the green run button works, however manual execution of Code::Blocks fails due to not finding libcodeblocks.so.  Is there another solution besides the one in the wiki - which does not seem to quite apply to me - that I could try?  I am on Ubuntu.)

oBFusCATed

There is run.sh script which can be used to start c::b
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Alpha


MortenMacFly

#117
BTW: shall we start another wave with nightly now? I think all complaints should be resolved now.

I'll do another merge from trunk... just in case Lieven has some spare time... ;-)

Edit: BTW: I still would prefer to have one one nightly this time - the one of the branch... stated clearly as major improvement / branch version.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

Alpha

Green light from me :).

(Maybe plus this tiny patch.)

Index: src/plugins/compilergcc/compilergcc.cpp
===================================================================
--- src/plugins/compilergcc/compilergcc.cpp (revision 8246)
+++ src/plugins/compilergcc/compilergcc.cpp (working copy)
@@ -2476,7 +2476,7 @@
                 }
                 wxString msg;
                 msg.Printf(_T("\"%s - %s\": The compiler's setup %sis invalid, so Code::Blocks cannot find/run the compiler.\n")
-                           _T("Probably the toolchain path within the compiler options is not setup correctly?!\n")
+                           _T("Probably the toolchain path within the compiler options is not setup correctly?! (Do you have a compiler installed?)\n")
                            _T("Goto \"Settings->Compiler and debugger...->Global compiler settings->%s->Toolchain executables\"")
                            _T(" and fix the compiler's setup.\n")
                            _T("Skipping..."),
Index: src/plugins/compilergcc/resources/compilers/options_gdc.xml
===================================================================
--- src/plugins/compilergcc/resources/compilers/options_gdc.xml (revision 8246)
+++ src/plugins/compilergcc/resources/compilers/options_gdc.xml (working copy)
@@ -81,7 +81,7 @@
         <Option name="allow deprecated features"
                 option="-fdeprecated"/>
         <Option name="compile in debug code"
-                option="-debug"/>
+                option="-fdebug"/>
         <Option name="inline expand functions"
                 option="-finline-functions"/>
         <Option name="compile release version, which means not generating code for contracts and asserts"
Index: src/plugins/compilergcc/resources/compilers/options_common_re.xml
===================================================================
--- src/plugins/compilergcc/resources/compilers/options_common_re.xml (revision 8246)
+++ src/plugins/compilergcc/resources/compilers/options_common_re.xml (working copy)
@@ -203,4 +203,10 @@
            msg="1">
         <![CDATA[([Ii]nfo:[ \t].*)\(auto-import\)]]>
     </RegEx>
+    <RegEx name="Linker warning (different sized sections)"
+           type="warning"
+           msg="2"
+           file="1">
+        <![CDATA[([][{}() \t#%$~[:alnum:]&_:+/\.-]+):[ \t]+(duplicate section.*has different size)]]>
+    </RegEx>
</CodeBlocks_compiler_options>

killerbot

ok for the nightly, but let's be sure it works ok if we send out just one nightly.