This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, master has been updated
       via  7a92fb7bf675005b7d77dc6fdb157409dace52f9 (commit)
       via  cea253a38bb33beb64c7b36c7c75929453ec8749 (commit)
      from  2beed5a4ef66f415f4efa327a8c479395d262e52 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7a92fb7bf675005b7d77dc6fdb157409dace52f9
commit 7a92fb7bf675005b7d77dc6fdb157409dace52f9
Merge: 2beed5a cea253a
Author:     Kyle Edwards <kyle.edwa...@kitware.com>
AuthorDate: Fri Aug 16 19:37:08 2019 +0000
Commit:     Kitware Robot <kwro...@kitware.com>
CommitDate: Fri Aug 16 15:37:20 2019 -0400

    Merge topic 'clang-llvm-rc'
    
    cea253a38b Clang: Fall back to llvm-rc when rc is unavailable
    
    Acked-by: Kitware Robot <kwro...@kitware.com>
    Acked-by: Ben Boeckel <ben.boec...@kitware.com>
    Merge-request: !3687


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=cea253a38bb33beb64c7b36c7c75929453ec8749
commit cea253a38bb33beb64c7b36c7c75929453ec8749
Author:     Gregory Mitrano <gregory.mitr...@gmail.com>
AuthorDate: Tue Aug 13 00:00:06 2019 -0400
Commit:     Gregory Mitrano <gregory.mitr...@gmail.com>
CommitDate: Wed Aug 14 00:20:39 2019 -0400

    Clang: Fall back to llvm-rc when rc is unavailable
    
    This change modifies how CMAKE_RC_COMPILER is configured to improve
    the out-of-box experience for developers using Clang on Windows.
    The previous behavior was to require the user to explicitly specify
    the resource compiler when CMake was called. The new behavior
    is to automatically attempt to locate the MSVC rc binary and use that
    if it's found. If rc is not available, CMake will now fall back to
    Clang's llvm-rc binary.
    
    With this change in place, trivial C/C++ programs can be generated
    with Ninja and Clang on Windows without running into errors about
    a missing resource compiler.
    
    Fixes: #19318

diff --git a/Modules/Platform/Windows-Clang.cmake 
b/Modules/Platform/Windows-Clang.cmake
index b317da6..728e0b9 100644
--- a/Modules/Platform/Windows-Clang.cmake
+++ b/Modules/Platform/Windows-Clang.cmake
@@ -99,6 +99,21 @@ if("x${CMAKE_C_SIMULATE_ID}" STREQUAL "xMSVC"
             "or clang-cl as both C and C++ compilers.")
   endif()
 
+  if(NOT CMAKE_RC_COMPILER_INIT)
+    # Check if rc is already in the path
+    # This may happen in cases where the user is already in a visual studio 
environment when CMake is invoked
+    find_program(__RC_COMPILER_PATH NAMES rc)
+
+    # Default to rc if it's available, otherwise fall back to llvm-rc
+    if(__RC_COMPILER_PATH)
+      set(CMAKE_RC_COMPILER_INIT rc)
+    else()
+      set(CMAKE_RC_COMPILER_INIT llvm-rc)
+    endif()
+
+    unset(__RC_COMPILER_PATH CACHE)
+  endif()
+
   if ( "x${CMAKE_CXX_COMPILER_FRONTEND_VARIANT}" STREQUAL "xMSVC" OR 
"x${CMAKE_C_COMPILER_FRONTEND_VARIANT}" STREQUAL "xMSVC" )
     include(Platform/Windows-MSVC)
 

-----------------------------------------------------------------------

Summary of changes:
 Modules/Platform/Windows-Clang.cmake | 15 +++++++++++++++
 1 file changed, 15 insertions(+)


hooks/post-receive
-- 
CMake
_______________________________________________
Cmake-commits mailing list
Cmake-commits@cmake.org
https://cmake.org/mailman/listinfo/cmake-commits

Reply via email to