@@ -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
@@ -107,16 +105,7 @@ if (Vulkan_FOUND)
107
105
else ()
108
106
message (STATUS "Host compiler: ${HOST_C_COMPILER} ${HOST_CXX_COMPILER} " )
109
107
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 )
120
109
set (HOST_CMAKE_TOOLCHAIN_FILE ${CMAKE_BINARY_DIR} /host_toolchain.cmake )
121
110
endif ()
122
111
message (STATUS "vulkan-shaders-gen toolchain file: ${HOST_CMAKE_TOOLCHAIN_FILE} " )
0 commit comments