aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt7
-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
3 files changed, 25 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 984ec821..4fb2be56 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1289,6 +1289,8 @@ ELSE()
"${OpenAL_BINARY_DIR}/version.h")
ENDIF()
+IF(NOT CMAKE_CROSSCOMPILING)
+
SET(NATIVE_SRC_DIR "${OpenAL_SOURCE_DIR}/native-tools/")
SET(NATIVE_BIN_DIR "${OpenAL_BINARY_DIR}/native-tools/")
FILE(MAKE_DIRECTORY "${NATIVE_BIN_DIR}")
@@ -1349,6 +1351,11 @@ IF(ALSOFT_EXAMPLES)
ENDIF()
ENDIF()
+# For crosscompiling, caller must provide the bsinc_inc.h file
+# SET(ALC_OBJS ${ALC_OBJS} "${OpenAL_BINARY_DIR}/bsinc_inc.h")
+
+ENDIF(NOT CMAKE_CROSSCOMPILING)
+
IF(NOT WIN32)
SET(LIBNAME "openal")
ELSE()
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)