Skip to content

Commit

Permalink
add cmake toolchain files (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
felixguendling authored Sep 13, 2021
1 parent 5d6c4ee commit f2412f4
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 7 deletions.
9 changes: 2 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,8 @@ jobs:
ls -la
cd ${{ matrix.config.target }}
ct-ng build
- name: Show log on failure
if: ${{ failure() }}
run: |
cd ${{ matrix.config.target }}
ls -la
cat build.log
chmod +w $HOME/x-tools/${{ matrix.config.target }}
cp toolchain.cmake $HOME/x-tools/${{ matrix.config.target }}
# ==== PACKAGE ====
- name: Package
Expand Down
10 changes: 10 additions & 0 deletions aarch64-unknown-linux-musl/toolchain.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR aarch64)
set(CMAKE_LIBRARY_PATH ${CMAKE_CURRENT_LIST_DIR}/lib)
set(CMAKE_SYSROOT ${CMAKE_CURRENT_LIST_DIR}/aarch64-unknown-linux-musl/sysroot)
set(CMAKE_C_COMPILER ${CMAKE_CURRENT_LIST_DIR}/bin/aarch64-unknown-linux-musl-gcc)
set(CMAKE_CXX_COMPILER ${CMAKE_CURRENT_LIST_DIR}/bin/aarch64-unknown-linux-musl-g++)
set(CMAKE_C_FLAGS "-Wno-psabi")
set(CMAKE_CXX_FLAGS "-Wno-psabi")
set(CMAKE_CXX_FLAGS_DEBUG "")
set(CMAKE_EXE_LINKER_FLAGS "-static-libgcc -static-libstdc++ -static")
10 changes: 10 additions & 0 deletions arm-unknown-linux-musleabihf/toolchain.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR arm)
set(CMAKE_LIBRARY_PATH ${CMAKE_CURRENT_LIST_DIR}/lib)
set(CMAKE_SYSROOT ${CMAKE_CURRENT_LIST_DIR}/arm-unknown-linux-musleabihf/sysroot)
set(CMAKE_C_COMPILER ${CMAKE_CURRENT_LIST_DIR}/bin/arm-unknown-linux-musleabihf-gcc)
set(CMAKE_CXX_COMPILER ${CMAKE_CURRENT_LIST_DIR}/bin/arm-unknown-linux-musleabihf-g++)
set(CMAKE_C_FLAGS "-Wno-psabi -latomic")
set(CMAKE_CXX_FLAGS "-Wno-psabi -latomic")
set(CMAKE_CXX_FLAGS_DEBUG "")
set(CMAKE_EXE_LINKER_FLAGS "-static-libgcc -static-libstdc++ -static -latomic")
6 changes: 6 additions & 0 deletions x86_64-multilib-linux-musl/toolchain.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
set(CMAKE_CROSSCOMPILING 1)
set(CMAKE_LIBRARY_PATH ${CMAKE_CURRENT_LIST_DIR}/lib)
set(CMAKE_SYSROOT ${CMAKE_CURRENT_LIST_DIR}/x86_64-multilib-linux-musl/sysroot)
set(CMAKE_C_COMPILER ${CMAKE_CURRENT_LIST_DIR}/bin/x86_64-multilib-linux-musl-gcc)
set(CMAKE_CXX_COMPILER ${CMAKE_CURRENT_LIST_DIR}/bin/x86_64-multilib-linux-musl-g++)
set(CMAKE_EXE_LINKER_FLAGS "-static-libgcc -static-libstdc++ -static")

0 comments on commit f2412f4

Please sign in to comment.