[Qt-creator] optimization and file size between versions
Ziller Eike
Eike.Ziller at digia.com
Tue Oct 1 14:48:15 CEST 2013
On 30.09.2013, at 17:44, Duane <duane.hebert at group-upc.com> wrote:
> On 9/30/2013 3:14 AM, Ziller Eike wrote:
>>
>> On 29.09.2013, at 16:22, Oleksii Serdiuk <contacts at oleksii.name> wrote:
>>
>>> Hello Dane,
>>>
>>> Do you build Qt yourself? Prebuilt Qt binaries always default to release build (CONFIG+=release), unless you pass CONFIG+=debug to qmake. However, when you build Qt yourself, depending on configure options you specify, it can default to debug build (CONFIG+=debug) and you have to specify CONFIG+=release explicitly if you want to build in release mode. AFAIK, Qt Creator assumes that Qt defaults to release build so it doesn't explicitly pass CONFIG+=release to qmake.
>>
>> Qt Creator actually looks into what you Qt does by default, and then only passes CONFIG+=release or CONFIG+=debug if needed.
>> The most reliable way to find out if you do a release or debug build is to look for -g options on your gcc command lines.
>>
>>>>>> […]
>>>>>> Try adding "QT=" to your project.
>>>>>>
>>>>>
>>>>>
>>>>> Didn't help. One thing that I do notice is that I don't see +=Release
>>>>> in the build string:
>>>>>
>>>>> 10:04:08: Starting: "/usr/bin/qmake-qt4"
>>>>> /home/duane/QtSDK/PT500Projects/visu32/visu32.pro -r -spec linux-g++
>>>>> 10:04:08: The process "/usr/bin/qmake-qt4" exited normally.
>>>>> 10:04:09: Starting: "/usr/bin/make"
>>>>> g++ -c -pipe -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2
>>
>> You have -O2 -g here, so "optimized with debug info" which is something that I think Qt normally doesn't do. Did you manually override compiler flags, or touch the mkspecs?
>> The presence or absence of -O flags can also result in different code size, though I'd guess not in the magnitude that you experience?
>>
>
> Hmmm. No, I haven't messed with the make specs and I don't think I've
> changed any compiler flags. I just built a new 4.8.1 and switched to
> that and I don't have any problems. The resulting files on 12 of my
> projects match what my colleague's results are. There must be something
> in the build of the 4.8.4 and 5.2 versions.
>
> My build output with the 4.8.1 version is now:
>
> g++ -c -pipe -O2 -Wall -W -Wno-write-strings -Wno-unused-parameter
> -Wno-unused-variable -DBPP32 -DPT470BUILD
> -I/usr/local/Trolltech/Qt-4.8.1/mkspecs/linux-g++ -I.
> -I../../../SVN_Repos/PT470Development/src/include
> -I../../../SVN_Repos/PT470Development/OpenGUI/src
> -I../../../SVN_Repos/PT470Development/OpenGUI/src -o main.o
> ../../../SVN_Repos/PT470Development/src/visu32/main.cpp
>
> no -g
>
> So maybe it was using debug. But shouldn't that be enabled/disabled
> from the debug/release switch in the ide?
The debug/release switch tells qmake CONFIG+=release or CONFIG+=debug. What qmake does with that is qmake's business.
++ Eike
> <snip>
>
> _______________________________________________
> Qt-creator mailing list
> Qt-creator at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/qt-creator
--
Eike Ziller, Senior Software Engineer - Digia, Qt
Digia Germany GmbH, Rudower Chaussee 13, D-12489 Berlin
Geschäftsführer: Mika Pälsi, Juha Varelius, Anja Wasenius
Sitz der Gesellschaft: Berlin, Registergericht: Amtsgericht Charlottenburg, HRB 144331 B
More information about the Qt-creator
mailing list