@@ -17,7 +17,7 @@ function(detect_host_compiler)
17
17
else ()
18
18
message (WARNING "Neither MSVC nor clang found" )
19
19
endif ()
20
- elseif ( CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux" )
20
+ else ( )
21
21
find_program (CLANG_C_COMPILER clang )
22
22
find_program (CLANG_CXX_COMPILER clang++ )
23
23
find_program (GNU_C_COMPILER gcc )
@@ -31,8 +31,6 @@ function(detect_host_compiler)
31
31
else ()
32
32
message (WARNING "Neither clang nor gcc found" )
33
33
endif ()
34
- else ()
35
- message (WARNING "Unsupported host system: ${CMAKE_HOST_SYSTEM_NAME} " )
36
34
endif ()
37
35
endfunction ()
38
36
@@ -93,16 +91,7 @@ if (Vulkan_FOUND)
93
91
else ()
94
92
message (STATUS "Host compiler: ${HOST_C_COMPILER} ${HOST_CXX_COMPILER} " )
95
93
endif ()
96
- file (WRITE ${CMAKE_BINARY_DIR} /host_toolchain.cmake
97
- "set(CMAKE_BUILD_TYPE Release)\n "
98
- "set(CMAKE_C_FLAGS -O2)\n "
99
- "set(CMAKE_CXX_FLAGS -O2)\n "
100
- "set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)\n "
101
- "set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY NEVER)\n "
102
- "set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE NEVER)\n "
103
- "set(CMAKE_C_COMPILER ${HOST_C_COMPILER} )\n "
104
- "set(CMAKE_CXX_COMPILER ${HOST_CXX_COMPILER} )\n "
105
- )
94
+ configure_file (${CMAKE_CURRENT_SOURCE_DIR} /host_toolchain.cmake.in ${CMAKE_BINARY_DIR} /host_toolchain.cmake @ONLY )
106
95
set (HOST_CMAKE_TOOLCHAIN_FILE ${CMAKE_BINARY_DIR} /host_toolchain.cmake )
107
96
endif ()
108
97
message (STATUS "vulkan-shaders-gen toolchain file: ${HOST_CMAKE_TOOLCHAIN_FILE} " )
0 commit comments