Skip to content

Add macOS build #489

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,29 @@ name: Build J2V8
on: [push]

jobs:
j2v8_macos:
name: Build J2V8 for macOS
runs-on: macos-latest

steps:
- name: Checkout
uses: actions/checkout@v1

- name: Download monolithic libraries and extract to v8.out directory
run: |
curl -O https://download.eclipsesource.com/j2v8/v8/libv8_7.4.288_monolith.zip
mkdir -p v8.out
unzip libv8_7.4.288_monolith.zip -d v8.out

# start j2v8 build
python build.py -t macos -a x64 j2v8cmake j2v8jni j2v8cpp j2v8optimize j2v8java j2v8test

- name: Archive J2V8 macOS x86_64 jar
uses: actions/[email protected]
with:
name: j2v8-macos-x86_64
path: build.out/j2v8_macos_x86_64-6.0.0.jar

generate_j2v8_archives:
name: Create J2V8 Linux jar and Android aar archive files
runs-on: ubuntu-latest
Expand Down
4 changes: 3 additions & 1 deletion build_system/config_macos.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,19 @@ def build_node_js(config):
#-----------------------------------------------------------------------
def build_j2v8_cmake(config):
cmake_vars = cmu.setAllVars(config)
V8_monolith_library_dir = config.platform + "." + config.arch

# NOTE: uses Python string interpolation (see: https://stackoverflow.com/a/4450610)
return \
u.mkdir(u.cmake_out_dir) + \
["cd " + u.cmake_out_dir] + \
u.rm("CMakeCache.txt CMakeFiles/") + \
["""cmake \
-DJ2V8_MONOLITH_LIB_DIR={0} \
-DCMAKE_BUILD_TYPE=Release \
%(cmake_vars)s \
../../ \
"""
""".format(V8_monolith_library_dir)
% locals()]

macos_config.build_step(c.build_j2v8_cmake, build_j2v8_cmake)
Expand Down