Dockerfiles/resources/raspberrypi.cmake
2022-12-29 20:56:33 +08:00

32 lines
1.3 KiB
CMake

include_guard(GLOBAL)
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR arm)
set(COMPILER_ROOT /opt/gcc-arm-10.2-2020.11-x86_64-arm-none-linux-gnueabihf)
set(CMAKE_SYSROOT /opt/RaspberryPi/sysroot)
set(CMAKE_C_COMPILER ${COMPILER_ROOT}/bin/arm-none-linux-gnueabihf-gcc)
set(CMAKE_CXX_COMPILER ${COMPILER_ROOT}/bin/arm-none-linux-gnueabihf-g++)
set(CMAKE_ASM_COMPILER ${COMPILER_ROOT}/bin/arm-none-linux-gnueabihf-as)
set(RUNTIME_PATH ${CMAKE_SYSROOT}/usr/lib/arm-linux-gnueabihf)
set(CROSSLINK
-Wl,-rpath=${RUNTIME_PATH}
-Wl,-rpath-link=${RUNTIME_PATH}
-Wl,-rpath=${CMAKE_SYSROOT}/lib
-Wl,-rpath=${CMAKE_SYSROOT}/lib/arm-linux-gnueabihf
ssl
crypto stdc++fs dl m
)
list(APPEND CMAKE_C_FLAGS "-march=armv7-a -mfpu=neon -mfloat-abi=hard -I${CMAKE_SYSROOT}/usr/include/arm-linux-gnueabihf")
list(APPEND CMAKE_CXX_FLAGS "-march=armv7-a -mfpu=neon -mfloat-abi=hard -I${CMAKE_SYSROOT}/usr/include/arm-linux-gnueabihf -I${CMAKE_SYSROOT}/usr/include/freetype2 -L${CMAKE_SYSROOT}/usr/lib/arm-linux-gnueabihf")
set(ENV{PKG_CONFIG_PATH} "")
set(ENV{PKG_CONFIG_LIBDIR} ${CMAKE_SYSROOT}/usr/lib/pkgconfig:${CMAKE_SYSROOT}/usr/share/pkgconfig:${CMAKE_SYSROOT}/usr/lib/arm-linux-gnueabihf/pkgconfig:${CMAKE_SYSROOT}/opt/vc/lib/pkgconfig)
set(ENV{PKG_CONFIG_SYSROOT_DIR} ${CMAKE_SYSROOT})