Skip to content

Commit

Permalink
Use mold for CI
Browse files Browse the repository at this point in the history
  • Loading branch information
yujincheng08 committed Aug 8, 2024
1 parent 07835a3 commit d0504c8
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,18 @@ runs:
restore-keys: ${{ runner.os }}
max-size: 10000M

- name: Set up mold (Linux)
uses: rui314/setup-mold@v1
if: runner.os == 'Linux'
with:
make-default: false
- name: Set up mold (macOS)
shell: bash
if: runner.os == 'macOS'
run: |
brew update
brew install mold
- name: Cache Gradle dependencies
uses: actions/cache@v4
with:
Expand Down
2 changes: 2 additions & 0 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,8 @@ def build_native():
os.environ["CARGO_INCREMENTAL"] = "0"
if ccache := shutil.which("ccache"):
os.environ["NDK_CCACHE"] = ccache
if mold := shutil.which("mold"):
os.environ["NDK_MOLD"] = mold

build_rust_src(targets)
build_cpp_src(targets)
Expand Down
4 changes: 4 additions & 0 deletions native/src/Application.mk
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ APP_THIN_ARCHIVE := true
APP_STRIP_MODE := none
APP_SUPPORT_FLEXIBLE_PAGE_SIZES := true

ifdef NDK_MOLD
APP_LDFLAGS += -fuse-ld=$(NDK_MOLD) -Wl,-z,muldefs
endif

ifdef MAGISK_DEBUG

NDK_APP_OUT := ./obj/debug
Expand Down

0 comments on commit d0504c8

Please sign in to comment.