diff --git a/CMakeLists.txt b/CMakeLists.txt index 6ee47748602f..56564c38964c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -44,6 +44,13 @@ if(TRITON_BUILD_WITH_CCACHE) endif() endif() +set(TRITON_PARALLEL_LINK_JOBS "" CACHE STRING + "Define the maximum number of concurrent link jobs (Ninja only).") +if (TRITON_PARALLEL_LINK_JOBS) + set_property(GLOBAL APPEND PROPERTY JOB_POOLS link_job_pool=${TRITON_PARALLEL_LINK_JOBS}) + set(CMAKE_JOB_POOL_LINK link_job_pool) +endif() + # Ensure Python3 vars are set correctly # used conditionally in this file and by lit tests diff --git a/python/setup.py b/python/setup.py index 86c4013b0718..607670fc5e17 100644 --- a/python/setup.py +++ b/python/setup.py @@ -465,6 +465,7 @@ def build_extension(self, ext): "TRITON_BUILD_PROTON", "TRITON_BUILD_TUTORIALS", "TRITON_BUILD_WITH_CCACHE", + "TRITON_PARALLEL_LINK_JOBS", ] cmake_args += [f"-D{option}={os.getenv(option)}" for option in passthrough_args if option in os.environ]