Commit c3c2c418 authored by Emmanuel Promayon's avatar Emmanuel Promayon

NEW try ninja for faster build

parent e99f9fec
......@@ -342,8 +342,8 @@ debian_stable_coverage:
OS: "win7"
# the name of the current machine
CDASH_SITE: "[Gitlab Runner] Win7"
# compiler-arch-buildtype string
COMPILER_CONFIG: "MSVC2017-64bits-Debug"
# compiler-arch-buildtype string (use Ninja instead of MSVC2015 to speed up compilation on VM)
COMPILER_CONFIG: "Ninja-64bits-Debug"
# path to the intended build directory
PROJECT_BUILD_DIR: "/c/dev/gitlab-runner/builds/${OS}-${CI_COMMIT_REF_SLUG}"
# path to the intended log directory (cannot be an absolute path)
......
......@@ -66,32 +66,34 @@ endif()
set(CTEST_BUILD_NAME "${CURRENT_GIT_BRANCH} ${CURRENT_GIT_HASH} ${CI_BUILD_SETTINGS}")
if(UNIX)
set( CTEST_CMAKE_GENERATOR "Unix Makefiles" )
set(CTEST_CMAKE_GENERATOR "Unix Makefiles" )
elseif(WIN32)
if(COMPILER MATCHES "MinGW" OR "MINGW")
set( CTEST_CMAKE_GENERATOR "MinGW Makefiles" )
set(CTEST_CMAKE_GENERATOR "MinGW Makefiles" )
elseif(COMPILER MATCHES "MSVC2008")
set( CTEST_CMAKE_GENERATOR "Visual Studio 9 2008" )
set(CTEST_CMAKE_GENERATOR "Visual Studio 9 2008" )
elseif(COMPILER MATCHES "MSVC2010" AND ARCH MATCHES "32bits")
set( CTEST_CMAKE_GENERATOR "Visual Studio 10" )
set( CMAKE_MAKE_PROGRAM "C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/VCExpress.exe") # Do not use MSBuild.exe as it won't work
set(CTEST_CMAKE_GENERATOR "Visual Studio 10" )
set(CMAKE_MAKE_PROGRAM "C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/VCExpress.exe") # Do not use MSBuild.exe as it won't work
elseif(COMPILER MATCHES "MSVC2010" AND ARCH MATCHES "64bits")
set( CTEST_CMAKE_GENERATOR "Visual Studio 10 Win64" )
set( CMAKE_MAKE_PROGRAM "C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/VCExpress.exe") # Do not use MSBuild.exe as it won't work
set(CTEST_CMAKE_GENERATOR "Visual Studio 10 Win64" )
set(CMAKE_MAKE_PROGRAM "C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/VCExpress.exe") # Do not use MSBuild.exe as it won't work
elseif(COMPILER MATCHES "MSVC2012" AND ARCH MATCHES "32bits")
set( CTEST_CMAKE_GENERATOR "Visual Studio 11" )
set( CMAKE_MAKE_PROGRAM "C:/Program Files (x86)/Microsoft Visual Studio 11.0/Common7/IDE/WDExpress.exe") # Do not use MSBuild.exe as it won't work
set(CTEST_CMAKE_GENERATOR "Visual Studio 11" )
set(CMAKE_MAKE_PROGRAM "C:/Program Files (x86)/Microsoft Visual Studio 11.0/Common7/IDE/WDExpress.exe") # Do not use MSBuild.exe as it won't work
elseif(COMPILER MATCHES "MSVC2012" AND ARCH MATCHES "64bits")
set( CTEST_CMAKE_GENERATOR "Visual Studio 11 Win64" )
set( CMAKE_MAKE_PROGRAM "C:/Program Files (x86)/Microsoft Visual Studio 11.0/Common7/IDE/WDExpress.exe") # Do not use MSBuild.exe as it won't work
set(CTEST_CMAKE_GENERATOR "Visual Studio 11 Win64" )
set(CMAKE_MAKE_PROGRAM "C:/Program Files (x86)/Microsoft Visual Studio 11.0/Common7/IDE/WDExpress.exe") # Do not use MSBuild.exe as it won't work
elseif(COMPILER MATCHES "MSVC2013" AND ARCH MATCHES "32bits")
set( CTEST_CMAKE_GENERATOR "Visual Studio 12" )
set(CTEST_CMAKE_GENERATOR "Visual Studio 12" )
elseif(COMPILER MATCHES "MSVC2013" AND ARCH MATCHES "64bits")
set( CTEST_CMAKE_GENERATOR "Visual Studio 12 Win64" )
set(CTEST_CMAKE_GENERATOR "Visual Studio 12 Win64" )
elseif(COMPILER MATCHES "MSVC2015" AND ARCH MATCHES "64bits")
set( CTEST_CMAKE_GENERATOR "Visual Studio 14 2015 Win64" )
set(CTEST_CMAKE_GENERATOR "Visual Studio 14 2015 Win64" )
elseif(COMPILER MATCHES "MSVC2017" AND ARCH MATCHES "64bits")
set( CTEST_CMAKE_GENERATOR "Visual Studio 15 2017 Win64" )
set(CTEST_CMAKE_GENERATOR "Visual Studio 15 2017 Win64" )
elseif(COMPILER MATCHES "Ninja")
set(CTEST_CMAKE_GENERATOR "Ninja")
else()
message(FATAL_ERROR "CTEST COMPILER ERROR : No proper compiler found, please check ctest command syntax.")
endif()
......@@ -108,9 +110,9 @@ endif()
include(ProcessorCount)
ProcessorCount(NUMBER_OF_PROC)
if(NOT NUMBER_OF_PROC EQUAL 0)
if(COMPILER MATCHES "GCC")
if(COMPILER MATCHES "GCC" OR COMPILER MATCHES "Ninja")
set(CTEST_BUILD_FLAGS -j${NUMBER_OF_PROC})
elseif(WIN32)
elseif(COMPILER MATCHES "MSVC.*")
# on windows /MP[N] has to be set at configure time (/MP without a number determines nr of proc automatically)
set(CMAKE_C_FLAGS "/MP ${CMAKE_C_FLAGS}")
set(CMAKE_CXX_FLAGS "/MP ${CMAKE_CXX_FLAGS}")
......@@ -126,7 +128,7 @@ set(CTEST_CONFIGURE_COMMAND "${CTEST_CONFIGURE_COMMAND} -DCMAKE_C_FLAGS:STRING=$
if(COMPILER MATCHES "MSVC2010" AND ARCH MATCHES "64bits") # Do not compile MML and PhysicalModel until libxml2 MSVC2010 x64 bug remains.
set(CTEST_CONFIGURE_COMMAND "${CTEST_CONFIGURE_COMMAND} -DACTION_MML=FALSE -DCOMPONENT_MML=FALSE -DCOMPONENT_PHYSICALMODEL=FALSE")
endif()
set( CTEST_CONFIGURE_COMMAND "${CTEST_CONFIGURE_COMMAND} -DCEP_IMAGING=TRUE -DCEP_MODELING=TRUE -DCEP_TUTORIALS=TRUE -DAPIDOC_SDK=TRUE -DCAMITK_TEST_COVERAGE=TRUE ${CTEST_SOURCE_DIRECTORY}")
set(CTEST_CONFIGURE_COMMAND "${CTEST_CONFIGURE_COMMAND} -DCEP_IMAGING=TRUE -DCEP_MODELING=TRUE -DCEP_TUTORIALS=TRUE -DAPIDOC_SDK=TRUE -DCAMITK_TEST_COVERAGE=TRUE ${CTEST_SOURCE_DIRECTORY}")
# get CamiTK CDash server configuration
include("${CTEST_SOURCE_DIRECTORY}/CTestConfig.cmake")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment