Skip to content

Commit fa63553

Browse files
committed
master: make cppad_static_lib = true the default on windows .
1 parent f5d5710 commit fa63553

File tree

3 files changed

+23
-10
lines changed

3 files changed

+23
-10
lines changed

CMakeLists.txt

+15-5
Original file line numberDiff line numberDiff line change
@@ -217,15 +217,25 @@ command_line_arg(cppad_tape_addr_type "unsigned int" STRING
217217
"type used to identify variables on one tape, size must be <= sizeof(size_t)"
218218
)
219219
#
220-
# cppad_static_lib
221-
command_line_arg(cppad_static_lib FALSE BOOL
222-
"If true (false) the cppad library will be static (shared)"
223-
)
224-
#
225220
# cppad_debug_and_release
226221
command_line_arg(cppad_debug_and_release TRUE BOOL
227222
"If true the cppad library and tests will be able to mix debug and release"
228223
)
224+
#
225+
# cppad_static_lib
226+
STRING( REGEX MATCH "^MSYS" is_msys "${CMAKE_SYSTEM_NAME}" )
227+
STRING( REGEX MATCH "^CYGWIN" is_cygwin "${CMAKE_SYSTEM_NAME}" )
228+
STRING( REGEX MATCH "^Windows" is_windows "${CMAKE_SYSTEM_NAME}" )
229+
IF( is_msys OR is_cygwin OR is_windows )
230+
SET(default_cppad_static_lib TRUE)
231+
ELSE( )
232+
SET(default_cppad_static_lib FALSE)
233+
ENDIF( )
234+
#
235+
# cppad_static_lib
236+
command_line_arg(cppad_static_lib ${default_cppad_static_lib} BOOL
237+
"If true (false) the cppad library will be static (shared)"
238+
)
229239
# ----------------------------------------------------------------------------
230240
#
231241
# Ensure c++11 support

appendix/whats_new/2025.xrst

+6-3
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
dll
99
jit
1010
rpath
11+
msys
1112
}
1213

1314
Release Notes for 2025
@@ -18,12 +19,14 @@ mm-dd
1819

1920
02-09
2021
=====
21-
Systems that use windows dll files would always build a static
22+
Systems that use windows dll files,
23+
(msys, cygwin, and windows) would always build a static
2224
version of the cppad library; i.e., the
2325
`cmake@cppad_static_lib` flag was ignored in this case.
2426
This has been changed so that the cppad_static_lib flag is always respected.
25-
If you have trouble linking on a windows system, perhaps setting
26-
this flag to true will help.
27+
The default value for *cppad_static_lib* on msys, cygwin, and windows is true
28+
and on other systems it is false; i.e., if you do not specify cppad_static_lib
29+
you will get the same result as before this change.
2730

2831

2932
02-02

xrst/install/cmake.xrst

+2-2
Original file line numberDiff line numberDiff line change
@@ -410,8 +410,8 @@ will build the corresponding documentation in the
410410

411411
cppad_static_lib
412412
****************
413-
The default value for this option is false.
414-
If it is true (false)
413+
The default value for this option is true on
414+
``msys``, ``cygwin`` and ``Windows`` and false otherwise.
415415
the cppad library will be a static (shared) library.
416416
If the target system uses windows dlls, this setting should be true and
417417
if it is false, a warning will be issued and it will be ignored.

0 commit comments

Comments
 (0)