Use env variable instead hardcoded variable in toolchain.cmake

Use env variable instead hardcoded variable in toolchain.cmake

Signed-off-by: Bensuperpc <bensuperpc@gmail.com>
This commit is contained in:
Bensuperpc 2021-08-12 21:38:43 +02:00
parent 95c12a3a87
commit 5663ada809
17 changed files with 35 additions and 32 deletions

View File

@ -3,7 +3,7 @@ set(CMAKE_SYSTEM_VERSION 1)
set(CMAKE_SYSTEM_PROCESSOR armv7-a) set(CMAKE_SYSTEM_PROCESSOR armv7-a)
set(CMAKE_ANDROID_ARCH_ABI armeabi-v7a) set(CMAKE_ANDROID_ARCH_ABI armeabi-v7a)
set(cross_triple arm-linux-androideabi) set(cross_triple $ENV{CROSS_TRIPLE})
set(CMAKE_ANDROID_STANDALONE_TOOLCHAIN $ENV{CROSS_ROOT}) set(CMAKE_ANDROID_STANDALONE_TOOLCHAIN $ENV{CROSS_ROOT})
set(CMAKE_ANDROID_ARM_MODE ON) set(CMAKE_ANDROID_ARM_MODE ON)
set(CMAKE_ANDROID_ARM_NEON ON) set(CMAKE_ANDROID_ARM_NEON ON)

View File

@ -3,7 +3,7 @@ set(CMAKE_SYSTEM_VERSION 1)
set(CMAKE_SYSTEM_PROCESSOR aarch64) set(CMAKE_SYSTEM_PROCESSOR aarch64)
set(CMAKE_ANDROID_ARCH_ABI arm64-v8a) set(CMAKE_ANDROID_ARCH_ABI arm64-v8a)
set(cross_triple aarch64-linux-android) set(cross_triple $ENV{CROSS_TRIPLE})
set(CMAKE_ANDROID_STANDALONE_TOOLCHAIN $ENV{CROSS_ROOT}) set(CMAKE_ANDROID_STANDALONE_TOOLCHAIN $ENV{CROSS_ROOT})
set(CMAKE_ANDROID_ARM_MODE ON) set(CMAKE_ANDROID_ARM_MODE ON)
set(CMAKE_ANDROID_ARM_NEON ON) set(CMAKE_ANDROID_ARM_NEON ON)

View File

@ -3,7 +3,7 @@ set(CMAKE_SYSTEM_VERSION 1)
set(CMAKE_SYSTEM_PROCESSOR i686) set(CMAKE_SYSTEM_PROCESSOR i686)
set(CMAKE_ANDROID_ARCH_ABI x86) set(CMAKE_ANDROID_ARCH_ABI x86)
set(cross_triple i686-linux-android) set(cross_triple $ENV{CROSS_TRIPLE})
set(CMAKE_ANDROID_STANDALONE_TOOLCHAIN $ENV{CROSS_ROOT}) set(CMAKE_ANDROID_STANDALONE_TOOLCHAIN $ENV{CROSS_ROOT})
set(CMAKE_ANDROID_ARM_MODE ON) set(CMAKE_ANDROID_ARM_MODE ON)
set(CMAKE_ANDROID_ARM_NEON ON) set(CMAKE_ANDROID_ARM_NEON ON)

View File

@ -3,7 +3,7 @@ set(CMAKE_SYSTEM_VERSION 1)
set(CMAKE_SYSTEM_PROCESSOR x86_64) set(CMAKE_SYSTEM_PROCESSOR x86_64)
set(CMAKE_ANDROID_ARCH_ABI x86_64) set(CMAKE_ANDROID_ARCH_ABI x86_64)
set(cross_triple x86_64-linux-android) set(cross_triple $ENV{CROSS_TRIPLE})
set(CMAKE_ANDROID_STANDALONE_TOOLCHAIN $ENV{CROSS_ROOT}) set(CMAKE_ANDROID_STANDALONE_TOOLCHAIN $ENV{CROSS_ROOT})
set(CMAKE_ANDROID_ARM_MODE ON) set(CMAKE_ANDROID_ARM_MODE ON)
set(CMAKE_ANDROID_ARM_NEON ON) set(CMAKE_ANDROID_ARM_NEON ON)

View File

