kendryte / kendryte-freertos-sdk

This project is no longer maintained Not recommended for product development.
Apache License 2.0
201 stars 68 forks source link

[FEATURE REQUEST] build projects outside of sdk #30

Closed leonardp closed 4 years ago

leonardp commented 5 years ago

hello, i noticed building projects outside the sdk directory didnt work for me because the third_party sources were not added correctly.

here is the diff to make it work:

diff --git a/cmake/executable.cmake b/cmake/executable.cmake
index c66d340..b91ed3e 100644
--- a/cmake/executable.cmake
+++ b/cmake/executable.cmake
@@ -10,6 +10,7 @@ if (NOT BUILDING_SDK)
         ### source code sdk
         include_directories(${SDK_ROOT}/lib/arch/include ${SDK_ROOT}/lib/utils/include)
         add_subdirectory(${SDK_ROOT}/lib SDK)
+        add_subdirectory(${SDK_ROOT}/third_party THIRD_PARTY)
     endif()
 endif ()

also, to be more consistent i modified the CMakeLists.txt.example.cmake like so:

cmake_minimum_required(VERSION 3.0)

## Required Variable: (if you do not use Kendryte IDE)
# -DTOOLCHAIN=/path/to/rsicv/toolchain/bin
# -DSDK=/path/to/SDK (the folder of this example file)

## Include the SDK library
include("${SDK_ROOT}/cmake/common.cmake")

# add sources for project
add_source_files(
    "src/${PROJ}/*.c"
    "src/${PROJ}/*.s"
    "src/${PROJ}/*.S"
    "src/${PROJ}/*.cpp"
    )

## Use SDK builder to build this project
include("${SDK_ROOT}/cmake/executable.cmake")

would be nice if you could merge these changes some time. cheers!

xiongyumail commented 5 years ago

Good Job!

leonardp commented 4 years ago

closing this in favor of https://github.com/kendryte/kendryte-freertos-sdk/pull/48