Skip to content

Commit c55edb7

Browse files
author
Elmi Ahmadov
committed
Add macOS build
1 parent 353cc8d commit c55edb7

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

.github/workflows/main.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,29 @@ name: Build J2V8
33
on: [push]
44

55
jobs:
6+
j2v8_macos:
7+
name: Build J2V8 for macOS
8+
runs-on: macos-latest
9+
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v1
13+
14+
- name: Download monolithic libraries and extract to v8.out directory
15+
run: |
16+
curl -O https://download.eclipsesource.com/j2v8/v8/libv8_7.4.288_monolith.zip
17+
mkdir -p v8.out
18+
unzip libv8_7.4.288_monolith.zip -d v8.out
19+
20+
# start j2v8 build
21+
python build.py -t macos -a x64 j2v8cmake j2v8jni j2v8cpp j2v8optimize j2v8java j2v8test
22+
23+
- name: Archive J2V8 macOS x86_64 jar
24+
uses: actions/[email protected]
25+
with:
26+
name: j2v8-macos-x86_64
27+
path: build.out/j2v8_macos_x86_64-6.0.0.jar
28+
629
generate_j2v8_archives:
730
name: Create J2V8 Linux jar and Android aar archive files
831
runs-on: ubuntu-latest

build_system/config_macos.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,17 +43,19 @@ def build_node_js(config):
4343
#-----------------------------------------------------------------------
4444
def build_j2v8_cmake(config):
4545
cmake_vars = cmu.setAllVars(config)
46+
V8_monolith_library_dir = config.platform + "." + config.arch
4647

4748
# NOTE: uses Python string interpolation (see: https://stackoverflow.com/a/4450610)
4849
return \
4950
u.mkdir(u.cmake_out_dir) + \
5051
["cd " + u.cmake_out_dir] + \
5152
u.rm("CMakeCache.txt CMakeFiles/") + \
5253
["""cmake \
54+
-DJ2V8_MONOLITH_LIB_DIR={0} \
5355
-DCMAKE_BUILD_TYPE=Release \
5456
%(cmake_vars)s \
5557
../../ \
56-
"""
58+
""".format(V8_monolith_library_dir)
5759
% locals()]
5860

5961
macos_config.build_step(c.build_j2v8_cmake, build_j2v8_cmake)

0 commit comments

Comments
 (0)