mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-07-05 10:58:11 +08:00
优化CMakeList, 完善iOS下编译配置 (#2578)
1、调整 json 的源码引入,外部可以引入 json/json.h 使用; 2、针对 iOS 工程调整 cmake 配置,解决 iOS 环境下mk_util.h 找不到问题;同时在 iOS 工程中引入 MediaServer 静态库;
This commit is contained in:
@@ -30,13 +30,6 @@ file(GLOB API_SRC_LIST
|
||||
|
||||
set(LINK_LIBRARIES ${MK_LINK_LIBRARIES})
|
||||
|
||||
if(IOS)
|
||||
add_library(mk_api STATIC ${API_SRC_LIST})
|
||||
target_link_libraries(mk_api
|
||||
PRIVATE ${LINK_LIBRARIES})
|
||||
return()
|
||||
endif ()
|
||||
|
||||
set(COMPILE_DEFINITIONS ${MK_COMPILE_DEFINITIONS})
|
||||
|
||||
if (MSVC)
|
||||
@@ -46,6 +39,8 @@ endif ()
|
||||
if(ENABLE_API_STATIC_LIB)
|
||||
add_library(mk_api STATIC ${API_SRC_LIST})
|
||||
list(APPEND COMPILE_DEFINITIONS MediaKitApi_STATIC)
|
||||
elseif(IOS)
|
||||
add_library(mk_api STATIC ${API_SRC_LIST})
|
||||
else()
|
||||
add_library(mk_api SHARED ${API_SRC_LIST})
|
||||
endif()
|
||||
@@ -82,6 +77,11 @@ install(TARGETS mk_api
|
||||
LIBRARY DESTINATION ${INSTALL_PATH_LIB}
|
||||
RUNTIME DESTINATION ${INSTALL_PATH_RUNTIME})
|
||||
|
||||
# IOS 跳过测试代码
|
||||
if(IOS)
|
||||
return()
|
||||
endif()
|
||||
|
||||
if (ENABLE_TESTS)
|
||||
add_subdirectory(tests)
|
||||
endif()
|
||||
|
||||
Reference in New Issue
Block a user