support ai lib

pull/125/head
xiangbingj 2020-10-21 14:11:34 +08:00
parent 70f9fdf177
commit 06a2ea71f2
1 changed files with 23 additions and 9 deletions

View File

@ -18,15 +18,29 @@ add_executable(${PROJECT_NAME} ${SOURCE_FILES})
set_target_properties(${PROJECT_NAME} PROPERTIES LINKER_LANGUAGE C)
target_link_libraries(${PROJECT_NAME}
-Wl,--start-group
gcc m c
-Wl,--whole-archive
kendryte
-Wl,--no-whole-archive
-Wl,--end-group
)
if (EXISTS ${SDK_ROOT}/src/${PROJ}/ai/libai.a)
add_library(ai STATIC IMPORTED)
set_property(TARGET ai PROPERTY IMPORTED_LOCATION ${SDK_ROOT}/src/${PROJ}/ai/libai.a)
target_link_libraries(${PROJECT_NAME}
-Wl,--start-group
gcc m c
-Wl,--whole-archive
kendryte
ai
-Wl,--no-whole-archive
-Wl,--end-group
)
else ()
target_link_libraries(${PROJECT_NAME}
-Wl,--start-group
gcc m c
-Wl,--whole-archive
kendryte
-Wl,--no-whole-archive
-Wl,--end-group
)
endif()
if (EXISTS ${SDK_ROOT}/src/${PROJ}/project.cmake)
include(${SDK_ROOT}/src/${PROJ}/project.cmake)
endif ()