Skip to content

Commit

Permalink
fix: theoretical cmake cross compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
SpikeHD committed Oct 22, 2024
1 parent 887a6c8 commit be7cfc2
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 2 deletions.
20 changes: 18 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,25 @@ jobs:
env:
RUSTFLAGS: -Awarnings

- name: (Linux) Build Webkit extension
if: matrix.config.platform == 'ubuntu-22.04'
- name: (Linux x86_64) Build Webkit extension
if: matrix.config.target == 'x86_64-unknown-linux-gnu'
run: cd src-tauri/extension_webkit && cmake . && cmake --build .

- name: (Linux ARMv7) Build Webkit extension
if: matrix.config.target == 'armv7-unknown-linux-gnueabihf'
run: cd src-tauri/extension_webkit && cmake . && cmake --build .
env:
CC: arm-linux-gnueabihf-gcc
PKG_CONFIG_SYSROOT_DIR: /usr/lib/arm-linux-gnueabihf
PKG_CONFIG_PATH: /usr/lib/arm-linux-gnueabihf/pkgconfig

- name: (Linux ARM64) Build Webkit extension
if: matrix.config.target == 'aarch64-unknown-linux-gnu'
run: cd src-tauri/extension_webkit && cmake . && cmake --build .
env:
CC: aarch64-linux-gnu-gcc
PKG_CONFIG_SYSROOT_DIR: /usr/lib/aarch64-linux-gnu
PKG_CONFIG_PATH: /usr/lib/aarch64-linux-gnu/pkgconfig

- name: Install dependencies
run: pnpm install && pnpm shupdate
Expand Down
14 changes: 14 additions & 0 deletions src-tauri/extension_webkit/toolchain-arm64.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Target system
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR aarch64)

# Cross-compilation toolchain
set(CMAKE_C_COMPILER aarch64-linux-gnu-gcc)
set(CMAKE_CXX_COMPILER aarch64-linux-gnu-g++)
set(CMAKE_SYSROOT /usr/lib/aarch64-linux-gnu)

# Library paths
set(CMAKE_FIND_ROOT_PATH /usr/lib/aarch64-linux-gnu)
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
14 changes: 14 additions & 0 deletions src-tauri/extension_webkit/toolchain-armv7.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Target system
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR arm)

# Cross-compilation toolchain
set(CMAKE_C_COMPILER arm-linux-gnueabihf-gcc)
set(CMAKE_CXX_COMPILER arm-linux-gnueabihf-g++)
set(CMAKE_SYSROOT /usr/lib/arm-linux-gnueabihf)

# Library paths
set(CMAKE_FIND_ROOT_PATH /usr/lib/arm-linux-gnueabihf)
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

0 comments on commit be7cfc2

Please sign in to comment.