优化cmake

This commit is contained in:
xiongziliang 2022-05-28 09:48:19 +08:00
parent 93201f40d3
commit 0c5b3f87e5

View File

@ -8,6 +8,9 @@ if (IOS)
return() return()
endif () endif ()
add_definitions(-DGENERATE_EXPORT)
include_directories(${CMAKE_BINARY_DIR})
if (ENABLE_API_STATIC_LIB) if (ENABLE_API_STATIC_LIB)
add_definitions(-DMediaKitApi_STATIC) add_definitions(-DMediaKitApi_STATIC)
add_library(mk_api STATIC ${api_src_list}) add_library(mk_api STATIC ${api_src_list})
@ -21,8 +24,6 @@ else ()
target_link_libraries(mk_api jsoncpp ${LINK_LIB_LIST}) target_link_libraries(mk_api jsoncpp ${LINK_LIB_LIST})
endif () endif ()
add_definitions(-DGENERATE_EXPORT)
include_directories(${CMAKE_BINARY_DIR})
generate_export_header(mk_api generate_export_header(mk_api
EXPORT_MACRO_NAME API_EXPORT EXPORT_MACRO_NAME API_EXPORT
BASE_NAME MK_API BASE_NAME MK_API