Merge pull request #1584 from Dw9/master

Update CMakeLists.txt
This commit is contained in:
夏楚 2022-04-19 19:45:01 +08:00 committed by GitHub
commit c31d44d680
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -17,10 +17,14 @@ else ()
add_definitions(-DMediaKitApi_EXPORTS) add_definitions(-DMediaKitApi_EXPORTS)
endif () endif ()
endif() endif()
target_link_libraries(mk_api ${LINK_LIB_LIST} jsoncpp) 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 ()
add_subdirectory(tests) add_subdirectory(tests)
file(GLOB api_header_list include/*.h) file(GLOB api_header_list include/*.h)
install(FILES ${api_header_list} DESTINATION ${INSTALL_PATH_INCLUDE}) install(FILES ${api_header_list} DESTINATION ${INSTALL_PATH_INCLUDE})
install(TARGETS mk_api ARCHIVE DESTINATION ${INSTALL_PATH_LIB} LIBRARY DESTINATION ${INSTALL_PATH_LIB}) install(TARGETS mk_api ARCHIVE DESTINATION ${INSTALL_PATH_LIB} LIBRARY DESTINATION ${INSTALL_PATH_LIB})
endif () endif ()