File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -20,9 +20,15 @@ target_link_libraries(wsjtx_bridge PRIVATE wsjtx_lib)
2020# 设置C++标准
2121set_property (TARGET wsjtx_bridge PROPERTY CXX_STANDARD 17 )
2222
23- # Windows: 设置导出宏
24- if (WIN32 )
25- target_compile_definitions (wsjtx_bridge PRIVATE WSJTX_BRIDGE_EXPORTS )
23+ # 设置导出宏(全平台)
24+ target_compile_definitions (wsjtx_bridge PRIVATE WSJTX_BRIDGE_EXPORTS )
25+
26+ # 设置符号可见性(Unix平台)
27+ if (NOT WIN32 )
28+ set_target_properties (wsjtx_bridge PROPERTIES
29+ CXX_VISIBILITY_PRESET default
30+ VISIBILITY_INLINES_HIDDEN OFF
31+ )
2632endif ()
2733
2834# 包含wsjtx_lib头文件
Original file line number Diff line number Diff line change 77 #define WSJTX_BRIDGE_API __declspec(dllimport)
88 #endif
99#else
10- #define WSJTX_BRIDGE_API
10+ // Unix (Linux/macOS): 使用 GCC/Clang visibility 属性
11+ #ifdef WSJTX_BRIDGE_EXPORTS
12+ #define WSJTX_BRIDGE_API __attribute__((visibility("default")))
13+ #else
14+ #define WSJTX_BRIDGE_API
15+ #endif
1116#endif
1217
1318#ifdef __cplusplus
You can’t perform that action at this time.
0 commit comments