From f74ea80c9eb5d72193db9806d11c4eee5dcc2155 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eloy=20Dur=C3=A1n?= Date: Thu, 7 Jan 2021 21:07:57 -0800 Subject: [PATCH] Define the deployment target in the frameworks metadata (#425) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summary: Fixes https://github.com/facebook/hermes/issues/420 Apple App Store submission, at least the iOS one, requires this metadata to be specified when only targeting a subset of possible archs. Pull Request resolved: https://github.com/facebook/hermes/pull/425 Test Plan: (Taken from https://github.com/facebook/hermes/pull/428) ``` ~/tmp » curl -L -O https://12725-154201259-gh.circle-artifacts.com/0/tmp/hermes/output/hermes-engine-darwin-v0.7.1.tgz ~/tmp » tar -zvxf hermes-engine-darwin-v0.7.1.tgz ~/tmp » cd package/ ~/t/package » node unpack-tarball.js ~/t/package » /usr/libexec/PlistBuddy -c 'Print :MinimumOSVersion' destroot/Library/Frameworks/iphoneos/hermes.framework/Info.plist 10.0 ~/t/package » /usr/libexec/PlistBuddy -c 'Print :LSMinimumSystemVersion' destroot/Library/Frameworks/macosx/hermes.framework/Resources/Info.plist 10.13 ``` Reviewed By: mhorowitz Differential Revision: D25839408 Pulled By: Huxpro fbshipit-source-id: 8067069d66ea3af36366157ffae95445e9e89392 --- API/hermes/CMakeLists.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/API/hermes/CMakeLists.txt b/API/hermes/CMakeLists.txt index a2826bc4ff3..18a0fca6d54 100644 --- a/API/hermes/CMakeLists.txt +++ b/API/hermes/CMakeLists.txt @@ -129,6 +129,16 @@ if(APPLE AND HERMES_BUILD_APPLE_FRAMEWORK) target_compile_options(libhermes PUBLIC "-fembed-bitcode") target_link_libraries(libhermes PUBLIC "-fembed-bitcode") endif() + # Define the deployment target in the frameworks metadata + if(HERMES_APPLE_TARGET_PLATFORM MATCHES "iphone") + add_custom_command(TARGET libhermes POST_BUILD + COMMAND /usr/libexec/PlistBuddy -c "Add :MinimumOSVersion string ${CMAKE_OSX_DEPLOYMENT_TARGET}" $/Info.plist + ) + elseif(HERMES_APPLE_TARGET_PLATFORM MATCHES "macos") + add_custom_command(TARGET libhermes POST_BUILD + COMMAND /usr/libexec/PlistBuddy -c "Add :LSMinimumSystemVersion string ${CMAKE_OSX_DEPLOYMENT_TARGET}" $/Resources/Info.plist + ) + endif() endif() install(TARGETS libhermes