mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-22 10:40:05 +08:00
修复cmake generate export 和 test工程先后变编译错误问题
This commit is contained in:
parent
e2908e9775
commit
4e57416be9
@ -5,19 +5,20 @@ file(GLOB api_src_list include/*.h source/*.cpp source/*.h source/*.c)
|
|||||||
if (IOS)
|
if (IOS)
|
||||||
add_library(mk_api STATIC ${api_src_list})
|
add_library(mk_api STATIC ${api_src_list})
|
||||||
target_link_libraries(mk_api ${LINK_LIB_LIST} jsoncpp)
|
target_link_libraries(mk_api ${LINK_LIB_LIST} jsoncpp)
|
||||||
else ()
|
return()
|
||||||
if (ENABLE_API_STATIC_LIB)
|
endif ()
|
||||||
add_library(mk_api STATIC ${api_src_list})
|
|
||||||
else ()
|
|
||||||
add_library(mk_api SHARED ${api_src_list})
|
|
||||||
endif ()
|
|
||||||
|
|
||||||
if (CMAKE_SYSTEM_NAME MATCHES "Linux")
|
if (ENABLE_API_STATIC_LIB)
|
||||||
target_link_libraries(mk_api -Wl,--start-group jsoncpp ${LINK_LIB_LIST} -Wl,--end-group)
|
add_definitions(-DMediaKitApi_STATIC)
|
||||||
else ()
|
add_library(mk_api STATIC ${api_src_list})
|
||||||
target_link_libraries(mk_api jsoncpp ${LINK_LIB_LIST})
|
else ()
|
||||||
endif ()
|
add_library(mk_api SHARED ${api_src_list})
|
||||||
add_subdirectory(tests)
|
endif ()
|
||||||
|
|
||||||
|
if (CMAKE_SYSTEM_NAME MATCHES "Linux")
|
||||||
|
target_link_libraries(mk_api -Wl,--start-group jsoncpp ${LINK_LIB_LIST} -Wl,--end-group)
|
||||||
|
else ()
|
||||||
|
target_link_libraries(mk_api jsoncpp ${LINK_LIB_LIST})
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
add_definitions(-DGENERATE_EXPORT)
|
add_definitions(-DGENERATE_EXPORT)
|
||||||
@ -29,8 +30,8 @@ generate_export_header(mk_api
|
|||||||
EXPORT_FILE_NAME "${CMAKE_BINARY_DIR}/mk_export.h"
|
EXPORT_FILE_NAME "${CMAKE_BINARY_DIR}/mk_export.h"
|
||||||
)
|
)
|
||||||
|
|
||||||
if (NOT IOS)
|
add_subdirectory(tests)
|
||||||
file(GLOB api_header_list include/*.h ${CMAKE_BINARY_DIR}/*.h)
|
|
||||||
install(FILES ${api_header_list} DESTINATION ${INSTALL_PATH_INCLUDE})
|
file(GLOB api_header_list include/*.h ${CMAKE_BINARY_DIR}/*.h)
|
||||||
install(TARGETS mk_api ARCHIVE DESTINATION ${INSTALL_PATH_LIB} LIBRARY DESTINATION ${INSTALL_PATH_LIB})
|
install(FILES ${api_header_list} DESTINATION ${INSTALL_PATH_INCLUDE})
|
||||||
endif ()
|
install(TARGETS mk_api ARCHIVE DESTINATION ${INSTALL_PATH_LIB} LIBRARY DESTINATION ${INSTALL_PATH_LIB})
|
Loading…
Reference in New Issue
Block a user