File tree 2 files changed +7
-6
lines changed
2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -134,10 +134,12 @@ typedef int (*secp256k1_nonce_function)(
134
134
#endif
135
135
136
136
/* Symbol visibility. See https://gcc.gnu.org/wiki/Visibility */
137
- /* DLL_EXPORT is defined internally for shared builds */
138
137
#if defined(_WIN32 )
139
- # ifdef SECP256K1_BUILD
140
- # ifdef DLL_EXPORT
138
+ # if defined(SECP256K1_BUILD )
139
+ # if defined(DLL_EXPORT ) || defined(SECP256K1_DLL_EXPORT )
140
+ /* Building libsecp256k1 as a DLL.
141
+ * 1. If using Libtool, it defines DLL_EXPORT automatically.
142
+ * 2. In other cases, SECP256k1_DLL_EXPORT must be defined. */
141
143
# define SECP256K1_API extern __declspec (dllexport)
142
144
# endif
143
145
/* The user must define SECP256K1_STATIC when consuming libsecp256k1 as a static
Original file line number Diff line number Diff line change @@ -20,10 +20,9 @@ if(SECP256K1_ASM STREQUAL "arm32")
20
20
target_link_libraries (secp256k1_asm INTERFACE secp256k1_asm_arm)
21
21
endif ()
22
22
23
- # Define our export symbol only for Win32 and only for shared libs.
24
- # This matches libtool's usage of DLL_EXPORT
23
+ # Define our export symbol only for Win32.
25
24
if (WIN32 )
26
- set_target_properties (secp256k1 PROPERTIES DEFINE_SYMBOL "DLL_EXPORT" )
25
+ set_target_properties (secp256k1 PROPERTIES DEFINE_SYMBOL SECP256k1_DLL_EXPORT )
27
26
target_compile_definitions (secp256k1 INTERFACE $<$<NOT :$<BOOL :${BUILD_SHARED_LIBS} >>:SECP256K1_STATICLIB>)
28
27
endif ()
29
28
You can’t perform that action at this time.
0 commit comments