Skip to content

Commit dc0ab28

Browse files
authored
Merge pull request swiftlang#40870 from cbjeukendrup/fix_cmake_xcodebuild_--version
Fix printing Xcode version from CMake when building with Xcode
2 parents bdce80f + 4bef153 commit dc0ab28

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

CMakeLists.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,12 @@ include(CMakePushCheckState)
529529

530530
# Print out path and version of any installed commands
531531
message(STATUS "CMake (${CMAKE_COMMAND}) Version: ${CMAKE_VERSION}")
532-
execute_process(COMMAND ${CMAKE_MAKE_PROGRAM} --version
532+
if(XCODE)
533+
set(version_flag -version)
534+
else()
535+
set(version_flag --version)
536+
endif()
537+
execute_process(COMMAND ${CMAKE_MAKE_PROGRAM} ${version_flag}
533538
OUTPUT_VARIABLE _CMAKE_MAKE_PROGRAM_VERSION
534539
OUTPUT_STRIP_TRAILING_WHITESPACE)
535540
message(STATUS "CMake Make Program (${CMAKE_MAKE_PROGRAM}) Version: ${_CMAKE_MAKE_PROGRAM_VERSION}")

0 commit comments

Comments
 (0)