cmake/Tests/BootstrapTest.cmake

19 lines
505 B
CMake
Raw Normal View History

2014-08-03 19:52:23 +02:00
file(MAKE_DIRECTORY "${bin_dir}")
2017-04-14 19:02:05 +02:00
include(ProcessorCount)
ProcessorCount(nproc)
2021-09-14 00:13:48 +02:00
if(generator MATCHES "Ninja")
set(ninja_arg --generator=Ninja)
endif()
2017-04-14 19:02:05 +02:00
if(NOT nproc EQUAL 0)
set(parallel_arg --parallel=${nproc})
endif()
2021-09-14 00:13:48 +02:00
message(STATUS "running bootstrap: ${bootstrap} ${ninja_arg} ${parallel_arg}")
2014-08-03 19:52:23 +02:00
execute_process(
2021-09-14 00:13:48 +02:00
COMMAND ${bootstrap} ${ninja_arg} ${parallel_arg}
2014-08-03 19:52:23 +02:00
WORKING_DIRECTORY "${bin_dir}"
RESULT_VARIABLE result
)
if(result)
message(FATAL_ERROR "bootstrap failed: ${result}")
endif()