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()
41
41
42
42
if (MSVC )
43
43
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 ()
45
49
else ()
46
50
execute_process (
47
- COMMAND sh -c " \" $@ \" --version | head -1" _ ${CMAKE_C_COMPILER}
51
+ COMMAND ${CMAKE_C_COMPILER} --version
48
52
OUTPUT_VARIABLE OUT
49
53
OUTPUT_STRIP_TRAILING_WHITESPACE
50
54
)
55
+ string (REGEX REPLACE " *\n .*" "" OUT "${OUT} " )
51
56
set (BUILD_COMPILER ${OUT} )
57
+
52
58
execute_process (
53
59
COMMAND ${CMAKE_C_COMPILER} -dumpmachine
54
60
OUTPUT_VARIABLE OUT
Original file line number Diff line number Diff line change @@ -39,7 +39,9 @@ add_custom_command(
39
39
COMMENT "Generating build details from Git"
40
40
COMMAND ${CMAKE_COMMAND} -DMSVC=${MSVC} -DCMAKE_C_COMPILER_VERSION=${CMAKE_C_COMPILER_VERSION}
41
41
-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"
43
45
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR} /.."
44
46
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR} /build-info.cpp.in" ${GIT_INDEX}
45
47
VERBATIM
Original file line number Diff line number Diff line change @@ -133,6 +133,7 @@ if (CUDAToolkit_FOUND)
133
133
COMMAND ${NVCC_CMD} -Xcompiler "-dumpfullversion -dumpversion"
134
134
OUTPUT_VARIABLE CUDA_CCVER
135
135
ERROR_QUIET
136
+ OUTPUT_STRIP_TRAILING_WHITESPACE
136
137
)
137
138
else ()
138
139
if (CUDA_CCFULLVER MATCHES Apple )
@@ -143,7 +144,7 @@ if (CUDAToolkit_FOUND)
143
144
string (REGEX REPLACE "^.* version ([0-9.]*).*$" "\\ 1" CUDA_CCVER ${CUDA_CCFULLVER} )
144
145
endif ()
145
146
146
- message ("-- CUDA host compiler is ${CUDA_CCID} ${CUDA_CCVER} " )
147
+ message (STATUS " CUDA host compiler is ${CUDA_CCID} ${CUDA_CCVER} " )
147
148
148
149
ggml_get_flags (${CUDA_CCID} ${CUDA_CCVER} )
149
150
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