From 2423342004c1e764a4c8a2ccdde80442f9f65b10 Mon Sep 17 00:00:00 2001 From: Riccardo Cipolleschi Date: Wed, 30 Aug 2023 06:12:37 -0700 Subject: [PATCH] Check if cmake is installed on RNTester (#39208) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/39208 To properly build RNTester for iOS, we need cmake installed. This small change check whether Cmake is present in the system. If not, it tries to install it using `brew` if that's available. Otherwise, it exits with an error message asking to install cmake. ## Changelog: [Internal] - Check whether Cmake is present for RNTester Reviewed By: dmytrorykun Differential Revision: D48821932 fbshipit-source-id: 94f1000a22a9f9d06efdec70b37698b99af358e5 --- packages/rn-tester/Podfile | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/packages/rn-tester/Podfile b/packages/rn-tester/Podfile index 624cac0d2f0..b851c5eaade 100644 --- a/packages/rn-tester/Podfile +++ b/packages/rn-tester/Podfile @@ -3,6 +3,22 @@ require_relative '../react-native/scripts/react_native_pods' source 'https://cdn.cocoapods.org/' platform :ios, min_ios_version_supported +cmake_path = `command -v cmake` + +if cmake_path == "" + brew_path = `command -v brew` + if brew_path != "" + Pod::UI.puts "Installing CMake using brew. This is required to build RNTester.".red + `brew install cmake` + else + Pod::UI.puts "In order to build RNTester locally, you need cmake installed, please install it and try again".red + return + end +else + Pod::UI.puts "Cmake found at: #{cmake_path}".green +end + + prepare_react_native_project! IN_CI = ENV['CI'] == 'true'