mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-06-27 04:22:20 +08:00
cmake构建时自动生成mk_export头文件,解决msvc链接设备问题 (#1660)
* 解决msvc下链接问题 * CMAKE添加自动生成mk api export头文件 * 兼容非cmake构建时情况 Co-authored-by: baiyfcu <baiyfcu@gmail.com>
This commit is contained in:
@@ -14,21 +14,26 @@
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
|
||||
#if defined(GENERATE_EXPORT)
|
||||
#include "mk_export.h"
|
||||
#endif
|
||||
|
||||
#if defined(_WIN32) && defined(_MSC_VER)
|
||||
# ifndef MediaKitApi_STATIC
|
||||
# if defined(MediaKitApi_EXPORTS)
|
||||
# define API_EXPORT __declspec(dllexport)
|
||||
# else
|
||||
# define API_EXPORT __declspec(dllimport)
|
||||
# endif
|
||||
# define API_CALL __cdecl
|
||||
# else
|
||||
# define API_EXPORT
|
||||
# define API_CALL
|
||||
# endif
|
||||
# define API_CALL __cdecl
|
||||
#else
|
||||
# define API_CALL
|
||||
#endif
|
||||
|
||||
#if defined(_WIN32) && defined(_MSC_VER)
|
||||
# if !defined(GENERATE_EXPORT)
|
||||
# if defined(MediaKitApi_EXPORTS)
|
||||
# define API_EXPORT __declspec(dllexport)
|
||||
# else
|
||||
# define API_EXPORT __declspec(dllimport)
|
||||
# endif
|
||||
# endif
|
||||
#elif !defined(GENERATE_EXPORT)
|
||||
# define API_EXPORT
|
||||
# define API_CALL
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
Reference in New Issue
Block a user