diff --git a/CMakeLists.txt b/CMakeLists.txt index 785ed3cd..473bc336 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -85,6 +85,8 @@ if(ENABLE_CXX_API) set(ENABLE_MSVC_MT OFF) message(WARNING "Windows下C++ API SDK只支持md/mdd,ENABLE_MSVC_MT set off") endif() +else() + add_definitions(-DMediaKit_STATIC) endif () # 安装路径 diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 510cb422..da51f70a 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -59,6 +59,8 @@ set(LINK_LIBRARIES ${MK_LINK_LIBRARIES}) list(REMOVE_ITEM LINK_LIBRARIES ZLMediaKit::MediaKit) set(COMPILE_DEFINITIONS ${MK_COMPILE_DEFINITIONS}) +list(APPEND COMPILE_DEFINITIONS GENERATE_EXPORT) + target_compile_definitions(zlmediakit PUBLIC ${COMPILE_DEFINITIONS}) target_compile_options(zlmediakit