Browse Source

Add initial build support for "Bash on Ubuntu on Windows".

Yao Wei Tjong 姚伟忠 9 years ago
parent
commit
47b884bfc9
2 changed files with 6 additions and 1 deletions
  1. 5 0
      CMake/Modules/CheckHost.cmake
  2. 1 1
      CMake/Modules/Urho3D-CMake-common.cmake

+ 5 - 0
CMake/Modules/CheckHost.cmake

@@ -60,4 +60,9 @@ else ()
         endif ()
         set (HAS_LIB64 ${HAS_LIB64} CACHE INTERNAL "Multilib capability")
     endif ()
+    # Test if it is a userspace bash on Windows host system
+    execute_process (COMMAND grep -cq Microsoft /proc/version RESULT_VARIABLE GREP_EXIT_CODE OUTPUT_QUIET ERROR_QUIET)
+    if (GREP_EXIT_CODE EQUAL 0)
+        set (BASH_ON_WINDOWS TRUE)
+    endif ()
 endif ()

+ 1 - 1
CMake/Modules/Urho3D-CMake-common.cmake

@@ -1739,7 +1739,7 @@ macro (install_header_files)
             endif ()
             if (INSTALL_SOURCE MATCHES /$)
                 # Source is a directory
-                if (ARG_USE_FILE_SYMLINK OR ARG_ACCUMULATE)
+                if (ARG_USE_FILE_SYMLINK OR ARG_ACCUMULATE OR BASH_ON_WINDOWS)
                     # Use file symlink for each individual files in the source directory
                     if (IS_SYMLINK ${ARG_DESTINATION} AND NOT CMAKE_HOST_WIN32)
                         execute_process (COMMAND ${CMAKE_COMMAND} -E remove ${ARG_DESTINATION})