File tree Expand file tree Collapse file tree 3 files changed +4
-10
lines changed Expand file tree Collapse file tree 3 files changed +4
-10
lines changed Original file line number Diff line number Diff line change @@ -153,7 +153,7 @@ endif
153153if USE_EXAMPLES
154154noinst_PROGRAMS += ecdsa_example
155155ecdsa_example_SOURCES = examples/ecdsa.c
156- ecdsa_example_CPPFLAGS = -I$(top_srcdir ) /include
156+ ecdsa_example_CPPFLAGS = -I$(top_srcdir ) /include -DSECP256K1_STATICLIB
157157ecdsa_example_LDADD = libsecp256k1.la
158158ecdsa_example_LDFLAGS = -static
159159if BUILD_WINDOWS
@@ -163,7 +163,7 @@ TESTS += ecdsa_example
163163if ENABLE_MODULE_ECDH
164164noinst_PROGRAMS += ecdh_example
165165ecdh_example_SOURCES = examples/ecdh.c
166- ecdh_example_CPPFLAGS = -I$(top_srcdir ) /include
166+ ecdh_example_CPPFLAGS = -I$(top_srcdir ) /include -DSECP256K1_STATICLIB
167167ecdh_example_LDADD = libsecp256k1.la
168168ecdh_example_LDFLAGS = -static
169169if BUILD_WINDOWS
@@ -174,7 +174,7 @@ endif
174174if ENABLE_MODULE_SCHNORRSIG
175175noinst_PROGRAMS += schnorr_example
176176schnorr_example_SOURCES = examples/schnorr.c
177- schnorr_example_CPPFLAGS = -I$(top_srcdir ) /include
177+ schnorr_example_CPPFLAGS = -I$(top_srcdir ) /include -DSECP256K1_STATICLIB
178178schnorr_example_LDADD = libsecp256k1.la
179179schnorr_example_LDFLAGS = -static
180180if BUILD_WINDOWS
Original file line number Diff line number Diff line change @@ -127,12 +127,6 @@ AC_DEFUN([SECP_TRY_APPEND_DEFAULT_CFLAGS], [
127127 SECP_TRY_APPEND_CFLAGS([ -wd4267] , $1 ) # Disable warning C4267 "'var' : conversion from 'size_t' to 'type', possible loss of data".
128128 # Eliminate deprecation warnings for the older, less secure functions.
129129 CPPFLAGS="-D_CRT_SECURE_NO_WARNINGS $CPPFLAGS"
130- # We pass -ignore:4217 to the MSVC linker to suppress warning 4217 when
131- # importing variables from a statically linked secp256k1.
132- # (See the libtool manual, section "Windows DLLs" for background.)
133- # Unfortunately, libtool tries to be too clever and strips "-Xlinker arg"
134- # into "arg", so this will be " -Xlinker -ignore:4217" after stripping.
135- LDFLAGS="-Xlinker -Xlinker -Xlinker -ignore:4217 $LDFLAGS"
136130 fi
137131] )
138132SECP_TRY_APPEND_DEFAULT_CFLAGS(SECP_CFLAGS)
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ target_link_libraries(example INTERFACE
77 $<$<PLATFORM_ID:Windows>:bcrypt>
88)
99if (NOT BUILD_SHARED_LIBS AND MSVC )
10- target_link_options (example INTERFACE / IGNORE :4217 )
10+ target_compile_definitions (example INTERFACE SECP256K1_STATICLIB )
1111endif ()
1212
1313add_executable (ecdsa_example ecdsa.c)
You can’t perform that action at this time.
0 commit comments