Author Topic: show compiler flags switches in checklistbox text  (Read 18835 times)

Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
show compiler flags switches in checklistbox text
« on: August 04, 2005, 04:35:23 pm »
following the recent discussion in this thread
http://forums.codeblocks.org/index.php/topic,662.0.html

i added code to the sdk/compileroptions.cpp in order to show the compiler option switches
in the checklistbox text   - in the format   "  descriptive text of option   [-switch] "

screenshot


patch: "sdk/compileroptions.cpp"
Code
Index: sdk/compileroptions.cpp
===================================================================
RCS file: /cvsroot/codeblocks/codeblocks/src/sdk/compileroptions.cpp,v
retrieving revision 1.3
diff -u -r1.3 compileroptions.cpp
--- sdk/compileroptions.cpp 19 May 2005 13:16:16 -0000  1.3
+++ sdk/compileroptions.cpp 4 Aug 2005 14:07:25 -0000
@@ -79,7 +79,7 @@
    if (name.IsEmpty() || (option.IsEmpty() && additionalLibs.IsEmpty()))
        return;
    CompOption* coption = new CompOption;
-   coption->name = name;
+   coption->name =  name + "  [" + option + "]";
    coption->option = option;
    coption->additionalLibs = additionalLibs;
    coption->enabled = false;


what are you out there thinking about that ?

Offline kagerato

  • Multiple posting newcomer
  • *
  • Posts: 56
    • kagerato.net
Re: show compiler flags switches in checklistbox text
« Reply #1 on: August 04, 2005, 05:39:34 pm »
That was quick :shock: .

Good job; always good to know what options you're really toggling.

Offline David Perfors

  • Developer
  • Lives here!
  • *****
  • Posts: 560
Re: show compiler flags switches in checklistbox text
« Reply #2 on: August 04, 2005, 05:59:29 pm »
I think it is a good thing to add.
OS: winXP
Compiler: mingw
IDE: Code::Blocks SVN WX: 2.8.4 Wish list: faster code completion, easier debugging, refactoring

takeshimiya

  • Guest
Re: show compiler flags switches in checklistbox text
« Reply #3 on: August 04, 2005, 07:23:44 pm »
This is a must  :)

What happened to "Strip all symbols from binary (minimizes size) []" ?

BTW, don't forget always to put _() or _T() to make unicode friendly =)
« Last Edit: August 04, 2005, 07:25:38 pm by takeshimiya »

Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
Re: show compiler flags switches in checklistbox text
« Reply #4 on: August 04, 2005, 07:51:41 pm »
What happened to "Strip all symbols from binary (minimizes size) []" ?
This one would need an extra treatment for Linker-options - but i don't know if this is universal for all compilers - so i didn't implement Linker-options for now.

BTW, don't forget always to put _() or _T() to make unicode friendly =)
8)

Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
Re: show compiler flags switches in checklistbox text
« Reply #5 on: August 04, 2005, 08:27:27 pm »
you can use this patch, which shows compileroptions if available - otherwise linkeroptions in the [].

sdk/compileroptions.cpp patch
Code
Index: src/sdk/compileroptions.cpp
===================================================================
RCS file: /cvsroot/codeblocks/codeblocks/src/sdk/compileroptions.cpp,v
retrieving revision 1.3
diff -u -r1.3 compileroptions.cpp
--- src/sdk/compileroptions.cpp 19 May 2005 13:16:16 -0000  1.3
+++ src/sdk/compileroptions.cpp 4 Aug 2005 18:18:46 -0000
@@ -79,7 +79,15 @@
    if (name.IsEmpty() || (option.IsEmpty() && additionalLibs.IsEmpty()))
        return;
    CompOption* coption = new CompOption;
-   coption->name = name;
+   
+   wxString listboxname = name +wxT("  [");
+   if (option.IsEmpty())
+        listboxname += additionalLibs;
+    else
+        listboxname += option;
+    listboxname += wxT("]");
+
+   coption->name = listboxname;
    coption->option = option;
    coption->additionalLibs = additionalLibs;
    coption->enabled = false;

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: show compiler flags switches in checklistbox text
« Reply #6 on: August 04, 2005, 08:36:52 pm »
tiwag: How about this: (it may be a little more complicated)

Why not make the list have columns like the compiler messages? The first
column would be the checkbox, the second would be the flag, and the third would
be the description :)

Can you do it?

Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
Re: show compiler flags switches in checklistbox text
« Reply #7 on: August 04, 2005, 08:45:50 pm »
tiwag: How about this: (it may be a little more complicated)

Why not make the list have columns like the compiler messages? The first
column would be the checkbox, the second would be the flag, and the third would
be the description :)

Can you do it?

Hi rick ! good suggestion
my first attempt to improve this dialog was also to show   1.) checkbox  2.) switch  3.) descriptive text

but it looks ugly, because some switches are really long, like [-pedantic-error]  or [-Wfatal-errors] and
almost all of the processor spefic switches like [-march=pentium-mmx]
and others are totally short [-s] [-g] and so on

hence i decided, it looks much better to append the [switch] after the descriptive text as it is now.