From 67bb53746eae4ce1df4fa702081f25be0918fcd9 Mon Sep 17 00:00:00 2001 From: Dw9 Date: Tue, 19 Apr 2022 18:07:03 +0800 Subject: [PATCH] Update CMakeLists.txt --- api/CMakeLists.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/api/CMakeLists.txt b/api/CMakeLists.txt index 334a29c8..3198f6db 100644 --- a/api/CMakeLists.txt +++ b/api/CMakeLists.txt @@ -17,10 +17,14 @@ else () add_definitions(-DMediaKitApi_EXPORTS) 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) file(GLOB api_header_list include/*.h) install(FILES ${api_header_list} DESTINATION ${INSTALL_PATH_INCLUDE}) install(TARGETS mk_api ARCHIVE DESTINATION ${INSTALL_PATH_LIB} LIBRARY DESTINATION ${INSTALL_PATH_LIB}) -endif () \ No newline at end of file +endif ()