Author Topic: XML based compilers  (Read 331628 times)

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: XML based compilers
« Reply #105 on: August 06, 2012, 01:39:29 pm »
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.

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).
Code
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>

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: XML based compilers
« Reply #106 on: August 06, 2012, 02:03:06 pm »
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.

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.
« Last Edit: August 06, 2012, 02:06:49 pm by oBFusCATed »
(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!]

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9702
Re: XML based compilers
« Reply #107 on: August 06, 2012, 02:16:13 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.

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: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: XML based compilers
« Reply #108 on: August 07, 2012, 05:30:21 am »
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.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9702
Re: XML based compilers
« Reply #109 on: August 07, 2012, 07:36:38 pm »
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: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: XML based compilers
« Reply #110 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.

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

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: XML based compilers
« Reply #111 on: August 09, 2012, 06:00:16 am »
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

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?

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9702
Re: XML based compilers
« Reply #112 on: August 09, 2012, 06:15:21 am »
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: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: XML based compilers
« Reply #113 on: August 10, 2012, 06:57:22 am »
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)?

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: XML based compilers
« Reply #114 on: August 14, 2012, 10:23:54 pm »
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.)

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: XML based compilers
« Reply #115 on: August 14, 2012, 10:31:59 pm »
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!]

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: XML based compilers
« Reply #116 on: August 14, 2012, 10:45:09 pm »
Thanks.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9702
Re: XML based compilers
« Reply #117 on: August 22, 2012, 09:29:51 pm »
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.
« Last Edit: August 22, 2012, 09:33:09 pm by MortenMacFly »
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: XML based compilers
« Reply #118 on: August 23, 2012, 02:49:36 am »
Green light from me :).

(Maybe plus this tiny patch.)
Code
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>

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5513
Re: XML based compilers
« Reply #119 on: August 23, 2012, 07:35:00 am »
ok for the nightly, but let's be sure it works ok if we send out just one nightly.