-
Notifications
You must be signed in to change notification settings - Fork 606
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build macOS framework and add CocoaPods podspec
* On Apple platforms build a [dynamic] framework bundle when `HERMES_BUILD_APPLE_FRAMEWORK` is set. When set to `FALSE` it will produce a `dylib`, like previously. Defaults to `TRUE`. * On Apple platforms create a debugging symbols bundle. * Add `HERMES_ENABLE_FUZZING`, which is enabled by default. * Add `HERMES_ENABLE_TEST_SUITE`, which is enabled by default. * Add a CocoaPods podspec that can build from source or use a binary.
- Loading branch information
Showing
17 changed files
with
242 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
module HermesHelper | ||
# BUILD_TYPE = :debug | ||
BUILD_TYPE = :release | ||
|
||
def self.command_exists?(bin) | ||
"command -v #{bin} > /dev/null 2>&1" | ||
end | ||
|
||
def self.configure_command | ||
"./utils/build/configure.py #{BUILD_TYPE == :release ? "--distribute" : "--build-type=Debug"} --cmake-flags='-DHERMES_ENABLE_DEBUGGER:BOOLEAN=true -DHERMES_ENABLE_FUZZING:BOOLEAN=false -DHERMES_ENABLE_TEST_SUITE:BOOLEAN=false -DCMAKE_INSTALL_PREFIX:PATH=../destroot' build" | ||
end | ||
end | ||
|
||
Pod::Spec.new do |spec| | ||
spec.name = "hermes" | ||
spec.version = "0.5.0" | ||
spec.summary = "Hermes is a small and lightweight JavaScript engine optimized for running React Native." | ||
spec.description = "Hermes is a JavaScript engine optimized for fast start-up of React Native apps. It features ahead-of-time static optimization and compact bytecode." | ||
spec.homepage = "https://hermesengine.dev" | ||
spec.license = { type: "MIT", file: "LICENSE" } | ||
spec.author = "Facebook" | ||
spec.source = { git: "https://github.com/facebook/hermes.git", tag: "v#{spec.version}" } | ||
spec.platforms = { :osx => "10.14" } | ||
|
||
spec.preserve_paths = ["destroot/bin/*"].concat(HermesHelper::BUILD_TYPE == :debug ? ["**/*.{h,c,cpp}"] : []) | ||
spec.source_files = "destroot/include/**/*.h" | ||
spec.header_mappings_dir = "destroot/include" | ||
spec.vendored_frameworks = "destroot/Library/Frameworks/hermes.framework" | ||
spec.xcconfig = { "CLANG_CXX_LANGUAGE_STANDARD" => "c++14", "CLANG_CXX_LIBRARY" => "compiler-default", "GCC_PREPROCESSOR_DEFINITIONS" => "HERMES_ENABLE_DEBUGGER=1" } | ||
|
||
spec.prepare_command = <<-EOS | ||
if [ ! -d destroot/Library/Frameworks/hermes.framework ]; then | ||
if #{HermesHelper.command_exists?("cmake")}; then | ||
if #{HermesHelper.command_exists?("ninja")}; then | ||
#{HermesHelper.configure_command} --build-system='Ninja' && cd build && ninja install | ||
else | ||
#{HermesHelper.configure_command} --build-system='Unix Makefiles' && cd build && make install | ||
fi | ||
else | ||
echo >&2 'CMake is required to install Hermes, install it with: brew install cmake' | ||
exit 1 | ||
fi | ||
fi | ||
EOS | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Copyright (c) Facebook, Inc. and its affiliates. | ||
# | ||
# This source code is licensed under the MIT license found in the | ||
# LICENSE file in the root directory of this source tree. | ||
|
||
install(DIRECTORY "${PROJECT_SOURCE_DIR}/public/hermes/Public" DESTINATION include/hermes | ||
FILES_MATCHING PATTERN "*.h") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,3 +15,4 @@ target_link_libraries(hbc-attribute | |
) | ||
|
||
hermes_link_icu(hbc-attribute) | ||
hermes_strip_debug_symbols(hbc-attribute) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,3 +17,4 @@ target_link_libraries(hbc-deltaprep | |
) | ||
|
||
hermes_link_icu(hbc-deltaprep) | ||
hermes_strip_debug_symbols(hbc-deltaprep) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,3 +19,4 @@ target_link_libraries(hbc-diff | |
) | ||
|
||
hermes_link_icu(hbc-diff) | ||
hermes_strip_debug_symbols(hbc-diff) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.