Skip to content

Commit

Permalink
Define the deployment target in the frameworks metadata (#425)
Browse files Browse the repository at this point in the history
Summary:
Fixes #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: #425

Test Plan:
(Taken from #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
  • Loading branch information
alloy authored and facebook-github-bot committed Jan 8, 2021
1 parent 3b88979 commit f74ea80
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions API/hermes/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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}" $<TARGET_FILE_DIR:libhermes>/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}" $<TARGET_FILE_DIR:libhermes>/Resources/Info.plist
)
endif()
endif()

install(TARGETS libhermes
Expand Down

0 comments on commit f74ea80

Please sign in to comment.