diff --git a/tools/setup_helpers/cmake.py b/tools/setup_helpers/cmake.py index abb9aa4890d..ad0d0fb014b 100644 --- a/tools/setup_helpers/cmake.py +++ b/tools/setup_helpers/cmake.py @@ -377,15 +377,6 @@ class CMake: # os.sched_getaffinity(0) on platforms that support it. max_jobs = max_jobs or str(multiprocessing.cpu_count()) - # This ``if-else'' clause would be unnecessary when cmake - # 3.12 becomes minimum, which provides a '-j' option: - # build_args += ['-j', max_jobs] would be sufficient by - # then. Until then, we use "--" to pass parameters to the - # underlying build system. - build_args += ["--"] - if IS_WINDOWS and not USE_NINJA: - # We are likely using msbuild here - build_args += [f"/p:CL_MPCount={max_jobs}"] - else: - build_args += ["-j", max_jobs] + # CMake 3.12 provides a '-j' option. + build_args += ["-j", max_jobs] self.run(build_args, my_env) diff --git a/tools/test/test_cmake.py b/tools/test/test_cmake.py index f63578f2440..9cdb800e793 100644 --- a/tools/test/test_cmake.py +++ b/tools/test/test_cmake.py @@ -30,8 +30,8 @@ class TestCMake(unittest.TestCase): ((None, False, False), ["-j", "13"]), # noqa: E201,E241 (("6", True, True), ["-j", "6"]), # noqa: E201,E241 ((None, True, True), None), # noqa: E201,E241 - (("11", False, True), ["/p:CL_MPCount=11"]), # noqa: E201,E241 - ((None, False, True), ["/p:CL_MPCount=13"]), # noqa: E201,E241 + (("11", False, True), ["-j", "11"]), # noqa: E201,E241 + ((None, False, True), ["-j", "13"]), # noqa: E201,E241 ] for (max_jobs, use_ninja, is_windows), want in cases: with self.subTest(