Compile with -O0 (optimization off) handicap
Aleix Pol
aleixpol at kde.org
Thu Jun 19 14:07:34 BST 2014
On Thu, Jun 19, 2014 at 12:47 PM, Aleksey Midenkov <midenok at gmail.com>
wrote:
> When I compile kdevplatform, it inserts -g -O2:
>
> cd /home/midenok/src/kde/kdevelop/4.6/kdevplatform/build/sublime &&
> /usr/bin/c++ -DKDE4_CMAKE_TOPLEVEL_DIR_LENGTH=34
> -DKDE_DEFAULT_DEBUG_AREA=9504 -DKDE_DEPRECATED_WARNINGS
> -DMAKE_SUBLIME_LIB -DQT_NO_CAST_TO_ASCII -DQT_NO_STL
> -DQT_USE_FAST_CONCATENATION -DQT_USE_FAST_OPERATOR_PLUS
> -DQURL_NO_CAST_FROM_QSTRING -D_BSD_SOURCE -D_REENTRANT
> -D_XOPEN_SOURCE=500 -g -O0 -DDEBUG -Wnon-virtual-dtor -Wno-long-long
> -Wundef -Wcast-align -Wchar-subscripts -Wall -W -Wpointer-arith
> -Wformat-security -fno-exceptions -DQT_NO_EXCEPTIONS -fno-check-new
> -fno-common -Woverloaded-virtual -fno-threadsafe-statics
> -fvisibility=hidden -Werror=return-type -fvisibility-inlines-hidden -g
> -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline -fPIC ...
>
> Attempt to overwrite via CMAKE_CXX_FLAGS or CMAKE_CXX_FLAGS_DEBUG do
> not have effect because CMAKE_CXX_FLAGS goes before -g -O2 and
> CMAKE_CXX_FLAGS_DEBUG doesn't work at all even with
> CMAKE_BUILD_TYPE:STRING=Debug. :(
>
> From where these -g -O2 go? I can't find them in CMakeCache.txt. There
> are all -O2 in CMakeCache.txt and they are different strings:
>
> CMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG -DQT_NO_DEBUG
> CMAKE_C_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG
>
> So, it's not from CMakeCache.txt.
> _______________________________________________
> KDevelop mailing list
> KDevelop at kde.org
> https://mail.kde.org/mailman/listinfo/kdevelop
>
Maybe this can help you:
http://stackoverflow.com/questions/10085945/cmake-cflags-cxxflags-modification
Good luck!
Aleix
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop/attachments/20140619/bf96b774/attachment.html>
More information about the KDevelop
mailing list