meta-raspberrypi/recipes-multimedia/libcamera-apps/rpi-libcamera-apps_git.bb
Martin Jansa f16219293a rpi-libcamera-apps: fix flags used in aarch64 builds
* the CMakeLists.txt recognizes only 2 values:

IF (NOT ENABLE_COMPILE_FLAGS_FOR_TARGET)
    # On a Pi this will give us armhf or arm64.
    execute_process(COMMAND dpkg-architecture -qDEB_HOST_ARCH
        OUTPUT_VARIABLE ENABLE_COMPILE_FLAGS_FOR_TARGET OUTPUT_STRIP_TRAILING_WHITESPACE)
endif()
message(STATUS "Platform: ${ENABLE_COMPILE_FLAGS_FOR_TARGET}")
if ("${ENABLE_COMPILE_FLAGS_FOR_TARGET}" STREQUAL "arm64")
    # 64-bit binaries can be fully optimised.
    add_definitions(-ftree-vectorize)
elseif ("${ENABLE_COMPILE_FLAGS_FOR_TARGET}" STREQUAL "armv8-neon")
    # Only build with 32-bit Pi 3/4 specific optimisations if requested on the command line.
    add_definitions(-mfpu=neon-fp-armv8 -ftree-vectorize)
endif()

  the value from dpkg-architecture on host is useless
  when cross-compiling, so we always need to pass something

  for raspberrypi4-64 we were passing "armv8-neon" which results in:
  aarch64-oe-linux-g++: error: unrecognized command-line option '-mfpu=neon-fp-armv8'
  as all -mfpu options are rejected in aarch64 builds, pass better
  ENABLE_COMPILE_FLAGS_FOR_TARGET value for all MACHINEs

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
2023-05-15 15:56:03 +01:00

47 lines
1.4 KiB
BlitzBasic

SUMMARY = "A suite of libcamera-based apps for the Raspberry Pi"
DESCRIPTION = "This is a small suite of libcamera-based apps that aim to \
copy the functionality of the existing \"raspicam\" apps."
HOMEPAGE = "https://github.com/raspberrypi/libcamera-apps"
SECTION = "console/utils"
LICENSE = "BSD-2-Clause"
LIC_FILES_CHKSUM = "file://license.txt;md5=a0013d1b383d72ba4bdc5b750e7d1d77"
SRC_URI = "\
git://github.com/raspberrypi/libcamera-apps.git;protocol=https;branch=main \
"
SRCREV = "22a52590c33a813743b4e6337478c208201c77b1"
S = "${WORKDIR}/git"
COMPATIBLE_MACHINE = "^rpi$"
DEPENDS = "libcamera libexif jpeg tiff libpng boost"
inherit cmake pkgconfig
EXTRA_OECMAKE = "\
-DCMAKE_BUILD_TYPE=Release \
-DBoost_INCLUDE_DIR=${STAGING_INCDIR} \
-DCMAKE_LIBRARY_PATH=${STAGING_LIBDIR} \
"
LIBCAMERA_ARCH = "${TARGET_ARCH}"
LIBCAMERA_ARCH:aarch64 = "arm64"
LIBCAMERA_ARCH:arm = "armv8-neon"
EXTRA_OECMAKE += "-DENABLE_COMPILE_FLAGS_FOR_TARGET=${LIBCAMERA_ARCH}"
PACKAGECONFIG[x11] = "-DENABLE_X11=1,-DENABLE_X11=0"
PACKAGECONFIG[qt] = "-DENABLE_QT=1,-DENABLE_QT=0"
PACKAGECONFIG[opencv] = "-DENABLE_OPENCV=1,-DENABLE_OPENCV=0"
PACKAGECONFIG[tensorflow-lite] = "-DENABLE_TFLITE=1,-DENABLE_TFLITE=0"
# Build does not version solibs so we need to change the suffix
SOLIBS = ".so"
FILES_SOLIBSDEV = ""
do_install:append() {
# Requires python3-core which not all systems may have
rm ${D}/${bindir}/camera-bug-report
}