From 59f2010043b9c4de9ad970e07a176ebf361f0263 Mon Sep 17 00:00:00 2001 From: dianjixz <18637716021@163.com> Date: Mon, 6 Jun 2022 23:35:23 +0800 Subject: [PATCH] fix build/c_cpp_project_framework/examples/demo1 --- .../components/libbase64/CMakeLists.txt | 70 ------------------- .../components/libbase64/Kconfig | 3 - .../examples/demo1/config_defaults.mk | 1 - .../examples/demo1/main/CMakeLists.txt | 2 +- .../examples/demo1/main/include/test.h | 1 - .../examples/demo1/main/src/main.c | 1 - .../examples/demo1/main/src/test_libbase64.c | 51 -------------- 7 files changed, 1 insertion(+), 128 deletions(-) delete mode 100644 build/c_cpp_project_framework/components/libbase64/CMakeLists.txt delete mode 100644 build/c_cpp_project_framework/components/libbase64/Kconfig delete mode 100644 build/c_cpp_project_framework/examples/demo1/main/src/test_libbase64.c diff --git a/build/c_cpp_project_framework/components/libbase64/CMakeLists.txt b/build/c_cpp_project_framework/components/libbase64/CMakeLists.txt deleted file mode 100644 index a391b0f..0000000 --- a/build/c_cpp_project_framework/components/libbase64/CMakeLists.txt +++ /dev/null @@ -1,70 +0,0 @@ -# Config enable component3 or not in Kconfig -set(MODULE_DIR_C "../../../../gear-lib/libbase64") -if(CONFIG_LIBBASE64_ENABLED) - - ################# Add include ################# - # list(APPEND ADD_INCLUDE "include") - list(APPEND ADD_INCLUDE "${MODULE_DIR_C}/../libposix") - list(APPEND ADD_INCLUDE "${MODULE_DIR_C}") - # list(APPEND ADD_PRIVATE_INCLUDE "include_private") - ############################################### - - ############## Add source files ############### - list(APPEND ADD_SRCS "${MODULE_DIR_C}/libbase64.c" - ) - - # aux_source_directory(src ADD_SRCS) # collect all source file in src dir, will set var ADD_SRCS - # append_srcs_dir(ADD_SRCS "src") # append source file in src dir to var ADD_SRCS - # list(REMOVE_ITEM COMPONENT_SRCS "src/test.c") - # set(ADD_ASM_SRCS "src/asm.S") - # list(APPEND ADD_SRCS ${ADD_ASM_SRCS}) - # SET_PROPERTY(SOURCE ${ADD_ASM_SRCS} PROPERTY LANGUAGE C) # set .S ASM file as C language - # SET_SOURCE_FILES_PROPERTIES(${ADD_ASM_SRCS} PROPERTIES COMPILE_FLAGS "-x assembler-with-cpp -D BBBBB") - ############################################### - - - ###### Add required/dependent components ###### - # list(APPEND ADD_REQUIREMENTS component1) - ############################################### - - ###### Add link search path for requirements/libs ###### - # list(APPEND ADD_LINK_SEARCH_PATH "${CONFIG_TOOLCHAIN_PATH}/lib") - # list(APPEND ADD_REQUIREMENTS pthread m) # add system libs, pthread and math lib for example here - # list(APPEND ADD_REQUIREMENTS pthread media-io thread uvc pulse xcb xcb-shm xcb-randr xcb-xinerama) - ############################################### - - ############ Add static libs ################## - # list(APPEND ADD_STATIC_LIB "lib/libtest.a") - ############################################### - - ############ Add dynamic libs ################## - # list(APPEND ADD_DYNAMIC_LIB "lib/arch/v831/libmaix_nn.so" - # "lib/arch/v831/libmaix_cam.so" - # ) - ############################################### - - #### Add compile option for this component #### - #### Just for this component, won't affect other - #### modules, including component that depend - #### on this component - # list(APPEND ADD_DEFINITIONS_PRIVATE -DAAAAA=1) - - #### Add compile option for this component - #### and components denpend on this component - # list(APPEND ADD_DEFINITIONS -DAAAAA222=1 - # -DAAAAA333=1) - ############################################### - - ############ Add static libs ################## - #### Update parent's variables like CMAKE_C_LINK_FLAGS - # set(CMAKE_C_LINK_FLAGS "${CMAKE_C_LINK_FLAGS} -Wl,--start-group libmaix/libtest.a -ltest2 -Wl,--end-group" PARENT_SCOPE) - ############################################### - - # register component, DYNAMIC or SHARED flags will make component compiled to dynamic(shared) lib - # if(CONFIG_COMPONENT3_DYNAMIC) - # register_component(DYNAMIC) - # else() - # register_component() - # endif() - register_component() -endif() \ No newline at end of file diff --git a/build/c_cpp_project_framework/components/libbase64/Kconfig b/build/c_cpp_project_framework/components/libbase64/Kconfig deleted file mode 100644 index f4bcfb5..0000000 --- a/build/c_cpp_project_framework/components/libbase64/Kconfig +++ /dev/null @@ -1,3 +0,0 @@ -config LIBBASE64_ENABLED - bool "Enable libbase64" - default n diff --git a/build/c_cpp_project_framework/examples/demo1/config_defaults.mk b/build/c_cpp_project_framework/examples/demo1/config_defaults.mk index de3703c..a8ebdb9 100644 --- a/build/c_cpp_project_framework/examples/demo1/config_defaults.mk +++ b/build/c_cpp_project_framework/examples/demo1/config_defaults.mk @@ -2,6 +2,5 @@ CONFIG_LIBPOSIX_ENABLED=y -CONFIG_LIBBASE64_ENABLED=y CONFIG_LIBCOLLECTIONS_ENABLED=y CONFIG_LIBLOG_ENABLED=y \ No newline at end of file diff --git a/build/c_cpp_project_framework/examples/demo1/main/CMakeLists.txt b/build/c_cpp_project_framework/examples/demo1/main/CMakeLists.txt index 2fee6de..48db201 100644 --- a/build/c_cpp_project_framework/examples/demo1/main/CMakeLists.txt +++ b/build/c_cpp_project_framework/examples/demo1/main/CMakeLists.txt @@ -16,7 +16,7 @@ append_srcs_dir(ADD_SRCS "src") # append source file in src dir to var ADD ############################################### ###### Add required/dependent components ###### -list(APPEND ADD_REQUIREMENTS libposix libbase64 libcollections liblog) +list(APPEND ADD_REQUIREMENTS libposix libcollections liblog) # if(CONFIG_COMPONENT2_ENABLED) # list(APPEND ADD_REQUIREMENTS component2) # endif() diff --git a/build/c_cpp_project_framework/examples/demo1/main/include/test.h b/build/c_cpp_project_framework/examples/demo1/main/include/test.h index 9077be7..7b6afff 100644 --- a/build/c_cpp_project_framework/examples/demo1/main/include/test.h +++ b/build/c_cpp_project_framework/examples/demo1/main/include/test.h @@ -3,7 +3,6 @@ void foo(); -void test_test_libbase64(); int test_libcollections(); int test_liblog(); \ No newline at end of file diff --git a/build/c_cpp_project_framework/examples/demo1/main/src/main.c b/build/c_cpp_project_framework/examples/demo1/main/src/main.c index dbffdd7..fca54e0 100644 --- a/build/c_cpp_project_framework/examples/demo1/main/src/main.c +++ b/build/c_cpp_project_framework/examples/demo1/main/src/main.c @@ -22,7 +22,6 @@ int main() { foo(); - test_test_libbase64(); test_libcollections(); test_liblog(); diff --git a/build/c_cpp_project_framework/examples/demo1/main/src/test_libbase64.c b/build/c_cpp_project_framework/examples/demo1/main/src/test_libbase64.c deleted file mode 100644 index 7d33ae0..0000000 --- a/build/c_cpp_project_framework/examples/demo1/main/src/test_libbase64.c +++ /dev/null @@ -1,51 +0,0 @@ -/****************************************************************************** - * Copyright (C) 2014-2020 dianjixz <18637716021@163.com> - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - ******************************************************************************/ -#include "libbase64.h" -#include -#include -#include -#include "test.h" - -void test_test_libbase64() -{ - char target[100] = {0}; - char target2[100] = {0}; - char source[]="hello world"; - int ret_bytes=0; - printf("start base64_encode\n"); - memset(target, 0, sizeof(target)); - memset(target2, 0, sizeof(target2)); - ret_bytes = base64_encode(target, source, strlen(source)); - - printf("src size: %zu , return byte: %d , target:%s\n", strlen(source), ret_bytes, target); - - ret_bytes = base64_decode(target2, target, ret_bytes); - target[ret_bytes]='\0'; - printf("return byte: %d , target2: %s \n", ret_bytes, target2); -} - - -// int main(int argc, char **argv) -// { -// test_test_libbase64(); -// return 0; -// } \ No newline at end of file