build error in kdegraphics

Alexander Neundorf neundorf at kde.org
Mon Jun 7 22:42:59 CEST 2010


On Friday 04 June 2010, Pavel Heimlich, a.k.a. hajma wrote:
> 2010/6/3 Alexander Neundorf <neundorf at kde.org>:
> > On Thursday 03 June 2010, you wrote:
> >> 2010/6/3 Alexander Neundorf <neundorf at kde.org>:
> >> > On Thursday 03 June 2010, Pavel Heimlich, a.k.a. hajma wrote:
> >> >> 2010/6/1 Alexander Neundorf <neundorf at kde.org>:
> >> >> > Can you put something like
> >> >> > #warning "Here I am"
> >> >> > in places where it makes sense in CMakeCXXCompilerId.cpp.in and
> >> >> > then run cmake again in clean build trees (small hello-world like
> >> >> > projects should be good enough for that).
> >> >>
> >> >> Hi, compiling slightly modified CMakeCXXCompilerId.cpp.in
> >> >> (http://tropikhajma.sweb.cz/osol/a.cpp) yields:
> >> >> $ CC a.cpp
> >> >> "a.cpp", line 7: Warning: #warning "CMakeCXXCompilerId.cpp.in:1".
> >> >> "a.cpp", line 22: Warning: #warning "CMakeCXXCompilerId.cpp.in:3".
> >> >> "a.cpp", line 62: Warning: #warning "CMakeCXXCompilerId.cpp.in:7".
> >> >> "a.cpp", line 67: Warning: String literal converted to char* in
> >> >> initialization. "a.cpp", line 68: Warning: #warning
> >> >> "CMakeCXXCompilerId.cpp.in:8". 5 Warning(s) detected.
> >> >> $ ./a.out
> >> >> SunPro
> >> >>
> >> >> HTH
> >> >
> >> > Hmm, this looks good actually.
> >> > Could you please post the compiled a.out file ?
> >>
> >> sure. http://tropikhajma.sweb.cz/osol/a.out
> >
> > Hmm, it has the text it should have, see the attached screenshot. Very
> > strange that cmake doesn't find that...
> >
> >> > Do you also get the "Unknown" CXX compiler id with cmake 2.8.1 ?
>
> yes.
>
> investigating more, I noted that SunPro is detected correctly when we do
> export CXX=CC
> in the spec or build script, but fails when we do
> export CXX="CC -library=no%Cstd -library=Crun -xannotate=no"
>
> It looks like cmake somehow ends up calling
> CC "-library=no%Cstd -library=Crun -xannotate=no"
> the-rest-of-the-flags-here CMakeCXXCompilerId.cpp
> which the Studio does not like:
> $ CC "-library=no%Cstd -library=Crun -xannotate=no" CMakeCXXCompilerId.cpp
> CC: illegal option usage -library=no%Cstd -library=Crun -xannotate=no
> This is the same as observed in the cmake logs below.
>
> Is this behaviour expected?

Yes.
If you want to have "-library=no%Cstd -library=Crun -xannotate=no" as flags 
for the compiler, there are two options:
1) we set them to these values explicitely in FindKDE4Internal.cmake for the 
case that it's the SunPro compiler (we already set flags for other compilers, 
so we can do this here too)
2) you set the environment variable CXXFLAGS 
to "-library=no%Cstd -library=Crun -xannotate=no", this should be picked up 
when running cmake initially in a fresh build dir.

Alex


More information about the Kde-buildsystem mailing list