tee/libteec, examples/optee_gp: Fix cmake build

Top level:
 - 'tee' subdirectory added to top-level CMakeLists.txt

tee/libteec:
 - BINARY_PREFIX defined PUBLIC to make it accessible to consumer
   apps
 - added missing DEBUGLEVEL definitions

examples/optee_gp:
 - added missing dependency to libteec

Signed-off-by: George Poulios <gpoulios@census-labs.com>
This commit is contained in:
George Poulios
2025-08-02 09:39:13 +03:00
committed by Alan C. Assis
parent 3ee6fdaf99
commit caefd0de9f
4 changed files with 21 additions and 8 deletions

View File

@@ -66,6 +66,7 @@ add_subdirectory(nshlib)
add_subdirectory(platform) add_subdirectory(platform)
add_subdirectory(sdr) add_subdirectory(sdr)
add_subdirectory(system) add_subdirectory(system)
add_subdirectory(tee)
add_subdirectory(testing) add_subdirectory(testing)
add_subdirectory(videoutils) add_subdirectory(videoutils)
add_subdirectory(wireless) add_subdirectory(wireless)

View File

@@ -29,5 +29,7 @@ if(CONFIG_EXAMPLES_OPTEE_GP)
STACKSIZE STACKSIZE
${CONFIG_EXAMPLES_OPTEE_GP_STACKSIZE} ${CONFIG_EXAMPLES_OPTEE_GP_STACKSIZE}
PRIORITY PRIORITY
${CONFIG_EXAMPLES_OPTEE_GP_PRIORITY}) ${CONFIG_EXAMPLES_OPTEE_GP_PRIORITY}
DEPENDS
libteec)
endif() endif()

View File

@@ -24,14 +24,13 @@ if(CONFIG_LIBTEEC)
set(OPTEE_CLIENT_DIR ${CMAKE_CURRENT_LIST_DIR}/optee_client) set(OPTEE_CLIENT_DIR ${CMAKE_CURRENT_LIST_DIR}/optee_client)
if(NOT EXISTS ${OPTEE_CLIENT_DIR}) if(NOT EXISTS ${OPTEE_CLIENT_DIR})
set(OPTEE_CLIENT_URL https://github.com/OP-TEE/optee_client/archive/refs/tags) set(OPTEE_CLIENT_URL
https://github.com/OP-TEE/optee_client/archive/refs/tags)
set(OPTEE_CLIENT_VER ${CONFIG_LIBTEEC_VERSION}) set(OPTEE_CLIENT_VER ${CONFIG_LIBTEEC_VERSION})
FetchContent_Declare( FetchContent_Declare(
optee_client_fetch optee_client_fetch
URL ${OPTEE_CLIENT_URL}/${OPTEE_CLIENT_VER}.zip URL ${OPTEE_CLIENT_URL}/${OPTEE_CLIENT_VER}.zip SOURCE_DIR
SOURCE_DIR ${OPTEE_CLIENT_DIR} BINARY_DIR
${OPTEE_CLIENT_DIR}
BINARY_DIR
${CMAKE_BINARY_DIR}/tee/libteec/optee_client ${CMAKE_BINARY_DIR}/tee/libteec/optee_client
PATCH_COMMAND patch -p1 -d ${OPTEE_CLIENT_DIR} < PATCH_COMMAND patch -p1 -d ${OPTEE_CLIENT_DIR} <
${CMAKE_CURRENT_LIST_DIR}/0001-libteec-NuttX.patch ${CMAKE_CURRENT_LIST_DIR}/0001-libteec-NuttX.patch
@@ -56,6 +55,17 @@ if(CONFIG_LIBTEEC)
optee_client/libteec/src/teec_trace.c) optee_client/libteec/src/teec_trace.c)
target_include_directories(libteec target_include_directories(libteec
PRIVATE ${OPTEE_CLIENT_DIR}/libteec/include) PRIVATE ${OPTEE_CLIENT_DIR}/libteec/include)
target_compile_definitions(libteec PRIVATE BINARY_PREFIX=\"TEEC\") target_compile_definitions(libteec PUBLIC BINARY_PREFIX=\"TEEC\")
if(CONFIG_DEBUG_INFO)
target_compile_definitions(libteec PUBLIC DEBUGLEVEL=3)
elseif(CONFIG_DEBUG_WARN)
target_compile_definitions(libteec PUBLIC DEBUGLEVEL=2)
elseif(CONFIG_DEBUG_ERROR)
target_compile_definitions(libteec PUBLIC DEBUGLEVEL=1)
else()
# the default DEBUGLEVEL is 1 (with error level)
target_compile_definitions(libteec PUBLIC DEBUGLEVEL=1)
endif()
endif() endif()

View File

@@ -32,7 +32,7 @@ else ifneq ($(CONFIG_DEBUG_WARN),)
else ifneq ($(CONFIG_DEBUG_ERROR),) else ifneq ($(CONFIG_DEBUG_ERROR),)
FLAGS += ${DEFINE_PREFIX}DEBUGLEVEL=1 FLAGS += ${DEFINE_PREFIX}DEBUGLEVEL=1
else else
# the default DEBUGLEVEL are 1(with error level) # the default DEBUGLEVEL is 1 (with error level)
FLAGS += ${DEFINE_PREFIX}DEBUGLEVEL=1 FLAGS += ${DEFINE_PREFIX}DEBUGLEVEL=1
endif endif