1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-11-22 10:22:52 +01:00

ctest+ci: enable parallel building

This commit is contained in:
Anonymous Maarten 2018-08-29 15:52:59 +02:00
parent 56bd77af4e
commit 564f6efeb5
4 changed files with 11 additions and 0 deletions

View File

@ -39,6 +39,7 @@ set(_ARGS_ONEVAL
set(_ARGS_MULVAL set(_ARGS_MULVAL
CONFIGURE_EXTRA_OPTIONS CONFIGURE_EXTRA_OPTIONS
BUILD_EXTRA_FLAGS
) )
foreach(_ARG ${_ARGS_BOOL} ${_ARGS_ONEVAL} ${_ARGS_MULVAL}) foreach(_ARG ${_ARGS_BOOL} ${_ARGS_ONEVAL} ${_ARGS_MULVAL})
@ -186,6 +187,7 @@ ctest_configure(
message(STATUS "Building...") message(STATUS "Building...")
ctest_build( ctest_build(
CONFIGURATION "${_CTEST_BUILD_CONFIGURATION}" CONFIGURATION "${_CTEST_BUILD_CONFIGURATION}"
FLAGS ${BUILD_EXTRA_FLAGS}
NUMBER_ERRORS _NB_BUILD_ERRORS NUMBER_ERRORS _NB_BUILD_ERRORS
) )

View File

@ -5,6 +5,7 @@ else()
set(DEBUG FALSE) set(DEBUG FALSE)
endif() endif()
set(CONFIGURE_EXTRA_OPTIONS ";") set(CONFIGURE_EXTRA_OPTIONS ";")
set(BUILD_EXTRA_FLAGS "")
set(BUILD_TOOLS TRUE) set(BUILD_TOOLS TRUE)
set(BUILD_VIEWER TRUE) set(BUILD_VIEWER TRUE)
set(COVERAGE_COMMAND gcov) set(COVERAGE_COMMAND gcov)

View File

@ -5,6 +5,13 @@ else()
set(DEBUG FALSE) set(DEBUG FALSE)
endif() endif()
set(CONFIGURE_EXTRA_OPTIONS ";") set(CONFIGURE_EXTRA_OPTIONS ";")
include(ProcessorCount)
ProcessorCount(CORES_COUNT)
set(BUILD_EXTRA_FLAGS "")
if(NOT CORES_COUNT EQUAL 0)
list(APPEND BUILD_EXTRA_FLAGS "-j${CORES_COUNT}")
endif()
set(BUILD_TOOLS TRUE) set(BUILD_TOOLS TRUE)
set(BUILD_VIEWER TRUE) set(BUILD_VIEWER TRUE)
set(COVERAGE_COMMAND gcov) set(COVERAGE_COMMAND gcov)

View File

@ -23,6 +23,7 @@ else()
endif() endif()
set(CONFIGURE_EXTRA_OPTIONS ";") set(CONFIGURE_EXTRA_OPTIONS ";")
set(BUILD_EXTRA_FLAGS "")
if(CONFIGURATION STREQUAL "Debug") if(CONFIGURATION STREQUAL "Debug")
set(DEBUG TRUE) set(DEBUG TRUE)