mirror of
https://github.com/Fishwaldo/meta-riscv.git
synced 2025-03-15 11:31:43 +00:00
libsf-omxil: introduce CMake for better building
This commit is contained in:
parent
c80df081ea
commit
70dd23e30d
3 changed files with 77 additions and 69 deletions
|
@ -9,14 +9,14 @@ COMPATIBLE_MACHINE = "visionfive2"
|
|||
PROVIDES = "virtual/libomxil"
|
||||
|
||||
require recipes-bsp/common/visionfive2-firmware.inc
|
||||
inherit autotools
|
||||
inherit cmake
|
||||
|
||||
SOLIBS = ".so"
|
||||
FILES_SOLIBSDEV = ""
|
||||
INSANE_SKIP:${PN} += "dev-so"
|
||||
|
||||
SRC_URI += " \
|
||||
file://0001-Adapt-Makefile-for-usage-in-Yocto.patch;subdir=git/omx-il \
|
||||
file://CMakeLists.txt;subdir=git/omx-il \
|
||||
"
|
||||
|
||||
S = "${WORKDIR}/git/omx-il"
|
||||
|
@ -33,18 +33,8 @@ RDEPENDS:${PN} += " \
|
|||
libsf-codaj12 \
|
||||
"
|
||||
|
||||
do_compile() {
|
||||
oe_runmake -C ${S} STAGING_DIR=${WORKDIR}/recipe-sysroot/
|
||||
}
|
||||
|
||||
do_install() {
|
||||
install -d ${D}/usr/include/khronos
|
||||
for i in $(ls ${S}/include/khronos); do
|
||||
install -m 0644 ${S}/include/khronos/${i} ${D}/usr/include/khronos
|
||||
done
|
||||
install -d ${D}/usr/lib/
|
||||
install -m 0644 ${S}/libsf-omx-il.so ${D}/usr/lib/libsf-omx-il.so
|
||||
ln -s -r ${D}/libsf-omx-il.so ${D}/usr/lib/libOMX_Core.so
|
||||
do_install:append() {
|
||||
ln -s -r -f ${D}/usr/lib/libsf-omx-il.so ${D}/usr/lib/libOMX_Core.so
|
||||
}
|
||||
|
||||
FILES:${PN} += " \
|
||||
|
|
|
@ -1,55 +0,0 @@
|
|||
From 9aaac1de1bdb8881d281f539105d61b2271c589a Mon Sep 17 00:00:00 2001
|
||||
From: Andreas Cord-Landwehr <cordlandwehr@kde.org>
|
||||
Date: Thu, 26 Jan 2023 19:52:37 +0100
|
||||
Subject: [PATCH] Adapt Makefile for usage in Yocto
|
||||
|
||||
---
|
||||
Makefile | 10 +++++-----
|
||||
1 file changed, 5 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index 150c4d5..6f9dd86 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -10,11 +10,11 @@ BUILD_CONFIGURATION := EmbeddedRiscvLinux
|
||||
PRODUCT := OMX_IL
|
||||
|
||||
ifeq ("$(BUILD_CONFIGURATION)", "EmbeddedRiscvLinux")
|
||||
- CROSS_CC_PREFIX = riscv64-buildroot-linux-gnu-
|
||||
+ CROSS_CC_PREFIX = riscv64-poky-linux-
|
||||
PLATFORM = riscvlinux
|
||||
endif
|
||||
-CC = $(CROSS_CC_PREFIX)gcc
|
||||
-CXX = $(CROSS_CC_PREFIX)g++
|
||||
+#CC = $(CROSS_CC_PREFIX)gcc
|
||||
+#CXX = $(CROSS_CC_PREFIX)g++
|
||||
LINKER=$(CC)
|
||||
AR = $(CROSS_CC_PREFIX)ar
|
||||
|
||||
@@ -33,7 +33,7 @@ INCLUDES += -I./component/image/common
|
||||
CFLAGS += -g -I. $(INCLUDES) $(DEFINES) $(PLATFORM_FLAGS)
|
||||
CFLAGS += -fpic
|
||||
ARFLAGS += cru
|
||||
-LDFLAGS = -ldl -lpthread -Wl,--fatal-warning
|
||||
+#LDFLAGS = -ldl -lpthread -Wl,--fatal-warning
|
||||
LDFLAGS_FFMPEG = -lavformat -lavcodec -lavutil -lswresample
|
||||
|
||||
OBJDIR=obj
|
||||
@@ -81,7 +81,7 @@ OBJECTPATHS_MJPEG_DEC_TEST=$(addprefix $(OBJDIR)/,$(notdir $(OBJECTNAMES_MJPEG_D
|
||||
all: omx-il
|
||||
|
||||
omx-il: CREATE_DIR $(OBJECTPATHS_COMMON)
|
||||
- $(CC) -g -fPIC -shared -o libsf-omx-il.so $(OBJECTPATHS_COMMON)
|
||||
+ $(CC) -g -fPIC -shared -o libsf-omx-il.so $(LDFLAGS) $(OBJECTPATHS_COMMON)
|
||||
|
||||
test: video-dec-test video-enc-test mjpeg-dec-test
|
||||
|
||||
@@ -100,4 +100,4 @@ CREATE_DIR:
|
||||
-mkdir -p $(OBJDIR)
|
||||
|
||||
obj/%.o: %.c $(MAKEFILE)
|
||||
- $(CC) $(CFLAGS) -Wall -Werror -c $< -o $@ -MD -MF $(@:.o=.dep)
|
||||
+ $(CC) $(CFLAGS) -Wall -c $< -o $@ -MD -MF $(@:.o=.dep)
|
||||
--
|
||||
2.37.2
|
||||
|
73
recipes-multimedia/vpu/libsf-omxil/CMakeLists.txt
Normal file
73
recipes-multimedia/vpu/libsf-omxil/CMakeLists.txt
Normal file
|
@ -0,0 +1,73 @@
|
|||
cmake_minimum_required(VERSION 3.16)
|
||||
project(omx-il)
|
||||
|
||||
find_path(WAVE4_INCLUDE_PATH wave420l/config.h)
|
||||
message("Found WAVE420l headers at: ${WAVE4_INCLUDE_PATH}/wave420l/")
|
||||
|
||||
find_path(WAVE5_INCLUDE_PATH wave511/config.h)
|
||||
message("Found WAVE511 headers at: ${WAVE5_INCLUDE_PATH}/wave511/")
|
||||
|
||||
find_path(JPU_INCLUDE_PATH codaj12/config.h)
|
||||
message("Found CODAJ12 headers at: ${JPU_INCLUDE_PATH}/codaj12/")
|
||||
|
||||
add_definitions(
|
||||
-DUSE_FEEDING_METHOD_BUFFER
|
||||
)
|
||||
|
||||
include_directories(
|
||||
${CMAKE_SOURCE_DIR}/core/
|
||||
${CMAKE_SOURCE_DIR}/component/video/wave5/common/
|
||||
${CMAKE_SOURCE_DIR}/component/video/wave5/dec/
|
||||
${CMAKE_SOURCE_DIR}/component/video/wave4
|
||||
${CMAKE_SOURCE_DIR}/component/helper/
|
||||
${CMAKE_SOURCE_DIR}/component/image/common/
|
||||
${CMAKE_SOURCE_DIR}/component/image/dec/
|
||||
${CMAKE_SOURCE_DIR}/include/khronos/
|
||||
|
||||
${WAVE4_INCLUDE_PATH}/wave420l/
|
||||
${WAVE4_INCLUDE_PATH}/wave420l/vpuapi/
|
||||
${WAVE4_INCLUDE_PATH}/wave420l/sample/helper/
|
||||
|
||||
${WAVE5_INCLUDE_PATH}/wave511/sample_v2/component/
|
||||
${WAVE5_INCLUDE_PATH}/wave511/sample_v2/helper/
|
||||
|
||||
${JPU_INCLUDE_PATH}/codaj12/jpuapi/
|
||||
${JPU_INCLUDE_PATH}/codaj12/sample/helper/
|
||||
)
|
||||
|
||||
set(library_SRCS
|
||||
core/SF_OMX_Core.c
|
||||
component/video/wave5/common/SF_OMX_video_common.c
|
||||
component/video/wave5/dec/SF_OMX_Vdec_decoder.c
|
||||
component/video/wave4/SF_OMX_Wave420L_encoder.c
|
||||
component/helper/sf_queue.c
|
||||
component/helper/sf_thread.c
|
||||
component/helper/sf_semaphore.c
|
||||
|
||||
#mjpeg
|
||||
component/image/common/SF_OMX_mjpeg_common.c
|
||||
component/image/dec/SF_OMX_Mjpeg_decoder.c
|
||||
)
|
||||
|
||||
add_library(sf-omx-il SHARED ${library_SRCS})
|
||||
install(TARGETS sf-omx-il
|
||||
LIBRARY DESTINATION lib
|
||||
)
|
||||
install(FILES
|
||||
include/khronos/OMX_Audio.h
|
||||
include/khronos/OMX_Component.h
|
||||
include/khronos/OMX_CoreExt.h
|
||||
include/khronos/OMX_ImageExt.h
|
||||
include/khronos/OMX_IndexExt.h
|
||||
include/khronos/OMX_IVCommon.h
|
||||
include/khronos/OMX_Types.h
|
||||
include/khronos/OMX_Video.h
|
||||
include/khronos/OMX_ComponentExt.h
|
||||
include/khronos/OMX_ContentPipe.h
|
||||
include/khronos/OMX_Core.h
|
||||
include/khronos/OMX_Image.h
|
||||
include/khronos/OMX_Index.h
|
||||
include/khronos/OMX_Other.h
|
||||
include/khronos/OMX_VideoExt.h
|
||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/khronos
|
||||
)
|
Loading…
Add table
Reference in a new issue