This commit is contained in:
Fancy code 2024-04-25 11:40:16 +08:00
parent 1f364ab7f0
commit e830334096
7 changed files with 115 additions and 4 deletions

View File

@ -164,7 +164,13 @@ endif()
#
add_subdirectory(external)
add_subdirectory(application)
# application
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/test/CMakeLists.txt")
message(STATUS "application exists, add application to project.")
add_subdirectory(application)
else()
message(STATUS "application not exists.")
endif()
add_subdirectory(middleware)
add_subdirectory(utils)
add_subdirectory(hal)
@ -181,6 +187,12 @@ endif()
message("MAIN_INCLUDE_PATH = ${MAIN_INCLUDE_PATH}")
message("MAIN_SRC_FILE = ${MAIN_SRC_FILE}")
message("MAIN_LINK_LIB = ${MAIN_LINK_LIB}")
add_subdirectory(test)
# test
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/test/CMakeLists.txt")
message(STATUS "test exists, add test to project.")
add_subdirectory(test)
else()
message(STATUS "test not exists.")
endif()
# include(build/global_config.cmake)

View File

@ -14,6 +14,7 @@
*/
#include "AppMonitor.h"
#include "ILog.h"
#include <vector>
StatusCode AppMonitor::GetProductInfo(AppGetProductInfo &param)
{
LogInfo("AppMonitor::GetProductInfo.\n");

View File

@ -2,7 +2,7 @@
#编译curl库
platform=$1
CMAKE_SOURCE_DIR=$2
echo "Compile curl, platform = $platform, cmake source dir = $CMAKE_SOURCE_DIR."
echo "Compile openssl, platform = $platform, cmake source dir = $CMAKE_SOURCE_DIR."
export ROOT_PATH=$PWD
# if [ ! -d "./openssl-3.1.0" ];then

View File

@ -5,3 +5,4 @@ add_subdirectory(McuManager)
add_subdirectory(McuAskBase)
add_subdirectory(MediaManager)
add_subdirectory(AppManager)
add_subdirectory(StorageManager)

View File

@ -0,0 +1,64 @@
include(${CMAKE_SOURCE_DIR_IPCSDK}/build/global_config.cmake)
set(EXECUTABLE_OUTPUT_PATH ${EXEC_OUTPUT_PATH})
set(LIBRARY_OUTPUT_PATH ${LIBS_OUTPUT_PATH})
include_directories(
./src
./include
${MIDDLEWARE_SOURCE_PATH}/McuAskBase/include
${UTILS_SOURCE_PATH}/StatusCode/include
${UTILS_SOURCE_PATH}/Log/include
${UTILS_SOURCE_PATH}/McuProtocol/include
${UTILS_SOURCE_PATH}/UartDevice/include
)
#do not rely on any other library
#link_directories(
#)
aux_source_directory(./src SRC_FILES)
set(TARGET_NAME StorageManager)
add_library(${TARGET_NAME} STATIC ${SRC_FILES})
target_link_libraries(${TARGET_NAME} StatusCode Log)
if ("${COMPILE_IMPROVE_SUPPORT}" MATCHES "true")
add_custom_target(
StorageManager_code_check
COMMAND ${CLANG_TIDY_EXE}
-checks='${CLANG_TIDY_CHECKS}'
--header-filter=.*
--system-headers=false
${SRC_FILES}
${CLANG_TIDY_CONFIG}
-p ${PLATFORM_PATH}/cmake-shell
WORKING_DIRECTORY ${MIDDLEWARE_SOURCE_PATH}/StorageManager
)
add_custom_command(
TARGET ${TARGET_NAME}
PRE_BUILD
COMMAND make StorageManager_code_check
WORKING_DIRECTORY ${PLATFORM_PATH}/cmake-shell/
)
file(GLOB_RECURSE HEADER_FILES *.h)
add_custom_target(
StorageManager_code_format
COMMAND ${CLANG_FORMAT_EXE}
-style=file
-i ${SRC_FILES} ${HEADER_FILES}
WORKING_DIRECTORY ${MIDDLEWARE_SOURCE_PATH}/StorageManager
)
add_custom_command(
TARGET ${TARGET_NAME}
PRE_BUILD
COMMAND make StorageManager_code_check
COMMAND make StorageManager_code_format
WORKING_DIRECTORY ${PLATFORM_PATH}/cmake-shell/
)
endif()
define_file_name(${TARGET_NAME})
file(GLOB_RECURSE INSTALL_HEADER_FILES include/*.h)
install(FILES ${INSTALL_HEADER_FILES} DESTINATION include)

View File

@ -0,0 +1,18 @@
/*
* Copyright (c) 2023 Fancy Code.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef I_STORAGE_MANAGER_H
#define I_STORAGE_MANAGER_H
#endif

View File

@ -0,0 +1,15 @@
/*
* Copyright (c) 2023 Fancy Code.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "IStorageManager.h"