mirror of
https://gitee.com/jiuyilian/embedded-framework.git
synced 2025-01-06 10:16:51 -05:00
Improve:libconfig libs compile.
This commit is contained in:
parent
0a7bf55c3e
commit
88707966a6
|
@ -10,6 +10,7 @@ include_directories(
|
|||
link_directories(
|
||||
${LIBS_OUTPUT_PATH}
|
||||
${EXTERNAL_LIBS_OUTPUT_PATH}
|
||||
${EXTERNAL_LIBS_OUTPUT_PATH}/libconfig/lib
|
||||
)
|
||||
|
||||
aux_source_directory(. SRC_FILES)
|
||||
|
|
3
external/CMakeLists.txt
vendored
3
external/CMakeLists.txt
vendored
|
@ -20,4 +20,5 @@ add_subdirectory(httpserver.h-master/src)
|
|||
|
||||
add_subdirectory(cJSON-1.7.17)
|
||||
add_subdirectory(libhv/libhv-1.3.2)
|
||||
add_subdirectory(ffmpeg)
|
||||
add_subdirectory(ffmpeg)
|
||||
add_subdirectory(libconfig)
|
5
external/ffmpeg/CMakeLists.txt
vendored
5
external/ffmpeg/CMakeLists.txt
vendored
|
@ -1,11 +1,6 @@
|
|||
|
||||
|
||||
add_custom_target(
|
||||
ffmpeg
|
||||
# DEPENDS ${EXTERNAL_LIBS_OUTPUT_PATH}/libgo.a
|
||||
# COMMAND mkdir ${GOAHEAD_UPLOAD_TMP_PATH}
|
||||
# COMMAND cp ${EXTERNAL_SOURCE_PATH}/goahead-5.2.0/modify/http.c ${EXTERNAL_SOURCE_PATH}/goahead-5.2.0/GoAhead/src
|
||||
# COMMAND touch ${EXTERNAL_SOURCE_PATH}/goahead-5.2.0/GoAhead/src/http.c
|
||||
COMMAND test -f ${EXTERNAL_SOURCE_PATH}/ffmpeg/Makefile || tar -xf ffmpeg_6.1.1.orig.tar.xz
|
||||
COMMAND chmod 777 -R ffmpeg-6.1.1
|
||||
COMMAND cd ffmpeg-6.1.1 && ./configure --enable-cross-compile --target-os=linux --arch=arm64
|
||||
|
|
26
external/libconfig/CMakeLists.txt
vendored
Normal file
26
external/libconfig/CMakeLists.txt
vendored
Normal file
|
@ -0,0 +1,26 @@
|
|||
set(LIBCONFIG_INSTALL_PATH "${EXTERNAL_LIBS_OUTPUT_PATH}/libconfig")
|
||||
if(${TARGET_PLATFORM} MATCHES ${DEFINE_LINUX})
|
||||
set(CONFIGURE_COMMAND "--disable-cxx --enable-static=yes --prefix=${LIBCONFIG_INSTALL_PATH}")
|
||||
else()
|
||||
set(CONFIGURE_COMMAND "--host=${COMPILE_HOST} --disable-cxx --enable-static=yes --prefix=${LIBCONFIG_INSTALL_PATH}")
|
||||
endif()
|
||||
message("Compile libconfig comand : ${CONFIGURE_COMMAND}")
|
||||
add_custom_target(
|
||||
libconfig
|
||||
COMMAND test -f ${EXTERNAL_SOURCE_PATH}/libconfig-1.7.3/Makefile || tar zxvf libconfig-1.7.3.tar.gz
|
||||
COMMAND chmod 777 -R libconfig-1.7.3
|
||||
# COMMAND cd libconfig-1.7.3 && ./configure --disable-cxx --enable-static=yes --prefix=${LIBCONFIG_INSTALL_PATH}
|
||||
COMMAND cd libconfig-1.7.3 && bash -c "./configure ${CONFIGURE_COMMAND}"
|
||||
COMMAND cd libconfig-1.7.3 && make
|
||||
COMMAND cd libconfig-1.7.3 && make install
|
||||
COMMAND cd libconfig-1.7.3 && make clean
|
||||
WORKING_DIRECTORY ${EXTERNAL_SOURCE_PATH}/libconfig/
|
||||
)
|
||||
add_custom_target(
|
||||
remove_libconfig_source_files
|
||||
COMMAND rm -rf libconfig-1.7.3
|
||||
WORKING_DIRECTORY ${EXTERNAL_SOURCE_PATH}/libconfig/
|
||||
)
|
||||
|
||||
# 将clean目标依赖于我们自定义的clean_script目标
|
||||
add_dependencies(sdk_clean remove_libconfig_source_files)
|
|
@ -16,6 +16,7 @@ include_directories(
|
|||
link_directories(
|
||||
${LIBS_OUTPUT_PATH}
|
||||
${EXTERNAL_LIBS_OUTPUT_PATH}
|
||||
${EXTERNAL_LIBS_OUTPUT_PATH}/libconfig/lib
|
||||
)
|
||||
|
||||
aux_source_directory(. SRC_FILES)
|
||||
|
|
|
@ -31,6 +31,7 @@ include_directories(
|
|||
link_directories(
|
||||
${LIBS_OUTPUT_PATH}
|
||||
${EXTERNAL_LIBS_OUTPUT_PATH}
|
||||
${EXTERNAL_LIBS_OUTPUT_PATH}/libconfig/lib
|
||||
)
|
||||
|
||||
aux_source_directory(. SRC_FILES_MAIN)
|
||||
|
|
|
@ -23,6 +23,7 @@ include_directories(
|
|||
link_directories(
|
||||
${LIBS_OUTPUT_PATH}
|
||||
${EXTERNAL_LIBS_OUTPUT_PATH}
|
||||
${EXTERNAL_LIBS_OUTPUT_PATH}/libconfig/lib
|
||||
)
|
||||
|
||||
aux_source_directory(. SRC_FILES_MAIN)
|
||||
|
|
|
@ -15,6 +15,7 @@ include_directories(
|
|||
link_directories(
|
||||
${LIBS_OUTPUT_PATH}
|
||||
${EXTERNAL_LIBS_OUTPUT_PATH}
|
||||
${EXTERNAL_LIBS_OUTPUT_PATH}/libconfig/lib
|
||||
)
|
||||
|
||||
aux_source_directory(. SRC_FILES)
|
||||
|
|
|
@ -9,7 +9,7 @@ include_directories(
|
|||
./include
|
||||
${UTILS_SOURCE_PATH}/StatusCode/include
|
||||
${UTILS_SOURCE_PATH}/Log/include
|
||||
${EXTERNAL_SOURCE_PATH}/libconfig/libconfig-1.7.3/lib
|
||||
${EXTERNAL_LIBS_OUTPUT_PATH}/libconfig/include
|
||||
)
|
||||
# link_directories(
|
||||
# ${EXTERNAL_SOURCE_PATH}/libconfig/libconfig-1.7.3/lib/.libs
|
||||
|
@ -19,7 +19,7 @@ aux_source_directory(./src SRC_FILES)
|
|||
|
||||
set(TARGET_NAME ConfigBase)
|
||||
add_library(${TARGET_NAME} STATIC ${SRC_FILES})
|
||||
target_link_libraries(${TARGET_NAME} StatusCode Log libconfig.a)
|
||||
target_link_libraries(${TARGET_NAME} StatusCode Log config)
|
||||
|
||||
if ("${COMPILE_IMPROVE_SUPPORT}" MATCHES "true")
|
||||
add_custom_target(
|
||||
|
@ -57,18 +57,29 @@ add_custom_command(
|
|||
endif()
|
||||
|
||||
# build libconfig before make libConfigBase.a
|
||||
# add_custom_command(
|
||||
# OUTPUT ${EXTERNAL_LIBS_OUTPUT_PATH}/libconfig.a
|
||||
# COMMAND echo "Build libconfig-1.7.3. COMPILE_HOST = ${COMPILE_HOST}"
|
||||
# COMMAND sh build_libconfig.sh ${TARGET_PLATFORM} ${COMPILE_HOST}
|
||||
# COMMAND mv ${EXTERNAL_SOURCE_PATH}/libconfig/libconfig-1.7.3/lib/.libs/libconfig.a ${EXTERNAL_LIBS_OUTPUT_PATH}/libconfig.a
|
||||
# COMMAND cd libconfig-1.7.3; make clean;
|
||||
# WORKING_DIRECTORY ${EXTERNAL_SOURCE_PATH}/libconfig/
|
||||
# )
|
||||
# add_custom_target(
|
||||
# libconfig.a
|
||||
# DEPENDS ${EXTERNAL_LIBS_OUTPUT_PATH}/libconfig.a
|
||||
# )
|
||||
add_custom_command(
|
||||
OUTPUT ${EXTERNAL_LIBS_OUTPUT_PATH}/libconfig.a
|
||||
COMMAND echo "Build libconfig-1.7.3. COMPILE_HOST = ${COMPILE_HOST}"
|
||||
COMMAND sh build_libconfig.sh ${TARGET_PLATFORM} ${COMPILE_HOST}
|
||||
COMMAND mv ${EXTERNAL_SOURCE_PATH}/libconfig/libconfig-1.7.3/lib/.libs/libconfig.a ${EXTERNAL_LIBS_OUTPUT_PATH}/libconfig.a
|
||||
COMMAND cd libconfig-1.7.3; make clean;
|
||||
WORKING_DIRECTORY ${EXTERNAL_SOURCE_PATH}/libconfig/
|
||||
OUTPUT ${EXTERNAL_LIBS_OUTPUT_PATH}/libconfig/lib/libconfig.a
|
||||
COMMAND echo "Did not libconfig libs in output_files, now compile libconfig."
|
||||
COMMAND make libconfig
|
||||
WORKING_DIRECTORY ${PLATFORM_PATH}/cmake-shell/
|
||||
)
|
||||
add_custom_target(
|
||||
libconfig.a
|
||||
DEPENDS ${EXTERNAL_LIBS_OUTPUT_PATH}/libconfig.a
|
||||
compile_libconfig
|
||||
DEPENDS ${EXTERNAL_LIBS_OUTPUT_PATH}/libconfig/lib/libconfig.a
|
||||
)
|
||||
add_dependencies(${TARGET_NAME} compile_libconfig)
|
||||
|
||||
define_file_name(${TARGET_NAME})
|
||||
config_owner(${TARGET_NAME})
|
||||
|
|
15
utils/MediaBase/src/MediaBaseImpl.cpp
Normal file
15
utils/MediaBase/src/MediaBaseImpl.cpp
Normal 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 "MediaBaseImpl.h"
|
24
utils/MediaBase/src/MediaBaseImpl.h
Normal file
24
utils/MediaBase/src/MediaBaseImpl.h
Normal file
|
@ -0,0 +1,24 @@
|
|||
/*
|
||||
* 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 MEDIA_BASE_IMPL_H
|
||||
#define MEDIA_BASE_IMPL_H
|
||||
#include "IMediaBase.h"
|
||||
class MediaBaseImpl : public IMediaBase
|
||||
{
|
||||
public:
|
||||
MediaBaseImpl() = default;
|
||||
virtual ~MediaBaseImpl() = default;
|
||||
};
|
||||
#endif
|
Loading…
Reference in New Issue
Block a user