Skip to content

Commit cef2671

Browse files
authored
[BUILD] Add option to limit number of parallel link jobs (#5212)
1 parent d5ba6ac commit cef2671

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,13 @@ if(TRITON_BUILD_WITH_CCACHE)
4444
endif()
4545
endif()
4646

47+
set(TRITON_PARALLEL_LINK_JOBS "" CACHE STRING
48+
"Define the maximum number of concurrent link jobs (Ninja only).")
49+
if (TRITON_PARALLEL_LINK_JOBS)
50+
set_property(GLOBAL APPEND PROPERTY JOB_POOLS link_job_pool=${TRITON_PARALLEL_LINK_JOBS})
51+
set(CMAKE_JOB_POOL_LINK link_job_pool)
52+
endif()
53+
4754

4855
# Ensure Python3 vars are set correctly
4956
# used conditionally in this file and by lit tests

python/setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,7 @@ def build_extension(self, ext):
465465
"TRITON_BUILD_PROTON",
466466
"TRITON_BUILD_TUTORIALS",
467467
"TRITON_BUILD_WITH_CCACHE",
468+
"TRITON_PARALLEL_LINK_JOBS",
468469
]
469470
cmake_args += [f"-D{option}={os.getenv(option)}" for option in passthrough_args if option in os.environ]
470471

0 commit comments

Comments
 (0)