-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
33 test areg-sdk demo with toolchains (#34)
* Updated and tested toolchain files. * Added new toolchain file to compile with Clang for ARM processors. * Fixing cross-compile for x86 processor.
- Loading branch information
Showing
17 changed files
with
293 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,148 @@ | ||
# ################################################################## | ||
# | ||
# Cross-compile with CMake workflow for areg-sdk Demo project | ||
# | ||
# ################################################################## | ||
name: CMake Linux Cross-Compile | ||
|
||
on: | ||
push: # Keep empty to run on each branch when push the code. Otherwise use branches: [ master ] | ||
branches: [ main ] | ||
pull_request: # Set to master to run only when merge with master branch | ||
branches: [ main ] | ||
|
||
env: | ||
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) | ||
BUILD_TYPE: Release | ||
|
||
# The CMake configure and build commands are platform agnostic and should work equally well on Windows or Linux. | ||
# You can convert this to a matrix build if you need cross-platform coverage. | ||
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix | ||
|
||
jobs: | ||
|
||
job_linux: | ||
name: Linux Platform, x86_64, x86, arm, aarch64 builds | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Linux - Checkout AREG SDK Demo project sources and dependencies | ||
uses: actions/checkout@v4 | ||
|
||
- name: Linux - Setup Java JDK on Windows to run code generator | ||
uses: actions/[email protected] | ||
with: | ||
java-version: 17 | ||
java-package: jre | ||
distribution: temurin | ||
|
||
- name: Update compilers on Linux | ||
# Update compilers, set C/C++ compilers | ||
run: sudo apt-get update | ||
|
||
- name: Linux - Configure Demo, include AREG SDK after project(), GNU on x64, shared | ||
working-directory: ${{github.workspace}} | ||
run: cmake -B ./product/cache/gnu-x64-so -DAREG_COMPILER_FAMILY=gnu | ||
|
||
- name: Linux - Build Demo, include AREG SDK after project(), GNU on x64, shared | ||
working-directory: ${{github.workspace}} | ||
run: cmake --build ./product/cache/gnu-x64-so -j20 | ||
|
||
- name: Linux - Install multilib | ||
run: sudo apt-get install -y gcc-multilib g++-multilib | ||
|
||
- name: Linux - Configure Demo, include AREG SDK after project(), GNU on x86, shared | ||
working-directory: ${{github.workspace}} | ||
run: cmake -B ./product/cache/gnu-x86-so -DAREG_COMPILER_FAMILY=gnu -DAREG_PROCESSOR=x86 | ||
|
||
- name: Linux - Build Demo, include AREG SDK after project(), GNU on x86, shared | ||
working-directory: ${{github.workspace}} | ||
run: cmake --build ./product/cache/gnu-x86-so -j20 | ||
|
||
- name: Linux - Install GNU 32-bit ARM compilers | ||
run: sudo apt-get install -y gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf binutils-arm-linux-gnueabihf | ||
|
||
- name: Linux - Configure Demo, include AREG SDK after project(), GNU on arm32, shared | ||
working-directory: ${{github.workspace}} | ||
run: cmake -B ./product/cache/gnu-arm-so -DAREG_COMPILER_FAMILY=gnu -DAREG_PROCESSOR=arm | ||
|
||
- name: Linux - Build Demo, include AREG SDK after project(), GNU on arm32, shared | ||
working-directory: ${{github.workspace}} | ||
run: cmake --build ./product/cache/gnu-arm-so -j20 | ||
|
||
- name: Linux - Install GNU 64-bit AARCH64 compilers | ||
run: sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu binutils-aarch64-linux-gnu | ||
|
||
- name: Linux - Configure Demo, include AREG SDK after project(), GNU on aarch64, shared | ||
working-directory: ${{github.workspace}} | ||
run: cmake -B ./product/cache/gnu-aarch64-so -DAREG_COMPILER_FAMILY=gnu -DAREG_PROCESSOR=aarch64 | ||
|
||
- name: Linux - Build Demo, include AREG SDK after project(), GNU on aarch64, shared | ||
working-directory: ${{github.workspace}} | ||
run: cmake --build ./product/cache/gnu-aarch64-so -j20 | ||
|
||
- name: Linux - Fix 'asm' directory issue by creating symlink. | ||
run: sudo ln -s /usr/include/asm-generic/ /usr/include/asm | ||
|
||
- name: Linux - Cross-compile configure, gnu-linux-arm32.cmake | ||
working-directory: ${{github.workspace}} | ||
run: cmake -B ./product/cache/gnu-linux-arm32 -DCMAKE_TOOLCHAIN_FILE=${{github.workspace}}/toolchains/gnu-linux-arm32.cmake -DAREG_EXTENDED:BOOL=ON | ||
|
||
- name: Linux - Cross-compile build, gnu-linux-arm32.cmake | ||
working-directory: ${{github.workspace}} | ||
run: cmake --build ./product/cache/gnu-linux-arm32 -j20 | ||
|
||
- name: Linux - Cross-compile configure, gnu-linux-arm64.cmake | ||
working-directory: ${{github.workspace}} | ||
run: cmake -B ./product/cache/gnu-linux-arm64 -DCMAKE_TOOLCHAIN_FILE=${{github.workspace}}/toolchains/gnu-linux-arm64.cmake -DAREG_EXTENDED:BOOL=ON | ||
|
||
- name: Linux - Cross-compile build, gnu-linux-arm64.cmake | ||
working-directory: ${{github.workspace}} | ||
run: cmake --build ./product/cache/gnu-linux-arm64 -j20 | ||
|
||
- name: Linux - Cross-compile configure, gnu-linux-x64.cmake | ||
working-directory: ${{github.workspace}} | ||
run: cmake -B ./product/cache/gnu-linux-x64 -DCMAKE_TOOLCHAIN_FILE=${{github.workspace}}/toolchains/gnu-linux-x64.cmake -DAREG_EXTENDED:BOOL=ON | ||
|
||
- name: Linux - Cross-compile build, gnu-linux-x64.cmake | ||
working-directory: ${{github.workspace}} | ||
run: cmake --build ./product/cache/gnu-linux-x64 -j20 | ||
|
||
- name: Linux - Cross-compile configure, gnu-linux-x86.cmake | ||
working-directory: ${{github.workspace}} | ||
run: cmake -B ./product/cache/gnu-linux-x86 -DCMAKE_TOOLCHAIN_FILE=${{github.workspace}}/toolchains/gnu-linux-x86.cmake -DAREG_EXTENDED:BOOL=ON | ||
|
||
- name: Linux - Cross-compile build, gnu-linux-x86.cmake | ||
working-directory: ${{github.workspace}} | ||
run: cmake --build ./product/cache/gnu-linux-x86 -j20 | ||
|
||
- name: Linux - Cross-compile configure, clang-linux-arm32.cmake | ||
working-directory: ${{github.workspace}} | ||
run: cmake -B ./product/cache/clang-linux-arm32 -DCMAKE_TOOLCHAIN_FILE=${{github.workspace}}/toolchains/clang-linux-arm32.cmake -DAREG_EXTENDED:BOOL=ON | ||
|
||
- name: Linux - Cross-compile build, clang-linux-arm32.cmake | ||
working-directory: ${{github.workspace}} | ||
run: cmake --build ./product/cache/clang-linux-arm32 -j20 | ||
|
||
- name: Linux - Cross-compile configure, clang-linux-arm64.cmake | ||
working-directory: ${{github.workspace}} | ||
run: cmake -B ./product/cache/clang-linux-arm64 -DCMAKE_TOOLCHAIN_FILE=${{github.workspace}}/toolchains/clang-linux-arm64.cmake -DAREG_EXTENDED:BOOL=ON | ||
|
||
- name: Linux - Cross-compile build, clang-linux-arm64.cmake | ||
working-directory: ${{github.workspace}} | ||
run: cmake --build ./product/cache/clang-linux-arm64 -j20 | ||
|
||
- name: Linux - Cross-compile configure, clang-linux-x64.cmake | ||
working-directory: ${{github.workspace}} | ||
run: cmake -B ./product/cache/clang-linux-x64 -DCMAKE_TOOLCHAIN_FILE=${{github.workspace}}/toolchains/clang-linux-x64.cmake -DAREG_EXTENDED:BOOL=ON | ||
|
||
- name: Linux - Cross-compile build, clang-linux-x64.cmake | ||
working-directory: ${{github.workspace}} | ||
run: cmake --build ./product/cache/clang-linux-x64 -j20 | ||
|
||
- name: Linux - Cross-compile configure, clang-linux-x86.cmake | ||
working-directory: ${{github.workspace}} | ||
run: cmake -B ./product/cache/clang-linux-x86 -DCMAKE_TOOLCHAIN_FILE=${{github.workspace}}/toolchains/clang-linux-x86.cmake -DAREG_EXTENDED:BOOL=ON | ||
|
||
- name: Linux - Cross-compile build, clang-linux-x86.cmake | ||
working-directory: ${{github.workspace}} | ||
run: cmake --build ./product/cache/clang-linux-x86 -j20 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule areg-sdk
updated
12 files
+7 −8 | CMakeLists.txt | |
+47 −14 | conf/cmake/common.cmake | |
+418 −184 | conf/cmake/functions.cmake | |
+61 −22 | conf/cmake/install.cmake | |
+4 −0 | conf/cmake/setup.cmake | |
+39 −9 | conf/cmake/user.cmake | |
+6 −0 | conf/exports/config.cmake.in | |
+0 −16 | docs/wiki/02b-cmake-functions.md | |
+14 −12 | framework/areg/base/NEString.hpp | |
+1 −11 | framework/areglogger/CMakeLists.txt | |
+9 −12 | tests/CMakeLists.txt | |
+8 −5 | thirdparty/sqlite3/CMakeLists.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# This toolchain builds 32-bit binaries with Clang compiler for Linux on 32-bit ARM processor | ||
# Run example: | ||
# cmake -B ./product/cache/clang-linux-arm32 -DCMAKE_TOOLCHAIN_FILE=/path/to/areg-sdk-demo/toolchains/clang-linux-arm32.cmake | ||
# cmake --build ./product/cache/clang-linux-arm32 -j20 | ||
|
||
set(CMAKE_SYSTEM_NAME Linux) | ||
set(CMAKE_SYSTEM_PROCESSOR ARM) | ||
|
||
set(CMAKE_C_COMPILER clang) | ||
set(CMAKE_C_COMPILER_TARGET arm-linux-gnueabihf) | ||
set(CMAKE_CXX_COMPILER clang++) | ||
set(CMAKE_CXX_COMPILER_TARGET arm-linux-gnueabihf) | ||
|
||
set(CMAKE_FIND_ROOT_PATH "/usr") | ||
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) | ||
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) | ||
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) | ||
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) | ||
|
||
set(CMAKE_LIBRARY_ARCHITECTURE arm-linux-gnueabihf) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# This toolchain builds 64-bit binaries with Clang compiler for Linux on 64-bit ARM (AARCH64) processor. | ||
# Run example: | ||
# cmake -B ./product/cache/clang-linux-arm64 -DCMAKE_TOOLCHAIN_FILE=/path/to/areg-sdk-demo/toolchains/clang-linux-arm64.cmake | ||
# cmake --build ./product/cache/clang-linux-arm64 -j20 | ||
|
||
set(CMAKE_SYSTEM_NAME Linux) | ||
set(CMAKE_SYSTEM_PROCESSOR AARCH64) | ||
|
||
set(CMAKE_C_COMPILER clang) | ||
set(CMAKE_C_COMPILER_TARGET aarch64-linux-gnu) | ||
set(CMAKE_CXX_COMPILER clang++) | ||
set(CMAKE_CXX_COMPILER_TARGET aarch64-linux-gnu) | ||
|
||
set(CMAKE_FIND_ROOT_PATH "/usr") | ||
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) | ||
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) | ||
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) | ||
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) | ||
|
||
set(CMAKE_LIBRARY_ARCHITECTURE aarch64-linux-gnu) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,20 @@ | ||
# This toolchain builds 64-bit binaries with Clang compiler for Linux on x64 processor | ||
# This toolchain builds 64-bit binaries with Clang compiler for Linux on x86-64 processor | ||
# Run example: | ||
# cmake -B ./product/cache/clang-linux-x64 -DCMAKE_TOOLCHAIN_FILE=/path/to/areg-sdk-demo/toolchains/clang-linux-x64.cmake | ||
# cmake --build ./product/cache/clang-linux-x64 -j20 | ||
|
||
set(CMAKE_SYSTEM_NAME Linux) | ||
set(CMAKE_SYSTEM_PROCESSOR x64) | ||
set(CMAKE_SYSTEM_PROCESSOR x86_64) | ||
|
||
set(CMAKE_C_COMPILER clang) | ||
set(CMAKE_C_COMPILER_TARGET x86_64-linux-gnu) | ||
set(CMAKE_CXX_COMPILER clang++) | ||
set(CMAKE_FIND_ROOT_PATH /usr/bin) | ||
set(CMAKE_CXX_COMPILER_TARGET x86_64-linux-gnu) | ||
|
||
set(CMAKE_FIND_ROOT_PATH "/usr") | ||
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) | ||
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) | ||
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) | ||
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) | ||
|
||
set(CMAKE_LIBRARY_ARCHITECTURE x86_64-linux-gnu) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,21 @@ | ||
# This toolchain builds 64-bit binaries with Clang compiler for Windows on x64 processor | ||
# This toolchain builds 64-bit binaries with Clang compiler for Windows on x86-64 processor | ||
# Run example: | ||
# cmake -B ./product/cache/clang-win-x64 -DCMAKE_TOOLCHAIN_FILE=C:/path/to/areg-sdk-demo/toolchains/clang-win-x64.cmake | ||
# cmake --build ./product/cache/clang-win-x64 -j20 --config=Release | ||
|
||
set(CMAKE_SYSTEM_NAME Windows) | ||
set(CMAKE_SYSTEM_PROCESSOR AMD64) | ||
|
||
set(CMAKE_C_COMPILER clang-cl) | ||
set(CMAKE_CXX_COMPILER clang-cl) | ||
set(CMAKE_FIND_ROOT_PATH /) | ||
|
||
set(CMAKE_FIND_ROOT_PATH "/") | ||
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) | ||
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) | ||
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) | ||
set(CMAKE_GENERATOR_TOOLSET ClangCL CACHE INTERNAL "Force ClangCL tool-set") | ||
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) | ||
|
||
set(CMAKE_LIBRARY_ARCHITECTURE x64) | ||
|
||
set(CMAKE_GENERATOR_PLATFORM x64 CACHE INTERNAL "Force 64-bit compilation") | ||
set(CMAKE_GENERATOR_TOOLSET ClangCL CACHE INTERNAL "Force ClangCL tool-set") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,20 @@ | ||
# This toolchain builds 32-bit binaries with GNU compiler for Linux on 32-bit ARM processor | ||
# This toolchain builds 32-bit binaries with GNU g++/gcc compiler for Linux on 32-bit ARM processor | ||
# Run example: | ||
# cmake -B ./product/cache/gnu-linux-arm32 -DCMAKE_TOOLCHAIN_FILE=/path/to/areg-sdk-demo/toolchains/gnu-linux-arm32.cmake | ||
# cmake --build ./product/cache/gnu-linux-arm32 -j20 | ||
|
||
set(CMAKE_SYSTEM_NAME Linux) | ||
set(CMAKE_SYSTEM_PROCESSOR ARM) | ||
|
||
set(CMAKE_C_COMPILER arm-linux-gnueabihf-gcc) | ||
set(CMAKE_C_COMPILER_TARGET arm-linux-gnueabihf) | ||
set(CMAKE_CXX_COMPILER arm-linux-gnueabihf-g++) | ||
set(CMAKE_FIND_ROOT_PATH /usr/bin) | ||
set(CMAKE_CXX_COMPILER_TARGET arm-linux-gnueabihf) | ||
|
||
set(CMAKE_FIND_ROOT_PATH "/usr") | ||
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) | ||
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) | ||
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) | ||
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) | ||
|
||
set(CMAKE_LIBRARY_ARCHITECTURE arm-linux-gnueabihf) |
Oops, something went wrong.