diff --git a/APP_Framework/Applications/knowing_app/face_detect/Kconfig b/APP_Framework/Applications/knowing_app/face_detect/Kconfig index 92738ada5..7d3b84e89 100644 --- a/APP_Framework/Applications/knowing_app/face_detect/Kconfig +++ b/APP_Framework/Applications/knowing_app/face_detect/Kconfig @@ -4,4 +4,5 @@ config FACE_DETECT depends on DRV_USING_OV2640 depends on USING_KPU_POSTPROCESSING depends on USING_YOLOV2 + select LIB_USING_CJSON default n diff --git a/APP_Framework/Applications/knowing_app/face_detect/face_detect.c b/APP_Framework/Applications/knowing_app/face_detect/face_detect.c index 702b43c61..3ce3319a5 100644 --- a/APP_Framework/Applications/knowing_app/face_detect/face_detect.c +++ b/APP_Framework/Applications/knowing_app/face_detect/face_detect.c @@ -1,6 +1,7 @@ #include - -#include "cJSON.h" +#ifdef LIB_USING_CJSON +#include +#endif #include "region_layer.h" #define ANCHOR_NUM 5 #define STACK_SIZE (128 * 1024) diff --git a/APP_Framework/lib/Kconfig b/APP_Framework/lib/Kconfig index bec09361c..d5064ee30 100755 --- a/APP_Framework/lib/Kconfig +++ b/APP_Framework/lib/Kconfig @@ -1,5 +1,5 @@ -menu "app lib" - +menu "lib" + choice prompt "chose a kind of lib for app" default APP_SELECT_NEWLIB @@ -10,5 +10,5 @@ menu "app lib" config APP_SELECT_OTHER_LIB bool "app select other lib" endchoice - + source "$APP_DIR/lib/cJSON/Kconfig" endmenu diff --git a/APP_Framework/lib/SConscript b/APP_Framework/lib/SConscript new file mode 100644 index 000000000..f307e3f70 --- /dev/null +++ b/APP_Framework/lib/SConscript @@ -0,0 +1,14 @@ +import os +Import('RTT_ROOT') +from building import * + +cwd = GetCurrentDir() +objs = [] +list = os.listdir(cwd) + +for d in list: + path = os.path.join(cwd, d) + if os.path.isfile(os.path.join(path, 'SConscript')): + objs = objs + SConscript(os.path.join(path, 'SConscript')) + +Return('objs') diff --git a/APP_Framework/lib/cJSON/Kconfig b/APP_Framework/lib/cJSON/Kconfig new file mode 100644 index 000000000..79a2d5892 --- /dev/null +++ b/APP_Framework/lib/cJSON/Kconfig @@ -0,0 +1,3 @@ +menuconfig LIB_USING_CJSON + bool "USING cJSON" + default n diff --git a/APP_Framework/lib/cJSON/SConscript b/APP_Framework/lib/cJSON/SConscript new file mode 100644 index 000000000..42322db28 --- /dev/null +++ b/APP_Framework/lib/cJSON/SConscript @@ -0,0 +1,10 @@ +from building import * +import os + +cwd = GetCurrentDir() + +src = Glob('*.c') + +group = DefineGroup('cjson', src, depend = ['LIB_USING_CJSON'], CPPPATH = [cwd]) + +Return('group') \ No newline at end of file diff --git a/APP_Framework/Applications/knowing_app/face_detect/cJSON.c b/APP_Framework/lib/cJSON/cJSON.c similarity index 100% rename from APP_Framework/Applications/knowing_app/face_detect/cJSON.c rename to APP_Framework/lib/cJSON/cJSON.c diff --git a/APP_Framework/Applications/knowing_app/face_detect/cJSON.h b/APP_Framework/lib/cJSON/cJSON.h similarity index 100% rename from APP_Framework/Applications/knowing_app/face_detect/cJSON.h rename to APP_Framework/lib/cJSON/cJSON.h diff --git a/Ubiquitous/RT_Thread/bsp/k210/SConstruct b/Ubiquitous/RT_Thread/bsp/k210/SConstruct index 55247bc1d..8aad441d4 100644 --- a/Ubiquitous/RT_Thread/bsp/k210/SConstruct +++ b/Ubiquitous/RT_Thread/bsp/k210/SConstruct @@ -59,6 +59,7 @@ objs.extend(SConscript(os.getcwd() + '/../../../../APP_Framework/Framework/SCons # include APP_Framework/Applications objs.extend(SConscript(os.getcwd() + '/../../../../APP_Framework/Applications/SConscript')) - +# include APP_Framework/lib +objs.extend(SConscript(os.getcwd() + '/../../../../APP_Framework/lib/SConscript')) # make a building DoBuilding(TARGET, objs) diff --git a/Ubiquitous/RT_Thread/bsp/stm32f407-atk-coreboard/SConstruct b/Ubiquitous/RT_Thread/bsp/stm32f407-atk-coreboard/SConstruct index 6e447c6c1..2bc33db05 100644 --- a/Ubiquitous/RT_Thread/bsp/stm32f407-atk-coreboard/SConstruct +++ b/Ubiquitous/RT_Thread/bsp/stm32f407-atk-coreboard/SConstruct @@ -81,6 +81,7 @@ objs.extend(SConscript(os.getcwd() + '/../../../../APP_Framework/Framework/SCons # include APP_Framework/Applications objs.extend(SConscript(os.getcwd() + '/../../../../APP_Framework/Applications/SConscript')) - +# include APP_Framework/lib +objs.extend(SConscript(os.getcwd() + '/../../../../APP_Framework/lib/SConscript')) # make a building DoBuilding(TARGET, objs)