On 08/05/2013 09:26 AM, Stephen Kelly wrote: > Brad King wrote: >> We need to fix this somehow or CMAKE_*_COMPILER_VERSION will be >> useless for Clang. Sean, is there any way to extract the underlying >> Clang version, perhaps with different preprocessor macros? We at >> least need to be able to detect which version scheme is in use so >> we can report it somehow.
According to https://developer.apple.com/library/mac/#documentation/porting/conceptual/portingunix/compiling/compiling.html and local testing we can use __APPLE_CC__ to detect Apple compiler builds. > This might lead to a solution: > > https://github.com/mozilla/rust/issues/6419 That shows a difference in the version string reported from the compiler but AFAICT there is no way to determine the "based on" version from the preprocessor. Also any preprocessor tests in C/C++ code that use __clang_major__ for anything will get incorrect results. It would have to be first conditioned on __APPLE_CC__ to know how to interpret the version number. We could consider treating this as a separate compiler and using a new compiler id like ClangApple or AppleClang or something. -Brad -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers