User forums > General (but related to Code::Blocks)
View all compiler commands
thomas:
Same command line every time:
--- Code: ---Switching to target: default
mingw32-g++.exe -Os -O -march=i686 -IC:\MinGW\include -IC:\MinGW\include\wx -IC:\MinGW\include\codeblocks -IC:\MinGW\include\wx\msw -c main.cpp -o .objs\main.o
mingw32-g++.exe -LC:\CodeBlocks\lib -LC:\CodeBlocks -LC:\MinGW\lib -o D:\repos\d\console.exe .objs\main.o -luuid -lwsock32 -lole32 -lgdi32 -lkernel32 -luser32
--- End code ---
tiwag:
--- Quote from: thomas on August 04, 2005, 10:51:25 am ---Same command line every time:
--- End quote ---
can you please try to add to "Other options"
--- Code: ----Os
-O1
--- End code ---
after you have removed all compiler switches
1) when i try this after i've removed all switches, it compiles with
--- Code: ---Project : Console application
Compiler : GNU GCC Compiler (called directly)
Directory : D:\cpp\_projects\CodeBlocks\TESTS\
--------------------------------------------------------------------------------
Switching to target: default
mingw32-gcc.exe -c main.c -o .objs\main.o
mingw32-g++.exe -o D:\cpp\_projects\CodeBlocks\TESTS\test_options.exe .objs\main.o
Process terminated with status 0 (0 minutes, 0 seconds)
0 errors, 0 warnings
--- End code ---
2) then i add to "Other optios"
--- Code: ----Os
-O1
--- End code ---
and result is same as above
3) then check within "Compiler Flags"
x Optimize more (for speed)
x Optimize generated code (for size)
and now the two switches -Os and -O1 are got added
--- Code: ---Project : Console application
Compiler : GNU GCC Compiler (called directly)
Directory : D:\cpp\_projects\CodeBlocks\TESTS\
--------------------------------------------------------------------------------
Switching to target: default
mingw32-gcc.exe -Os -O1 -c main.c -o .objs\main.o
mingw32-g++.exe -o D:\cpp\_projects\CodeBlocks\TESTS\test_options.exe .objs\main.o
Process terminated with status 0 (0 minutes, 0 seconds)
0 errors, 0 warnings
--- End code ---
i can't believe that CB behaves in an other way by you,
i checked the code in
--- Code: ---src\plugins\compilergcc\compileroptionsdlg.cpp
void CompilerOptionsDlg::OptionsToText()
--- End code ---
and it didn't change from RC1 to HEAD (3.8.05)
thanks
thomas:
Ah, I think I found the cause.
You wrote your switches line by line:
-Os
-O1
I wrote them like I would do on the commandline:
-Os -O1
(did use -O instead of -O1 the first time, but it matters not, same result).
The line break in between seems insignificant, but that is what makes the difference, the former strips off *everything* whether you enable checkboxes or not, and the latter runs as:
--- Code: ---Switching to target: default
mingw32-g++.exe -Os -O1 -Os -O1 -D__GNUWIN32__ -DWXUSINGDLL -DBUILDING_PLUGIN -IC:\MinGW\include -IC:\MinGW\include\codeblocks -IC:\MinGW\include\wx -IC:\MinGW\include\tinyxml -IC:\MinGW\include\GL -c main.cpp -o .objs\main.o
mingw32-g++.exe -LC:\CodeBlocks -LC:\CodeBlocks\lib -o D:\Desktop\asasaas\console.exe .objs\main.o -s -lcodeblocks -lwxmsw242 -lcodeblocks -lwxmsw242
Process terminated with status 0 (0 minutes, 0 seconds)
0 errors, 0 warnings
--- End code ---
CompilerOptionsDlg::DoGetCompileOptions() in plugins\compilergcc\compileroptionsdlg.cpp does a lot of work to break the textcontrol's contents into a wxArrayString. Does not make sense to me personally, but there is certainly a good reasoning for that (is array.Clear(); intentional?).
If it were me, I would not care to do such an awful lot with manual options, instead I would do something like this:
--- Code: ---compileroptions = DoGetAllCheckBoxOptionsFirst();
tmp = extraOptionsControl->GetValue();
tmp.Replace("\n", " ");
tmp.Replace("\r", " ");
tmp = " " + tmp + " ";
compileroptions.Add(tmp);
--- End code ---
That way, the user could use the checkboxes as he likes and can add anything that supersedes these settings under "additional options". Everything is passed as one single option, but the compiler does not know, anyway :)
tiwag:
--- Quote from: thomas on August 06, 2005, 02:24:43 pm ---Ah, I think I found the cause.
You wrote your switches line by line:
--- Code: ----Os
-O1
--- End code ---
I wrote them like I would do on the commandline:
--- Code: ----Os -O1
--- End code ---
--- End quote ---
btw that's the workaround for what i've looked - thanks 8)
grv575:
Wouldn't that be buggy behavior? The default options under other options for some project targets is stuff like
-fno-exceptions
-Dblah
etc
all one per line. And these seem to work as expected...
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version