Skip to content

Commit 7db6c5d

Browse files
authored
Build CMake on macOS if one is not preinstalled (#81161)
We build CMake on all platforms (except Darwin for an unknown reason) if CMake is not preinstalled. Since CMake 4.0 regresses certain build configurations, there's currently no way to build on Darwin without installing an older CMake version 3.x manually. This can be simplified if we build a pinned version of CMake consistently on all platforms.
1 parent 0e6f3a8 commit 7db6c5d

File tree

1 file changed

+2
-7
lines changed
  • utils/swift_build_support/swift_build_support

1 file changed

+2
-7
lines changed

utils/swift_build_support/swift_build_support/cmake.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -282,14 +282,9 @@ def build_cmake(self, source_root, build_root):
282282
os.chdir(cwd)
283283
return os.path.join(cmake_build_dir, 'bin', 'cmake')
284284

285-
# Get the path to CMake to use for the build
286-
# This function will not build CMake for Apple platforms.
287-
# For other platforms, this builds CMake if a new enough version is not
288-
# available.
285+
# Get the path to CMake to use for the build, this builds CMake if a new enough
286+
# version is not available.
289287
def get_cmake_path(self, source_root, build_root):
290-
if platform.system() == 'Darwin':
291-
return self.toolchain.cmake
292-
293288
cmake_source_dir = os.path.join(source_root, 'cmake')
294289
if not os.path.isdir(cmake_source_dir):
295290
return self.toolchain.cmake

0 commit comments

Comments
 (0)