Skip to content

Commit

Permalink
harmony: lua !macos !ios !js (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
WhiredPlanck authored Jan 20, 2025
1 parent d4e097e commit 5e4517d
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .github/workflows/compare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ jobs:
done <manifest
- name: Find comment
if: ${{ github.event.pull_request.head.repo.fork == false }}
uses: peter-evans/find-comment@v3
id: fc
with:
Expand All @@ -51,13 +52,18 @@ jobs:
body-includes: "${{ inputs.platform }} comparison"

- name: Create or update comment
if: ${{ github.event.pull_request.head.repo.fork == false }}
uses: peter-evans/create-or-update-comment@v4
with:
issue-number: ${{ github.event.pull_request.number }}
comment-id: ${{ steps.fc.outputs.comment-id }}
body-path: summary.md
edit-mode: replace

- name: Output on fork
if: ${{ github.event.pull_request.head.repo.fork == true }}
run: cat summary.md

- name: Setup tmate session
if: ${{ failure() }}
uses: mxschmitt/action-tmate@v3
1 change: 1 addition & 0 deletions scripts/dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
'ecm',
'fmt',
'libintl',
'lua',
'marisa',
'opencc',
'zstd'
Expand Down
10 changes: 9 additions & 1 deletion scripts/lua.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from common import Builder, INSTALL_PREFIX, PLATFORM, ROOT, ensure, get_platform_cflags, patch
from common import Builder, INSTALL_PREFIX, PLATFORM, ROOT, HARMONY_NATIVE, OHOS_ARCH, ensure, get_platform_cflags, patch

project = 'lua'

Expand All @@ -18,6 +18,8 @@ def build(self):
cflags += ' -DLUA_USE_MACOSX'
elif PLATFORM == 'ios':
cflags += ' -DLUA_USE_IOS'
elif PLATFORM == 'harmony':
cflags += f' -fPIC --target={'aarch64' if OHOS_ARCH == 'arm64-v8a' else 'x86_64'}-linux-ohos'
elif PLATFORM == 'js':
cflags += ' -fPIC'

Expand All @@ -34,6 +36,12 @@ def build(self):
'AR="emar q"',
'RANLIB=emranlib'
]
elif PLATFORM == 'harmony':
command += [
f'CC={HARMONY_NATIVE}/llvm/bin/clang',
f'AR="{HARMONY_NATIVE}/llvm/bin/llvm-ar rc"',
f'RANLIB={HARMONY_NATIVE}/llvm/bin/llvm-ranlib'
]

ensure(command[0], command[1:])

Expand Down

0 comments on commit 5e4517d

Please sign in to comment.