@ -2,8 +2,8 @@ set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_VERSION 1) set(CMAKE_SYSTEM_VERSION 1)
set(CMAKE_SYSTEM_PROCESSOR aarch64) set(CMAKE_SYSTEM_PROCESSOR aarch64)
set(cross_triple "aarch64-buildroot-linux-gnu") set(cross_triple $ENV{CROSS_TRIPLE})
set(cross_root /buildroot) set(cross_root $ENV{CROSS_ROOT})
set(CMAKE_C_COMPILER $ENV{CC}) set(CMAKE_C_COMPILER $ENV{CC})
set(CMAKE_CXX_COMPILER $ENV{CXX}) set(CMAKE_CXX_COMPILER $ENV{CXX})
@ -13,9 +13,8 @@ set(CMAKE_CXX_FLAGS "-I ${cross_root}/include/")
set(CMAKE_FIND_ROOT_PATH ${cross_root} ${cross_root}/${cross_triple}) set(CMAKE_FIND_ROOT_PATH ${cross_root} ${cross_root}/${cross_triple})
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY BOTH)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE BOTH)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
set(CMAKE_SYSROOT ${cross_root}/${cross_triple}/sysroot) set(CMAKE_SYSROOT ${cross_root}/${cross_triple}/sysroot)

View File

@ -1,8 +1,9 @@
set(CMAKE_SYSTEM_NAME Linux) set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_VERSION 1) set(CMAKE_SYSTEM_VERSION 1)
set(CMAKE_SYSTEM_PROCESSOR arm) set(CMAKE_SYSTEM_PROCESSOR arm)
set(cross_triple "armv5-unknown-linux-gnueabi")
set(cross_root /usr/xcc/${cross_triple}) set(cross_triple $ENV{CROSS_TRIPLE})
set(cross_root $ENV{CROSS_ROOT})
set(CMAKE_C_COMPILER $ENV{CC}) set(CMAKE_C_COMPILER $ENV{CC})
set(CMAKE_CXX_COMPILER $ENV{CXX}) set(CMAKE_CXX_COMPILER $ENV{CXX})

View File

@ -1,8 +1,9 @@
set(CMAKE_SYSTEM_NAME Linux) set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_VERSION 1) set(CMAKE_SYSTEM_VERSION 1)
set(CMAKE_SYSTEM_PROCESSOR arm) set(CMAKE_SYSTEM_PROCESSOR arm)
set(cross_triple "armv6-unknown-linux-gnueabihf")
set(cross_root /usr/xcc/${cross_triple}) set(cross_triple $ENV{CROSS_TRIPLE})
set(cross_root $ENV{CROSS_ROOT})
set(CMAKE_C_COMPILER $ENV{CC}) set(CMAKE_C_COMPILER $ENV{CC})
set(CMAKE_CXX_COMPILER $ENV{CXX}) set(CMAKE_CXX_COMPILER $ENV{CXX})

View File

@ -1,8 +1,9 @@
set(CMAKE_SYSTEM_NAME Linux) set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_VERSION 1) set(CMAKE_SYSTEM_VERSION 1)
set(CMAKE_SYSTEM_PROCESSOR arm) set(CMAKE_SYSTEM_PROCESSOR arm)
set(cross_triple "armv7-unknown-linux-gnueabi")
set(cross_root /usr/xcc/${cross_triple}) set(cross_triple $ENV{CROSS_TRIPLE})
set(cross_root $ENV{CROSS_ROOT})
set(CMAKE_C_COMPILER $ENV{CC}) set(CMAKE_C_COMPILER $ENV{CC})
set(CMAKE_CXX_COMPILER $ENV{CXX}) set(CMAKE_CXX_COMPILER $ENV{CXX})

View File

@ -1,8 +1,9 @@
set(CMAKE_SYSTEM_NAME Linux) set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_VERSION 1) set(CMAKE_SYSTEM_VERSION 1)
set(CMAKE_SYSTEM_PROCESSOR arm) set(CMAKE_SYSTEM_PROCESSOR arm)
set(cross_triple "arm-cortexa8_neon-linux-gnueabihf")
set(cross_root /usr/xcc/${cross_triple}) set(cross_triple $ENV{CROSS_TRIPLE})
set(cross_root $ENV{CROSS_ROOT})
set(CMAKE_C_COMPILER $ENV{CC}) set(CMAKE_C_COMPILER $ENV{CC})
set(CMAKE_CXX_COMPILER $ENV{CXX}) set(CMAKE_CXX_COMPILER $ENV{CXX})

View File

@ -2,8 +2,8 @@ set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_VERSION 1) set(CMAKE_SYSTEM_VERSION 1)
set(CMAKE_SYSTEM_PROCESSOR mk68) set(CMAKE_SYSTEM_PROCESSOR mk68)
set(cross_triple "m68k-unknown-uclinux-uclibc") set(cross_triple $ENV{CROSS_TRIPLE})
set(cross_root /usr/xcc/${cross_triple}) set(cross_root $ENV{CROSS_ROOT})
set(CMAKE_C_COMPILER $ENV{CC}) set(CMAKE_C_COMPILER $ENV{CC})
set(CMAKE_CXX_COMPILER $ENV{CXX}) set(CMAKE_CXX_COMPILER $ENV{CXX})

