Changing compiler options

Gilles Caulier caulier.gilles at gmail.com
Tue Oct 30 11:25:56 UTC 2012


Andreas,

My fix, not perfect, but it's work :

http://commits.kde.org/libkdcraw/248c36696eba12be1846e82b4328a0220852deee

Problem is that CMAKE_C_FLAGS is not restored to the previous value.
If i store CMAKE_C_FLAGS in CMAKE_C_FLAGS_OLD for ex, and drop option
and later code, i restore back, it doesn't work. Sound like
CMAKE_C_FLAGS is restored before to use dropped version.

Gilles Caulier

2012/10/30 Gilles Caulier <caulier.gilles at gmail.com>:
> Hi Andreas,
>
> 2012/10/30 Andreas Pakulat <apaku at gmx.de>:
>> Hi,
>>
>> On Tue, Oct 30, 2012 at 10:52 AM, Ben Cooksley <bcooksley at kde.org> wrote:
>>> Hi all,
>>>
>>> Recently build.kde.org ran into some problems with building libkdcraw,
>>> due to CMake using the -std=iso9899:1990 option with GCC.
>>> It seems that this appears to be incompatible with LCMS' use of inline
>>> functions.
>>
>> I don't think CMake does this itself. I can at least not find this
>> anywhere in the platform cmake files that are usually used to setup
>> the default arguments used for compiling something. Are you sure this
>> is not set by the project in question or one of the non-core CMake
>> modules it uses to find its dependencies?
>
> Yes, i'm sure. Code is here :
>
> https://projects.kde.org/projects/kde/kdegraphics/libs/libkdcraw/repository/revisions/master/entry/libraw/CMakeLists.txt#L305
>
> I already traced where  -std=iso9899:1990 option is plug. It come from :
>
> CMAKE_C_FLAGS:  -Wno-long-long -std=iso9899:1990 -Wundef -Wcast-align
> -Werror-implicit-function-declaration -Wchar-subscripts -Wall -W
> -Wpointer-arith -Wwrite-strings -Wformat-security
> -Wmissing-format-attribute -fno-common
>
> Note : The error is due to incompatibility of lcms.h version 1 header
> with iso9899:1990
>
>
>> Not sure how to easily find
>> out which ones are being loaded so you could grep them, maybe the
>> --trace-options for cmake help there.
>>
>>> The build log can be viewed at
>>> http://build.kde.org/view/FAILED/job/libkdcraw_master/38/console
>>> Changing it out for -std=c99 seems to fix this however - how would one
>>> do this with CMake?
>>
>> You could try remove_definitions() but that only works if the flag was
>> added using add_definitions(),
>
> yes. I tried and it doesn't work.
>
> Gilles Caulier


More information about the Kde-buildsystem mailing list