summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorManuel Bentele2020-11-11 12:31:47 +0100
committerManuel Bentele2020-11-11 12:31:47 +0100
commit401be9c8b961cd4fcb6e5d58200dcd06a8c246b2 (patch)
tree4e3a92b2681d4d65ee2f49e46fa552460f36e6aa /cmake
parent[BUILD] build docker containers only if build of dnbd3-server is enabled (diff)
downloaddnbd3-401be9c8b961cd4fcb6e5d58200dcd06a8c246b2.tar.gz
dnbd3-401be9c8b961cd4fcb6e5d58200dcd06a8c246b2.tar.xz
dnbd3-401be9c8b961cd4fcb6e5d58200dcd06a8c246b2.zip
[BUILD] add CMake toolchain files to cross-compile for ppc and aarch64
Diffstat (limited to 'cmake')
-rw-r--r--cmake/toolchain/Aarch64LinuxGnu.cmake24
-rw-r--r--cmake/toolchain/PowerpcLinuxGnu.cmake24
2 files changed, 48 insertions, 0 deletions
diff --git a/cmake/toolchain/Aarch64LinuxGnu.cmake b/cmake/toolchain/Aarch64LinuxGnu.cmake
new file mode 100644
index 0000000..59c5f00
--- /dev/null
+++ b/cmake/toolchain/Aarch64LinuxGnu.cmake
@@ -0,0 +1,24 @@
+# SPDX-License-Identifier: GPL-2.0
+#
+# CMAKE toolchain file for cross compilation with aarch64-linux-gnu-gcc
+#
+# Copyright (C) 2020 Manuel Bentele <development@manuel-bentele.de>
+#
+
+set(CMAKE_SYSTEM_NAME Linux)
+set(CMAKE_SYSTEM_PROCESSOR aarch64)
+
+set(CMAKE_C_COMPILER aarch64-linux-gnu-gcc)
+set(CMAKE_CXX_COMPILER aarch64-linux-gnu-g++)
+set(CMAKE_LINKER aarch64-linux-gnu-ld)
+set(CMAKE_ASM_COMPILER aarch64-linux-gnu-as)
+set(CMAKE_OBJCOPY aarch64-linux-gnu-objcopy)
+set(CMAKE_STRIP aarch64-linux-gnu-strip)
+set(CMAKE_CPP aarch64-linux-gnu-cpp)
+
+# path of headers and libraries for aarch64-linux-gnu target
+set(CMAKE_FIND_ROOT_PATH "/usr/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)
diff --git a/cmake/toolchain/PowerpcLinuxGnu.cmake b/cmake/toolchain/PowerpcLinuxGnu.cmake
new file mode 100644
index 0000000..d3c1ca5
--- /dev/null
+++ b/cmake/toolchain/PowerpcLinuxGnu.cmake
@@ -0,0 +1,24 @@
+# SPDX-License-Identifier: GPL-2.0
+#
+# CMAKE toolchain file for cross compilation with powerpc-linux-gnu-gcc
+#
+# Copyright (C) 2020 Manuel Bentele <development@manuel-bentele.de>
+#
+
+set(CMAKE_SYSTEM_NAME Linux)
+set(CMAKE_SYSTEM_PROCESSOR ppc)
+
+set(CMAKE_C_COMPILER powerpc-linux-gnu-gcc)
+set(CMAKE_CXX_COMPILER powerpc-linux-gnu-g++)
+set(CMAKE_LINKER powerpc-linux-gnu-ld)
+set(CMAKE_ASM_COMPILER powerpc-linux-gnu-as)
+set(CMAKE_OBJCOPY powerpc-linux-gnu-objcopy)
+set(CMAKE_STRIP powerpc-linux-gnu-strip)
+set(CMAKE_CPP powerpc-linux-gnu-cpp)
+
+# path of headers and libraries for powerpc-linux-gnu target
+set(CMAKE_FIND_ROOT_PATH "/usr/powerpc-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)