From 9792e36ab4f2cf1f187887eec645b9ad437ad5fc Mon Sep 17 00:00:00 2001 From: jzlv Date: Wed, 20 Oct 2021 19:08:16 +0800 Subject: [PATCH] [feat][rt-thread] add cmakelists and modify riscv_encoding including path --- components/rt-thread/.gitignore | 2 +- components/rt-thread/CMakeLists.txt | 53 +++++++++++++++++++ .../bsp/bouffalolab/bl602/board/startup_gcc.S | 2 +- .../bsp/bouffalolab/bl702/board/startup_gcc.S | 2 +- 4 files changed, 56 insertions(+), 3 deletions(-) create mode 100644 components/rt-thread/CMakeLists.txt diff --git a/components/rt-thread/.gitignore b/components/rt-thread/.gitignore index 4e612654..39dc2b19 100644 --- a/components/rt-thread/.gitignore +++ b/components/rt-thread/.gitignore @@ -36,5 +36,5 @@ ncscope.* tags .idea -CMakeLists.txt +#CMakeLists.txt cmake-build-debug diff --git a/components/rt-thread/CMakeLists.txt b/components/rt-thread/CMakeLists.txt new file mode 100644 index 00000000..72620415 --- /dev/null +++ b/components/rt-thread/CMakeLists.txt @@ -0,0 +1,53 @@ +################# Add global include ################# +list(APPEND ADD_INCLUDE +"${CMAKE_CURRENT_SOURCE_DIR}/" +"${CMAKE_CURRENT_SOURCE_DIR}/include" +"${CMAKE_CURRENT_SOURCE_DIR}/libcpu/risc-v/e24" +"${CMAKE_CURRENT_SOURCE_DIR}/libcpu/risc-v/common" +"${CMAKE_CURRENT_SOURCE_DIR}/bsp/bouffalolab/${CHIP}" +"${CMAKE_CURRENT_SOURCE_DIR}/components/finsh" +) +####################################################### + +################# Add private include ################# +# list(APPEND ADD_PRIVATE_INCLUDE +# ) +####################################################### + +############## Add current dir source files ########### +file(GLOB_RECURSE sources +"${CMAKE_CURRENT_SOURCE_DIR}/src/*.c" +"${CMAKE_CURRENT_SOURCE_DIR}/libcpu/risc-v/common/context_gcc.S" +"${CMAKE_CURRENT_SOURCE_DIR}/libcpu/risc-v/common/cpuport.c" +"${CMAKE_CURRENT_SOURCE_DIR}/libcpu/risc-v/e24/interrupt_gcc.S" +"${CMAKE_CURRENT_SOURCE_DIR}/components/finsh/*.c" +) + +#aux_source_directory(. sources) +list(APPEND ADD_SRCS ${sources}) +####################################################### + +########### Add required/dependent components ######### +#list(APPEND ADD_REQUIREMENTS xxx) +####################################################### + +############ Add static libs ########################## +#list(APPEND ADD_STATIC_LIB "libxxx.a") +####################################################### + +############ Add dynamic libs ######################### +# list(APPEND ADD_DYNAMIC_LIB "libxxx.so" +# ) +####################################################### + +############ Add global compile option ################ +#add components denpend on this component +# list(APPEND ADD_DEFINITIONS -D${CHIPNAME}) +####################################################### + +############ Add private compile option ################ +#add compile option for this component that won't affect other modules +# list(APPEND ADD_PRIVATE_DEFINITIONS -Dxxx) +####################################################### + +generate_library() diff --git a/components/rt-thread/bsp/bouffalolab/bl602/board/startup_gcc.S b/components/rt-thread/bsp/bouffalolab/bl602/board/startup_gcc.S index 5a4961cb..7dcd525c 100644 --- a/components/rt-thread/bsp/bouffalolab/bl602/board/startup_gcc.S +++ b/components/rt-thread/bsp/bouffalolab/bl602/board/startup_gcc.S @@ -1,6 +1,6 @@ /* Copyright 2018 SiFive, Inc */ /* SPDX-License-Identifier: Apache-2.0 */ -#include "riscv_encoding.h" +#include "../risc-v/Core/Include/riscv_encoding.h" /* This code executes before _start, which is contained inside the C library. * In embedded systems we want to ensure that _enter, which contains the first diff --git a/components/rt-thread/bsp/bouffalolab/bl702/board/startup_gcc.S b/components/rt-thread/bsp/bouffalolab/bl702/board/startup_gcc.S index 5a4961cb..7dcd525c 100644 --- a/components/rt-thread/bsp/bouffalolab/bl702/board/startup_gcc.S +++ b/components/rt-thread/bsp/bouffalolab/bl702/board/startup_gcc.S @@ -1,6 +1,6 @@ /* Copyright 2018 SiFive, Inc */ /* SPDX-License-Identifier: Apache-2.0 */ -#include "riscv_encoding.h" +#include "../risc-v/Core/Include/riscv_encoding.h" /* This code executes before _start, which is contained inside the C library. * In embedded systems we want to ensure that _enter, which contains the first