Skip to content

Commit ffeae99

Browse files
committed
feat: add warning while building Hermes that at least CMake 3.28.0 is required (#63)
1 parent b91de9c commit ffeae99

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

packages/react-native/sdks/hermes-engine/utils/build-hermesc-xcode.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,21 @@ set -x -e
99
hermesc_dir_path="$1"; shift
1010
jsi_path="$1"
1111

12+
13+
# VisionOS support has been added to CMake from version 3.28.0 onwards. Error out if the version is lower.
14+
function check_cmake_version {
15+
required_version="3.28.0"
16+
cmake_version=$($CMAKE_BINARY --version | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | head -n 1)
17+
18+
if ! printf "%s\n%s\n" "$required_version" "$cmake_version" | sort -V | head -n 1 | grep -q "$required_version"; then
19+
echo "error: CMake version $required_version or higher is required. Found: $cmake_version"
20+
exit 1
21+
fi
22+
}
23+
24+
check_cmake_version
25+
26+
1227
# This script is supposed to be executed from Xcode "run script" phase.
1328
# Xcode sets up its build environment based on the build target (iphone, iphonesimulator, macodsx).
1429
# We want to make sure that hermesc is built for mac.

0 commit comments

Comments
 (0)