View File

@ -2,8 +2,8 @@ set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_VERSION 1) set(CMAKE_SYSTEM_VERSION 1)
set(CMAKE_SYSTEM_PROCESSOR mips) set(CMAKE_SYSTEM_PROCESSOR mips)
set(cross_triple "mips-unknown-linux-gnu") set(cross_triple $ENV{CROSS_TRIPLE})
set(cross_root /usr/xcc/${cross_triple}) set(cross_root $ENV{CROSS_ROOT})
set(CMAKE_C_COMPILER $ENV{CC}) set(CMAKE_C_COMPILER $ENV{CC})
set(CMAKE_CXX_COMPILER $ENV{CXX}) set(CMAKE_CXX_COMPILER $ENV{CXX})

View File

@ -2,8 +2,8 @@ set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_VERSION 1) set(CMAKE_SYSTEM_VERSION 1)
set(CMAKE_SYSTEM_PROCESSOR ppc64le) set(CMAKE_SYSTEM_PROCESSOR ppc64le)
set(cross_triple "powerpc64le-unknown-linux-gnu") set(cross_triple $ENV{CROSS_TRIPLE})
set(cross_root /usr/xcc/${cross_triple}) set(cross_root $ENV{CROSS_ROOT})
set(CMAKE_C_COMPILER $ENV{CC}) set(CMAKE_C_COMPILER $ENV{CC})
set(CMAKE_CXX_COMPILER $ENV{CXX}) set(CMAKE_CXX_COMPILER $ENV{CXX})

View File

@ -2,8 +2,8 @@ set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_VERSION 1) set(CMAKE_SYSTEM_VERSION 1)
set(CMAKE_SYSTEM_PROCESSOR riscv32) set(CMAKE_SYSTEM_PROCESSOR riscv32)
set(cross_triple "riscv32-unknown-linux-gnu") set(cross_triple $ENV{CROSS_TRIPLE})
set(cross_root /usr/xcc/${cross_triple}) set(cross_root $ENV{CROSS_ROOT})
set(CMAKE_C_COMPILER $ENV{CC}) set(CMAKE_C_COMPILER $ENV{CC})
set(CMAKE_CXX_COMPILER $ENV{CXX}) set(CMAKE_CXX_COMPILER $ENV{CXX})

View File

@ -2,8 +2,8 @@ set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_VERSION 1) set(CMAKE_SYSTEM_VERSION 1)
set(CMAKE_SYSTEM_PROCESSOR riscv64) set(CMAKE_SYSTEM_PROCESSOR riscv64)
set(cross_triple "riscv64-unknown-linux-gnu") set(cross_triple $ENV{CROSS_TRIPLE})
set(cross_root /usr/xcc/${cross_triple}) set(cross_root $ENV{CROSS_ROOT})
set(CMAKE_C_COMPILER $ENV{CC}) set(CMAKE_C_COMPILER $ENV{CC})
set(CMAKE_CXX_COMPILER $ENV{CXX}) set(CMAKE_CXX_COMPILER $ENV{CXX})

View File

@ -2,8 +2,8 @@ set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_VERSION 1) set(CMAKE_SYSTEM_VERSION 1)
set(CMAKE_SYSTEM_PROCESSOR s390x) set(CMAKE_SYSTEM_PROCESSOR s390x)
set(cross_triple "s390x-ibm-linux-gnu") set(cross_triple $ENV{CROSS_TRIPLE})
set(cross_root /usr/xcc/${cross_triple}) set(cross_root $ENV{CROSS_ROOT})
set(CMAKE_C_COMPILER $ENV{CC}) set(CMAKE_C_COMPILER $ENV{CC})
set(CMAKE_CXX_COMPILER $ENV{CXX}) set(CMAKE_CXX_COMPILER $ENV{CXX})

View File

@ -2,8 +2,8 @@ set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_VERSION 1) set(CMAKE_SYSTEM_VERSION 1)
set(CMAKE_SYSTEM_PROCESSOR xtensa) set(CMAKE_SYSTEM_PROCESSOR xtensa)
set(cross_triple "xtensa-fsf-linux-uclibc") set(cross_triple $ENV{CROSS_TRIPLE})
set(cross_root /usr/xcc/${cross_triple}) set(cross_root $ENV{CROSS_ROOT})
set(CMAKE_C_COMPILER $ENV{CC}) set(CMAKE_C_COMPILER $ENV{CC})
set(CMAKE_CXX_COMPILER $ENV{CXX}) set(CMAKE_CXX_COMPILER $ENV{CXX})