aboutsummaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2019-04-08 04:40:02 +0200
committerSven Gothel <[email protected]>2019-04-08 04:40:02 +0200
commit8915501ed02eac2b3bce9a7fc06cb1ab562901c3 (patch)
tree8fa1b70c0f1a90e0cf8b928a340f18d6d64e4f1f /cmake
parent73233ce69919fc19c53ce8663c5b8cc05227f07e (diff)
Skip native build time executables when crosscompiling; Fix aarch64 + armv6hf toolchain files
Diffstat (limited to 'cmake')
-rw-r--r--cmake/toolchain.linux-gcc-aarch64.cmake (renamed from cmake/toolchain.gcc-aarch64.cmake)12
-rw-r--r--cmake/toolchain.linux-gcc-armv6hf.cmake (renamed from cmake/toolchain.gcc-armv6hf.cmake)12
2 files changed, 18 insertions, 6 deletions
diff --git a/cmake/toolchain.gcc-aarch64.cmake b/cmake/toolchain.linux-gcc-aarch64.cmake
index 44b9d47b..74c2b07c 100644
--- a/cmake/toolchain.gcc-aarch64.cmake
+++ b/cmake/toolchain.linux-gcc-aarch64.cmake
@@ -1,12 +1,18 @@
# For normal gcc compilation, but use static-libgcc
-set(CMAKE_C_FLAGS "-fpic -march=armv8-a -include ${PROJECT_SOURCE_DIR}/cmake/glibc-compat-symbols.h -I/usr/include")
-set(CMAKE_CXX_FLAGS "-fpic -march=armv8-a -include ${PROJECT_SOURCE_DIR}/cmake/glibc-compat-symbols.h -I/usr/include")
+set(CMAKE_SYSTEM_NAME Linux)
+set(CMAKE_SYSTEM_VERSION 1)
+
+set(CMAKE_FIND_ROOT_PATH ${TARGET_PLATFORM_SYSROOT} ${TARGET_PLATFORM_USRROOT})
+
+# -idirafter will be searched after implicit system-dir include '-I =/usr/include' from TARGET_PLATFORM_SYSROOT
+set(CMAKE_C_FLAGS "-fpic -march=armv8-a -include ${PROJECT_SOURCE_DIR}/cmake/glibc-compat-symbols.h -idirafter /usr/include")
+set(CMAKE_CXX_FLAGS "-fpic -march=armv8-a -include ${PROJECT_SOURCE_DIR}/cmake/glibc-compat-symbols.h -idirafter /usr/include")
set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS}" CACHE STRING "c++ flags")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}" CACHE STRING "c flags")
-set(LINKER_FLAGS "-fpic -march=armv8-a -static-libgcc")
+set(LINKER_FLAGS "-fpic -march=armv8-a -static-libgcc -L${TARGET_PLATFORM_USRLIBS} -static-libgcc")
set(CMAKE_SHARED_LINKER_FLAGS "${LINKER_FLAGS}" CACHE STRING "linker flags" FORCE)
set(CMAKE_MODULE_LINKER_FLAGS "${LINKER_FLAGS}" CACHE STRING "linker flags" FORCE)
diff --git a/cmake/toolchain.gcc-armv6hf.cmake b/cmake/toolchain.linux-gcc-armv6hf.cmake
index 7648aa4d..a9fe01e8 100644
--- a/cmake/toolchain.gcc-armv6hf.cmake
+++ b/cmake/toolchain.linux-gcc-armv6hf.cmake
@@ -1,12 +1,18 @@
# For normal gcc compilation, but use static-libgcc
-set(CMAKE_C_FLAGS "-fpic -march=armv6 -mfpu=vfp -mfloat-abi=hard -marm -include ${PROJECT_SOURCE_DIR}/cmake/glibc-compat-symbols.h -I/usr/include")
-set(CMAKE_CXX_FLAGS "-fpic -march=armv6 -mfpu=vfp -mfloat-abi=hard -marm -include ${PROJECT_SOURCE_DIR}/cmake/glibc-compat-symbols.h -I/usr/include")
+set(CMAKE_SYSTEM_NAME Linux)
+set(CMAKE_SYSTEM_VERSION 1)
+
+set(CMAKE_FIND_ROOT_PATH ${TARGET_PLATFORM_SYSROOT} ${TARGET_PLATFORM_USRROOT})
+
+# -idirafter will be searched after implicit system-dir include '-I =/usr/include' from TARGET_PLATFORM_SYSROOT
+set(CMAKE_C_FLAGS "-fpic -march=armv6 -mfpu=vfp -mfloat-abi=hard -marm -include ${PROJECT_SOURCE_DIR}/cmake/glibc-compat-symbols.h -idirafter /usr/include")
+set(CMAKE_CXX_FLAGS "-fpic -march=armv6 -mfpu=vfp -mfloat-abi=hard -marm -include ${PROJECT_SOURCE_DIR}/cmake/glibc-compat-symbols.h -idirafter /usr/include")
set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS}" CACHE STRING "c++ flags")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}" CACHE STRING "c flags")
-set(LINKER_FLAGS "-fpic -march=armv6 -mfpu=vfp -mfloat-abi=hard -marm -static-libgcc")
+set(LINKER_FLAGS "-fpic -march=armv6 -mfpu=vfp -mfloat-abi=hard -marm -static-libgcc -L${TARGET_PLATFORM_USRLIBS} -static-libgcc")
set(CMAKE_SHARED_LINKER_FLAGS "${LINKER_FLAGS}" CACHE STRING "linker flags" FORCE)
set(CMAKE_MODULE_LINKER_FLAGS "${LINKER_FLAGS}" CACHE STRING "linker flags" FORCE)