diff --git a/cmake/Platform/Common/Configurations_common.cmake b/cmake/Platform/Common/Configurations_common.cmake index 6ec788994c..15f7344958 100644 --- a/cmake/Platform/Common/Configurations_common.cmake +++ b/cmake/Platform/Common/Configurations_common.cmake @@ -47,3 +47,18 @@ ly_append_configurations_options( NDEBUG AZ_BUILD_CONFIGURATION_TYPE="${LY_BUILD_CONFIGURATION_TYPE_RELEASE}" ) + +# Ninja: parallel compile and link pool settings +if(CMAKE_GENERATOR MATCHES "Ninja") + set(LY_PARALLEL_COMPILE_JOBS "" CACHE STRING "Number of compile jobs to use (Defaults to not set)") + set(LY_PARALLEL_LINK_JOBS "" CACHE STRING "Number of link jobs to use (Defaults to not set)") + + if(LY_PARALLEL_COMPILE_JOBS) + set_property(GLOBAL APPEND PROPERTY JOB_POOLS compile_job_pool=${LY_PARALLEL_COMPILE_JOBS}) + ly_set(CMAKE_JOB_POOL_COMPILE compile_job_pool) + endif() + if(LY_PARALLEL_LINK_JOBS) + set_property(GLOBAL APPEND PROPERTY JOB_POOLS link_job_pool=${LY_PARALLEL_LINK_JOBS}) + ly_set(CMAKE_JOB_POOL_LINK link_job_pool) + endif() +endif() diff --git a/cmake/Platform/Linux/Configurations_linux.cmake b/cmake/Platform/Linux/Configurations_linux.cmake index c4a98a4bec..7da0cf188f 100644 --- a/cmake/Platform/Linux/Configurations_linux.cmake +++ b/cmake/Platform/Linux/Configurations_linux.cmake @@ -29,10 +29,3 @@ endif() ly_set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE) ly_set(CMAKE_INSTALL_RPATH_USE_LINK_PATH FALSE) ly_set(CMAKE_INSTALL_RPATH "$ORIGIN") - -if(CMAKE_GENERATOR MATCHES "Ninja") - if(LY_PARALLEL_LINK_JOBS) - set_property(GLOBAL APPEND PROPERTY JOB_POOLS link_job_pool=${LY_PARALLEL_LINK_JOBS}) - ly_set(CMAKE_JOB_POOL_LINK link_job_pool) - endif() -endif()