Skip to content

Commit caefd0d

Browse files
gpouliosAlan C. Assis
authored andcommitted
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 <[email protected]>
1 parent 3ee6fda commit caefd0d

File tree

4 files changed

+21
-8
lines changed

4 files changed

+21
-8
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ add_subdirectory(nshlib)
6666
add_subdirectory(platform)
6767
add_subdirectory(sdr)
6868
add_subdirectory(system)
69+
add_subdirectory(tee)
6970
add_subdirectory(testing)
7071
add_subdirectory(videoutils)
7172
add_subdirectory(wireless)

examples/optee_gp/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,7 @@ if(CONFIG_EXAMPLES_OPTEE_GP)
2929
STACKSIZE
3030
${CONFIG_EXAMPLES_OPTEE_GP_STACKSIZE}
3131
PRIORITY
32-
${CONFIG_EXAMPLES_OPTEE_GP_PRIORITY})
32+
${CONFIG_EXAMPLES_OPTEE_GP_PRIORITY}
33+
DEPENDS
34+
libteec)
3335
endif()

tee/libteec/CMakeLists.txt

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,13 @@ if(CONFIG_LIBTEEC)
2424
set(OPTEE_CLIENT_DIR ${CMAKE_CURRENT_LIST_DIR}/optee_client)
2525

2626
if(NOT EXISTS ${OPTEE_CLIENT_DIR})
27-
set(OPTEE_CLIENT_URL https://github.com/OP-TEE/optee_client/archive/refs/tags)
27+
set(OPTEE_CLIENT_URL
28+
https://github.com/OP-TEE/optee_client/archive/refs/tags)
2829
set(OPTEE_CLIENT_VER ${CONFIG_LIBTEEC_VERSION})
2930
FetchContent_Declare(
3031
optee_client_fetch
31-
URL ${OPTEE_CLIENT_URL}/${OPTEE_CLIENT_VER}.zip
32-
SOURCE_DIR
33-
${OPTEE_CLIENT_DIR}
34-
BINARY_DIR
32+
URL ${OPTEE_CLIENT_URL}/${OPTEE_CLIENT_VER}.zip SOURCE_DIR
33+
${OPTEE_CLIENT_DIR} BINARY_DIR
3534
${CMAKE_BINARY_DIR}/tee/libteec/optee_client
3635
PATCH_COMMAND patch -p1 -d ${OPTEE_CLIENT_DIR} <
3736
${CMAKE_CURRENT_LIST_DIR}/0001-libteec-NuttX.patch
@@ -56,6 +55,17 @@ if(CONFIG_LIBTEEC)
5655
optee_client/libteec/src/teec_trace.c)
5756
target_include_directories(libteec
5857
PRIVATE ${OPTEE_CLIENT_DIR}/libteec/include)
59-
target_compile_definitions(libteec PRIVATE BINARY_PREFIX=\"TEEC\")
58+
target_compile_definitions(libteec PUBLIC BINARY_PREFIX=\"TEEC\")
59+
60+
if(CONFIG_DEBUG_INFO)
61+
target_compile_definitions(libteec PUBLIC DEBUGLEVEL=3)
62+
elseif(CONFIG_DEBUG_WARN)
63+
target_compile_definitions(libteec PUBLIC DEBUGLEVEL=2)
64+
elseif(CONFIG_DEBUG_ERROR)
65+
target_compile_definitions(libteec PUBLIC DEBUGLEVEL=1)
66+
else()
67+
# the default DEBUGLEVEL is 1 (with error level)
68+
target_compile_definitions(libteec PUBLIC DEBUGLEVEL=1)
69+
endif()
6070

6171
endif()

tee/libteec/Make.defs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ else ifneq ($(CONFIG_DEBUG_WARN),)
3232
else ifneq ($(CONFIG_DEBUG_ERROR),)
3333
FLAGS += ${DEFINE_PREFIX}DEBUGLEVEL=1
3434
else
35-
# the default DEBUGLEVEL are 1(with error level)
35+
# the default DEBUGLEVEL is 1 (with error level)
3636
FLAGS += ${DEFINE_PREFIX}DEBUGLEVEL=1
3737
endif
3838

0 commit comments

Comments
 (0)