[llvm] r316594 - [cmake] Restrict resource file usage to Windows build hosts

Shoaib Meenai via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 25 10:11:28 PDT 2017


Author: smeenai
Date: Wed Oct 25 10:11:28 2017
New Revision: 316594

URL: http://llvm.org/viewvc/llvm-project?rev=316594&view=rev
Log:
[cmake] Restrict resource file usage to Windows build hosts

Resource file compilation requires a working resource compiler.
Unfortunately, llvm-rc isn't quite there yet [1], and cmake's rc
invocation only works on Windows [2]. Until both those issues are
addressed, disable resource file usage on non-Windows build hosts, to
unblock Windows cross-compilation. This is also consistent with the
existing comment, which says "If *on Windows* and building with MSVC".

[1] http://lists.llvm.org/pipermail/llvm-dev/2017-October/118433.html
[2] https://public.kitware.com/pipermail/cmake/2017-October/066441.html

Differential Revision: https://reviews.llvm.org/D39265

Modified:
    llvm/trunk/cmake/modules/AddLLVM.cmake

Modified: llvm/trunk/cmake/modules/AddLLVM.cmake
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/AddLLVM.cmake?rev=316594&r1=316593&r2=316594&view=diff
==============================================================================
--- llvm/trunk/cmake/modules/AddLLVM.cmake (original)
+++ llvm/trunk/cmake/modules/AddLLVM.cmake Wed Oct 25 10:11:28 2017
@@ -263,14 +263,14 @@ endfunction()
 #
 function(add_windows_version_resource_file OUT_VAR)
   set(sources ${ARGN})
-  if (MSVC)
+  if (MSVC AND CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
     set(resource_file ${LLVM_SOURCE_DIR}/resources/windows_version_resource.rc)
     if(EXISTS ${resource_file})
       set(sources ${sources} ${resource_file})
       source_group("Resource Files" ${resource_file})
       set(windows_resource_file ${resource_file} PARENT_SCOPE)
     endif()
-  endif(MSVC)
+  endif(MSVC AND CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
 
   set(${OUT_VAR} ${sources} PARENT_SCOPE)
 endfunction(add_windows_version_resource_file)




More information about the llvm-commits mailing list