Skip to content

Commit

Permalink
Rework to use toolchain file
Browse files Browse the repository at this point in the history
  • Loading branch information
dudoslav committed Oct 4, 2024
1 parent 92ae833 commit bf8d0a6
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
manylinux: quay.io/pypa/manylinux2014_x86_64
- platform: linux-aarch64
os: ubuntu-24.04
cmake_args: -DCMAKE_SYSTEM_PROCESSOR=aarch64 -DCMAKE_C_COMPILER=aarch64-linux-gnu-gcc -DCMAKE_CXX_COMPILER=aarch64-linux-gnu-g++
cmake_args: -DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=$PWD/cmake/arm64_linux_toolchain.cmake
triplet: arm64-linux-release
- platform: macos-x86_64
os: macos-12
Expand Down
11 changes: 11 additions & 0 deletions cmake/arm64_linux_toolchain.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#
# CMake Toolchain file for crosscompiling on ARM.
#
# Target operating system name.
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR aarch64)
set(CMAKE_CROSSCOMPILING TRUE)

# Name of C compiler.
set(CMAKE_C_COMPILER "/usr/bin/aarch64-linux-gnu-gcc")
set(CMAKE_CXX_COMPILER "/usr/bin/aarch64-linux-gnu-g++")
8 changes: 2 additions & 6 deletions cmake/package.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,8 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows")
endif()
else()
set(CPACK_SYSTEM_NAME "Linux")
if (DEFINED CACHE{CMAKE_SYSTEM_PROCESSOR})
if ($CACHE{CMAKE_SYSTEM_PROCESSOR} STREQUAL "aarch64")
set(CPACK_SYSTEM_PROCESSOR "arm64")
else()
set(CPACK_SYSTEM_PROCESSOR $CACHE{CMAKE_SYSTEM_PROCESSOR})
endif()
if (CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")
set(CPACK_SYSTEM_PROCESSOR "arm64")
else()
set(CPACK_SYSTEM_PROCESSOR ${CMAKE_SYSTEM_PROCESSOR})
endif()
Expand Down

0 comments on commit bf8d0a6

Please sign in to comment.