rinladomonari / gamekit

Automatically exported from code.google.com/p/gamekit
0 stars 0 forks source link

Clang is not supported on MAC OS X because of cmake issue. #244

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Run cmake with -DCMAKE_CXX_COMPILER=/usr/bin/clang++ on Mac OS X at least 
10.6
2. Compile.
3. You will get errors building regarding /W0 compiler flags.

What is the expected output? What do you see instead?
It should use -w0.  The problem is that in NoWarn.cmake it checks for G++ and 
otherwise uses the MSVC flag.

I changed it to this.
if (WIN32 AND NOT CMAKE_COMPILER_IS_GNUCXX)
        add_definitions(/W0)
else()
        add_definitions(-w)
endif()

It would probably be better to do

if (MSVC)
        add_definitions(/W0)
else()
        add_definitions(-w)
endif()

since clang and g++ both use roughly the same set of flags, and nothing uses 
MSVC flags as far a I know.

I'm using the trunk.

Original issue reported on code.google.com by david.gu...@gmail.com on 5 Jul 2012 at 3:47

GoogleCodeExporter commented 8 years ago
So, does this change work for you? Can't check it as I have no mac around, but 
it looks logical!

Original comment by thomas.t...@googlemail.com on 5 Jul 2012 at 7:36

GoogleCodeExporter commented 8 years ago
Both versions work for me.  The latter is better, I think.  Tested on 2 
different macs as well.

BTW, we had to switch to clang because we are getting an internal compiler 
error on g++ 4.2 on MacOSX 10.6 with the updated bullet that was committed.

I'll add a bug for that...

Original comment by david.gu...@gmail.com on 5 Jul 2012 at 7:38

GoogleCodeExporter commented 8 years ago
Ok, I patched it with the msvc-version:
http://code.google.com/p/gamekit/source/detail?r=1106

thx for reporting. (I will keep the issue open for a week or so, just in case 
there is a side-effect we didn't see yet :D)

Original comment by thomas.t...@googlemail.com on 5 Jul 2012 at 9:28

GoogleCodeExporter commented 8 years ago
Ok, I close this now...

Original comment by thomas.t...@googlemail.com on 17 Jul 2012 at 4:35