diff options
author | Mats Wichmann <mats@linux.com> | 2023-01-20 23:48:17 (GMT) |
---|---|---|
committer | Mats Wichmann <mats@linux.com> | 2023-01-24 21:54:51 (GMT) |
commit | 378004ff41c6ed8937a35257b3fc67027b1bd3fd (patch) | |
tree | fcccf9fa7ec50d44beddcbdca45c04941c626822 /SCons/SConfTests.py | |
parent | 7bcef9fb97c1200ac4cec2d515b6d2c9d3aa0c6a (diff) | |
download | SCons-378004ff41c6ed8937a35257b3fc67027b1bd3fd.zip SCons-378004ff41c6ed8937a35257b3fc67027b1bd3fd.tar.gz SCons-378004ff41c6ed8937a35257b3fc67027b1bd3fd.tar.bz2 |
Add "append" kwarg to two configure checks
Add append=True/False to CheckLib, CheckLibWithHeader in SConf. The
"implementation", Conftest.CheckLib, already accepted this kwarg,
but it could not be passed from an SConscript using the offical API.
Updated manpage to describe and expanded a unit test to check.
Fixes #2767
Additionally, clarified some things in manpage, including a recent user
confusion about how to call CheckFunc.
Signed-off-by: Mats Wichmann <mats@linux.com>
Diffstat (limited to 'SCons/SConfTests.py')
-rw-r--r-- | SCons/SConfTests.py | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/SCons/SConfTests.py b/SCons/SConfTests.py index a06b227..172fba7 100644 --- a/SCons/SConfTests.py +++ b/SCons/SConfTests.py @@ -572,14 +572,27 @@ int main(void) { env = sconf.env.Clone() try: - r = sconf.CheckLibWithHeader( existing_lib, "math.h", "C", autoadd=1 ) + r = sconf.CheckLibWithHeader( + existing_lib, "math.h", "C", autoadd=True, append=True + ) assert r, "did not find math.h with %s" % existing_lib expect = libs(env) + [existing_lib] got = libs(sconf.env) assert got == expect, "LIBS: expected %s, got %s" % (expect, got) sconf.env = env.Clone() - r = sconf.CheckLibWithHeader( existing_lib, "math.h", "C", autoadd=0 ) + r = sconf.CheckLibWithHeader( + existing_lib, "math.h", "C", autoadd=True, append=False + ) + assert r, "did not find math.h with %s" % existing_lib + expect = [existing_lib] + libs(env) + got = libs(sconf.env) + assert got == expect, "LIBS: expected %s, got %s" % (expect, got) + + sconf.env = env.Clone() + r = sconf.CheckLibWithHeader( + existing_lib, "math.h", "C", autoadd=False + ) assert r, "did not find math.h with %s" % existing_lib expect = libs(env) got = libs(sconf.env) |