File tree Expand file tree Collapse file tree 3 files changed +13
-4
lines changed Expand file tree Collapse file tree 3 files changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -41,14 +41,20 @@ endif()
4141
4242if (MSVC )
4343 set (BUILD_COMPILER "${CMAKE_C_COMPILER_ID} ${CMAKE_C_COMPILER_VERSION} " )
44- set (BUILD_TARGET ${CMAKE_VS_PLATFORM_NAME} )
44+ if (CMAKE_VS_PLATFORM_NAME)
45+ set (BUILD_TARGET ${CMAKE_VS_PLATFORM_NAME} )
46+ else ()
47+ set (BUILD_TARGET "${CMAKE_SYSTEM_NAME} ${CMAKE_SYSTEM_PROCESSOR} " )
48+ endif ()
4549else ()
4650 execute_process (
47- COMMAND sh -c " \" $@ \" --version | head -1" _ ${CMAKE_C_COMPILER}
51+ COMMAND ${CMAKE_C_COMPILER} --version
4852 OUTPUT_VARIABLE OUT
4953 OUTPUT_STRIP_TRAILING_WHITESPACE
5054 )
55+ string (REGEX REPLACE " *\n .*" "" OUT "${OUT} " )
5156 set (BUILD_COMPILER ${OUT} )
57+
5258 execute_process (
5359 COMMAND ${CMAKE_C_COMPILER} -dumpmachine
5460 OUTPUT_VARIABLE OUT
Original file line number Diff line number Diff line change @@ -39,7 +39,9 @@ add_custom_command(
3939 COMMENT "Generating build details from Git"
4040 COMMAND ${CMAKE_COMMAND} -DMSVC=${MSVC} -DCMAKE_C_COMPILER_VERSION=${CMAKE_C_COMPILER_VERSION}
4141 -DCMAKE_C_COMPILER_ID=${CMAKE_C_COMPILER_ID} -DCMAKE_VS_PLATFORM_NAME=${CMAKE_VS_PLATFORM_NAME}
42- -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} -P "${CMAKE_CURRENT_SOURCE_DIR} /cmake/build-info-gen-cpp.cmake"
42+ -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
43+ -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME} -DCMAKE_SYSTEM_PROCESSOR=${CMAKE_SYSTEM_PROCESSOR}
44+ -P "${CMAKE_CURRENT_SOURCE_DIR} /cmake/build-info-gen-cpp.cmake"
4345 WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR} /.."
4446 DEPENDS "${CMAKE_CURRENT_SOURCE_DIR} /build-info.cpp.in" ${GIT_INDEX}
4547 VERBATIM
Original file line number Diff line number Diff line change @@ -133,6 +133,7 @@ if (CUDAToolkit_FOUND)
133133 COMMAND ${NVCC_CMD} -Xcompiler "-dumpfullversion -dumpversion"
134134 OUTPUT_VARIABLE CUDA_CCVER
135135 ERROR_QUIET
136+ OUTPUT_STRIP_TRAILING_WHITESPACE
136137 )
137138 else ()
138139 if (CUDA_CCFULLVER MATCHES Apple )
@@ -143,7 +144,7 @@ if (CUDAToolkit_FOUND)
143144 string (REGEX REPLACE "^.* version ([0-9.]*).*$" "\\ 1" CUDA_CCVER ${CUDA_CCFULLVER} )
144145 endif ()
145146
146- message ("-- CUDA host compiler is ${CUDA_CCID} ${CUDA_CCVER} " )
147+ message (STATUS " CUDA host compiler is ${CUDA_CCID} ${CUDA_CCVER} " )
147148
148149 ggml_get_flags(${CUDA_CCID} ${CUDA_CCVER} )
149150 list (APPEND CUDA_CXX_FLAGS ${CXX_FLAGS} ${GF_CXX_FLAGS} ) # This is passed to -Xcompiler later
You can’t perform that action at this time.
0 commit comments