@@ -390,63 +390,6 @@ option(SWIFT_ENABLE_EXPERIMENTAL_DIFFERENTIABLE_PROGRAMMING
390
390
# End of user-configurable options.
391
391
#
392
392
393
- # Look for either a program in execute_process()'s path or for a hardcoded path.
394
- # Find a program's version and set it in the parent scope.
395
- # Replace newlines with spaces so it prints on one line.
396
- function (find_version cmd flag find_in_path )
397
- if (find_in_path )
398
- message (STATUS "Finding installed version for: ${cmd} " )
399
- else ()
400
- message (STATUS "Finding version for: ${cmd} " )
401
- endif ()
402
- execute_process (
403
- COMMAND ${cmd} ${flag}
404
- OUTPUT_VARIABLE out
405
- OUTPUT_STRIP_TRAILING_WHITESPACE )
406
- if (NOT out )
407
- if (find_in_path )
408
- message (STATUS "tried to find version for ${cmd} , but ${cmd} not found in path, continuing" )
409
- else ()
410
- message (FATAL_ERROR "tried to find version for ${cmd} , but ${cmd} not found" )
411
- endif ()
412
- else ()
413
- string (REPLACE "\n " " " out2 ${out} )
414
- message (STATUS "Found version: ${out2} " )
415
- endif ()
416
- message (STATUS "" )
417
- endfunction ()
418
-
419
- # Print out path and version of any installed commands.
420
- # We migth be using the wrong version of a command, so record them all.
421
- function (print_versions )
422
- find_version ("${CMAKE_COMMAND} " "--version" TRUE )
423
-
424
- message (STATUS "Finding version for: ${CMAKE_COMMAND} " )
425
- message (STATUS "Found version: ${CMAKE_VERSION} " )
426
- message (STATUS "" )
427
-
428
- get_filename_component (CMAKE_MAKE_PROGRAM_BN "${CMAKE_MAKE_PROGRAM} " NAME_WE )
429
- if (${CMAKE_MAKE_PROGRAM_BN} STREQUAL "ninja" OR
430
- ${CMAKE_MAKE_PROGRAM_BN} STREQUAL "make" )
431
- find_version (${CMAKE_MAKE_PROGRAM_BN} "--version" TRUE )
432
- find_version (${CMAKE_MAKE_PROGRAM} "--version" FALSE )
433
- endif ()
434
-
435
- if (${SWIFT_PATH_TO_CMARK_BUILD} )
436
- find_version ("cmark" "--version" TRUE )
437
- find_version ("${SWIFT_PATH_TO_CMARK_BUILD} /src/cmark" "--version" FALSE )
438
- endif ()
439
-
440
- message (STATUS "Finding version for: ${CMAKE_C_COMPILER} " )
441
- message (STATUS "Found version: ${CMAKE_C_COMPILER_VERSION} " )
442
- message (STATUS "" )
443
-
444
- message (STATUS "Finding version for: ${CMAKE_CXX_COMPILER} " )
445
- message (STATUS "Found version: ${CMAKE_CXX_COMPILER_VERSION} " )
446
- message (STATUS "" )
447
- endfunction ()
448
-
449
-
450
393
set (SWIFT_BUILT_STANDALONE FALSE )
451
394
if ("${CMAKE_SOURCE_DIR} " STREQUAL "${CMAKE_CURRENT_SOURCE_DIR} " )
452
395
set (SWIFT_BUILT_STANDALONE TRUE )
@@ -498,7 +441,21 @@ include(CheckCXXSourceRuns)
498
441
include (CMakeParseArguments )
499
442
include (CMakePushCheckState )
500
443
501
- print_versions ()
444
+ # Print out path and version of any installed commands
445
+ message (STATUS "CMake (${CMAKE_COMMAND} ) Version: ${CMAKE_VERSION} " )
446
+ execute_process (COMMAND ${CMAKE_MAKE_PROGRAM} --version
447
+ OUTPUT_VARIABLE _CMAKE_MAKE_PROGRAM_VERSION
448
+ OUTPUT_STRIP_TRAILING_WHITESPACE )
449
+ message (STATUS "CMake Make Program (${CMAKE_MAKE_PROGRAM} ) Version: ${_CMAKE_MAKE_PROGRAM_VERSION} " )
450
+ message (STATUS "C Compiler (${CMAKE_C_COMPILER} ) Version: ${CMAKE_C_COMPILER_VERSION} " )
451
+ message (STATUS "C++ Compiler (${CMAKE_CXX_COMPILER} ) Version: ${CMAKE_CXX_COMPILER_VERSION} " )
452
+ if (SWIFT_PATH_TO_CMARK_BUILD )
453
+ execute_process (COMMAND ${SWIFT_PATH_TO_CMARK_BUILD} /src/cmark --version
454
+ OUTPUT_VARIABLE _CMARK_VERSION
455
+ OUTPUT_STRIP_TRAILING_WHITESPACE )
456
+ message (STATUS "CMark Version: ${_CMARK_VERSION} " )
457
+ endif ()
458
+ message (STATUS "" )
502
459
503
460
include (SwiftSharedCMakeConfig )
504
461
0 commit comments