mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-22 10:40:05 +08:00
ZLM CXX添加exprt文件,ext-codec引用zlm中宏定义,完善install相关文件安装
This commit is contained in:
parent
e389d16379
commit
0eca329dba
@ -237,9 +237,14 @@ endif()
|
||||
# 未在使用
|
||||
if(ENABLE_CXX_API)
|
||||
# 保留目录结构
|
||||
#install(DIRECTORY ${ToolKit_ROOT}/
|
||||
# DESTINATION ${INSTALL_PATH_INCLUDE}/ZLToolKit
|
||||
# REGEX "(.*[.](md|cpp)|win32)$" EXCLUDE)
|
||||
#install(TARGETS zltoolkit
|
||||
# DESTINATION ${INSTALL_PATH_LIB})
|
||||
install(DIRECTORY ${ToolKit_ROOT}/src/
|
||||
DESTINATION ${INSTALL_PATH_INCLUDE}/ZLToolKit
|
||||
REGEX "(.*[.](md|cpp)|win32)$" EXCLUDE)
|
||||
if(ENABLE_CXX_API)
|
||||
install(TARGETS zltoolkit
|
||||
DESTINATION ${INSTALL_PATH_BIN})
|
||||
else()
|
||||
install(TARGETS zltoolkit
|
||||
DESTINATION ${INSTALL_PATH_LIB})
|
||||
endif()
|
||||
endif()
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit 9c5292f4f5c7fe36794c9b33d24c4b95e932f114
|
||||
Subproject commit fdd3450fc6bee60f8fb16ac4fd272c54d6b27238
|
@ -30,7 +30,7 @@
|
||||
|
||||
#if defined(_WIN32) && defined(_MSC_VER)
|
||||
# if !defined(GENERATE_EXPORT)
|
||||
# if defined(MediaKitApi_EXPORTS)
|
||||
# if defined(mk_api_EXPORTS)
|
||||
# define API_EXPORT __declspec(dllexport)
|
||||
# else
|
||||
# define API_EXPORT __declspec(dllimport)
|
||||
|
@ -23,9 +23,6 @@
|
||||
|
||||
set(COMPILE_DEFINITIONS)
|
||||
set(INCLUDE_DIRECTORIES)
|
||||
# for zlm
|
||||
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../src)
|
||||
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../3rdpart/ZLToolKit/src)
|
||||
|
||||
file(GLOB EXT_SRC_LIST
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/*.c
|
||||
@ -38,9 +35,21 @@ add_library(ZLMediaKit::ext-codec ALIAS ext-codec)
|
||||
|
||||
target_compile_options(ext-codec PRIVATE ${COMPILE_OPTIONS_DEFAULT})
|
||||
target_compile_definitions(ext-codec PUBLIC ${COMPILE_DEFINITIONS})
|
||||
target_compile_definitions(ext-codec PRIVATE ${MK_COMPILE_DEFINITIONS})
|
||||
|
||||
#target_link_libraries(ext-codec PRIVATE ZLMediaKit::MediaKit ZLMediaKit::ToolKit ${LINK_LIBRARIES})
|
||||
|
||||
# for zlm
|
||||
target_include_directories(ext-codec PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../src ${CMAKE_CURRENT_SOURCE_DIR}/../3rdpart/ZLToolKit/src)
|
||||
|
||||
set(MediaServer_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/../3rdpart/media-server")
|
||||
set(MediaServer_FLV_ROOT ${MediaServer_ROOT}/libflv)
|
||||
target_include_directories(ext-codec
|
||||
PRIVATE
|
||||
"$<BUILD_INTERFACE:${MediaServer_FLV_ROOT}/include>"
|
||||
PUBLIC
|
||||
"$<BUILD_INTERFACE:${MediaServer_FLV_ROOT}/include>")
|
||||
|
||||
target_include_directories(ext-codec
|
||||
PRIVATE
|
||||
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>"
|
||||
|
@ -21,6 +21,8 @@
|
||||
# SOFTWARE.
|
||||
#
|
||||
|
||||
include(GenerateExportHeader)
|
||||
|
||||
file(GLOB MediaKit_SRC_LIST
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/*/*.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/*/*.cpp
|
||||
@ -31,7 +33,12 @@ if(USE_SOLUTION_FOLDERS AND (NOT GROUP_BY_EXPLORER))
|
||||
set_file_group("${CMAKE_CURRENT_SOURCE_DIR}" ${MediaKit_SRC_LIST})
|
||||
endif()
|
||||
|
||||
if(ENABLE_CXX_API)
|
||||
if(NOT ENABLE_CXX_API OR IOS)
|
||||
# 添加库
|
||||
add_library(zlmediakit STATIC ${MediaKit_SRC_LIST})
|
||||
add_library(ZLMediaKit::MediaKit ALIAS zlmediakit)
|
||||
list(APPEND COMPILE_DEFINITIONS MediaKit_STATIC)
|
||||
else()
|
||||
# 在 Windows 下启用导出所有符号的选项
|
||||
if(WIN32)
|
||||
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE)
|
||||
@ -46,10 +53,6 @@ if(ENABLE_CXX_API)
|
||||
set_target_properties(zlmediakit PROPERTIES
|
||||
OUTPUT_NAME zlmediakit # 输出的 DLL 文件名
|
||||
)
|
||||
else ()
|
||||
# 添加库
|
||||
add_library(zlmediakit STATIC ${MediaKit_SRC_LIST})
|
||||
add_library(ZLMediaKit::MediaKit ALIAS zlmediakit)
|
||||
endif ()
|
||||
|
||||
set(LINK_LIBRARIES ${MK_LINK_LIBRARIES})
|
||||
@ -63,19 +66,35 @@ target_compile_options(zlmediakit
|
||||
target_link_libraries(zlmediakit
|
||||
PUBLIC ${LINK_LIBRARIES})
|
||||
target_include_directories(zlmediakit
|
||||
PRIVATE
|
||||
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>"
|
||||
PUBLIC
|
||||
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>")
|
||||
PRIVATE
|
||||
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>"
|
||||
"$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>"
|
||||
|
||||
PUBLIC
|
||||
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>"
|
||||
"$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>"
|
||||
)
|
||||
|
||||
update_cached_list(MK_LINK_LIBRARIES ZLMediaKit::MediaKit)
|
||||
|
||||
|
||||
generate_export_header(zlmediakit
|
||||
EXPORT_MACRO_NAME MK_EXPORT
|
||||
BASE_NAME MK_CXX
|
||||
STATIC_DEFINE MediaKit_STATIC
|
||||
EXPORT_FILE_NAME "${CMAKE_CURRENT_BINARY_DIR}/mk_cxx_export.h")
|
||||
|
||||
# 未在使用
|
||||
if(ENABLE_CXX_API)
|
||||
# 保留目录结构
|
||||
#install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/
|
||||
# DESTINATION ${INSTALL_PATH_INCLUDE}/ZLMediaKit
|
||||
# REGEX ".*[.](md|cpp)$" EXCLUDE)
|
||||
#install(TARGETS zlmediakit
|
||||
# DESTINATION ${INSTALL_PATH_LIB})
|
||||
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/
|
||||
DESTINATION ${INSTALL_PATH_INCLUDE}/ZLMediaKit
|
||||
REGEX ".*[.](md|cpp)$" EXCLUDE)
|
||||
if(ENABLE_CXX_API)
|
||||
install(TARGETS zlmediakit
|
||||
DESTINATION ${INSTALL_PATH_BIN})
|
||||
else()
|
||||
install(TARGETS zlmediakit
|
||||
DESTINATION ${INSTALL_PATH_LIB})
|
||||
endif()
|
||||
endif ()
|
||||
|
@ -79,20 +79,28 @@ extern void Assert_Throw(int failed, const char *exp, const char *func, const ch
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(ENABLE_CXX_API)
|
||||
|
||||
#if defined(GENERATE_EXPORT)
|
||||
#include "mk_cxx_export.h"
|
||||
#endif
|
||||
|
||||
#if defined(_WIN32) && defined(_MSC_VER)
|
||||
# if defined(MediaKit_EXPORTS)
|
||||
# define API_CALL __cdecl
|
||||
#else
|
||||
# define API_CALL
|
||||
#endif
|
||||
|
||||
#if defined(_WIN32) && defined(_MSC_VER)
|
||||
# if !defined(GENERATE_EXPORT)
|
||||
# if defined(zlmediakit_EXPORTS)
|
||||
# define MK_EXPORT __declspec(dllexport)
|
||||
# else
|
||||
# define MK_EXPORT __declspec(dllimport)
|
||||
# endif
|
||||
#else
|
||||
# endif
|
||||
#elif !defined(GENERATE_EXPORT)
|
||||
# define MK_EXPORT __attribute__((visibility("default")))
|
||||
#endif
|
||||
#else
|
||||
# define MK_EXPORT
|
||||
#endif
|
||||
|
||||
|
||||
namespace mediakit {
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user