Skip to content

Commit 5477120

Browse files
shoumikhinpytorchmergebot
authored andcommitted
[executorch] Update iOS toolchain with a modern cmake syntax. (pytorch#115799)
Summary: Replace exec_program with execute_process Test Plan: CI Differential Revision: D52147108 Pull Request resolved: pytorch#115799 Approved by: https://github.com/huydhn
1 parent f90a5f8 commit 5477120

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

cmake/iOS.cmake

+6-2
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ set(CMAKE_OSX_DEPLOYMENT_TARGET "" CACHE STRING "Force unset of the deployment t
4141
# Determine the cmake host system version so we know where to find the iOS SDKs
4242
find_program(CMAKE_UNAME uname /bin /usr/bin /usr/local/bin)
4343
if(CMAKE_UNAME)
44-
exec_program(uname ARGS -r OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_VERSION)
44+
execute_process(COMMAND uname -r OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
4545
string(REGEX REPLACE "^([0-9]+)\\.([0-9]+).*$" "\\1" DARWIN_MAJOR_VERSION "${CMAKE_HOST_SYSTEM_VERSION}")
4646
endif(CMAKE_UNAME)
4747

@@ -127,7 +127,11 @@ set(IOS_DEPLOYMENT_TARGET ${IOS_DEPLOYMENT_TARGET} CACHE STRING "Minimum iOS ver
127127

128128
# Setup iOS developer location unless specified manually with CMAKE_IOS_DEVELOPER_ROOT
129129
# Note Xcode 4.3 changed the installation location, choose the most recent one available
130-
exec_program(/usr/bin/xcode-select ARGS -print-path OUTPUT_VARIABLE CMAKE_XCODE_DEVELOPER_DIR)
130+
execute_process(
131+
COMMAND /usr/bin/xcode-select -print-path
132+
OUTPUT_VARIABLE CMAKE_XCODE_DEVELOPER_DIR
133+
OUTPUT_STRIP_TRAILING_WHITESPACE
134+
)
131135
set(XCODE_POST_43_ROOT "${CMAKE_XCODE_DEVELOPER_DIR}/Platforms/${IOS_PLATFORM_LOCATION}/Developer")
132136
set(XCODE_PRE_43_ROOT "/Developer/Platforms/${IOS_PLATFORM_LOCATION}/Developer")
133137
if(NOT CMAKE_IOS_DEVELOPER_ROOT)

0 commit comments

Comments
 (0)