@@ -17,7 +17,7 @@ function(detect_host_compiler)
1717 else ()
1818 message (WARNING "Neither MSVC nor clang found" )
1919 endif ()
20- elseif ( CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux" )
20+ else ( )
2121 find_program (CLANG_C_COMPILER clang)
2222 find_program (CLANG_CXX_COMPILER clang++)
2323 find_program (GNU_C_COMPILER gcc)
@@ -31,8 +31,6 @@ function(detect_host_compiler)
3131 else ()
3232 message (WARNING "Neither clang nor gcc found" )
3333 endif ()
34- else ()
35- message (WARNING "Unsupported host system: ${CMAKE_HOST_SYSTEM_NAME} " )
3634 endif ()
3735endfunction ()
3836
@@ -107,16 +105,7 @@ if (Vulkan_FOUND)
107105 else ()
108106 message (STATUS "Host compiler: ${HOST_C_COMPILER} ${HOST_CXX_COMPILER} " )
109107 endif ()
110- file (WRITE ${CMAKE_BINARY_DIR} /host_toolchain.cmake
111- "set(CMAKE_BUILD_TYPE Release)\n "
112- "set(CMAKE_C_FLAGS -O2)\n "
113- "set(CMAKE_CXX_FLAGS -O2)\n "
114- "set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)\n "
115- "set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY NEVER)\n "
116- "set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE NEVER)\n "
117- "set(CMAKE_C_COMPILER ${HOST_C_COMPILER} )\n "
118- "set(CMAKE_CXX_COMPILER ${HOST_CXX_COMPILER} )\n "
119- )
108+ configure_file (${CMAKE_CURRENT_SOURCE_DIR} /host_toolchain.cmake.in ${CMAKE_BINARY_DIR} /host_toolchain.cmake @ONLY)
120109 set (HOST_CMAKE_TOOLCHAIN_FILE ${CMAKE_BINARY_DIR} /host_toolchain.cmake)
121110 endif ()
122111 message (STATUS "vulkan-shaders-gen toolchain file: ${HOST_CMAKE_TOOLCHAIN_FILE} " )
0 commit comments