On 08/03/2016 03:22 PM, Chaoren Lin wrote: >> It will take some investigation to decide how/whether to set SIMULATE_ID >> to GNU. > > This seems like the right thing to do, and is more future proof than the > alternative.
This patch may do it. ```patch diff --git a/Modules/Compiler/Clang-DetermineCompilerInternal.cmake b/Modules/Compiler/Clang-DetermineCompilerInternal.cmake index 08c1230..a8ef61b 100644 --- a/Modules/Compiler/Clang-DetermineCompilerInternal.cmake +++ b/Modules/Compiler/Clang-DetermineCompilerInternal.cmake @@ -12,4 +12,6 @@ set(_compiler_id_version_compute " set(_compiler_id_simulate " # if defined(_MSC_VER) # define @PREFIX@SIMULATE_ID \"MSVC\" +# elif defined(__GNUC__) +# define @PREFIX@SIMULATE_ID \"GNU\" # endif") ``` However, I remember now why we didn't do this before. For MSVC, Clang actually tries to look a lot like `cl`. It defines _MSC_VER to a version matching the compiler's standard library. OTOH for GNU, Clang is not trying to look like a specific version. It always defines __GNUC__ to 4 and __GNUC_MINOR__ to 2, regardless of what standard library is used. Essentially Clang is acting as a standalone compiler that happens to use a GNU standard library as an implementation detail. Therefore I've decided to go with the direct approach. Please try out this change: Ninja: Fix response file format for GNU-like Clang on Windows https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e555480c Thanks, -Brad -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake-developers