clang-13 needed an operator==(const exact_type<T>&) defined to avoid an
ambiguity. Now that C++20 mode is enabled, switch to a
compiler-generated operator== instead of manually defining the
equivalent function.
clang rejects the entire database if any entry lacks a 'file' key,
regardless of whether the entry is used.
Fixes: bc6d043f5d ("Extend SConstruct compilation_database support to cover Program()")
`check_header_includes` requires `git` to be installed and able to list
files from a working copy. When `GIT=''` is used, SConstruct is told
not to find or run `git`. This caused a traceback when
`check_header_includes` tried to use git to list headers. Reorder the
test to report a clear failure message.
Commit f1606f7747 ("Simplify test for
__builtin_bswap16") changed the SConstruct test to either define both
DXX_HAVE_BUILTIN_BSWAP and DXX_HAVE_BUILTIN_BSWAP16 or to define neither
of them. Follow up that commit by removing the definition of
DXX_HAVE_BUILTIN_BSWAP16 and redirecting uses of it to
DXX_HAVE_BUILTIN_BSWAP.
The result of git-archive expanding `$Format:%H` will always be a valid
string. Repeat the format specifier, so that the call to `.format()`
can be removed.
Select flags parsed from pkg-config stdout were logged to the screen and
to sconf.log. Add a line in sconf.log which shows the full stdout of
pkg-config.
This does not need to be a local function. It does not need to access
anything from the containing scope, so move it to be a static method on
the class.
This is not required by clang, but should be useful for anyone who wants
to produce a machine-readable list of all the compile commands run for
building the program. Previously, compilation_database would describe
how to build object files from sources, but not how to link those
objects.
On some systems, such as the Apple M1 (ARM-based Macs),
dylibbundler is in $PATH, but not in a directory found by the limited
path that SCons uses for Command() invocations. This causes the SConf
test to succeed (because it uses the full $PATH), but the Command() to
fail (because it uses a reduced path). Fix this by using the user's
$PATH, if defined, for this Command() invocation.
Along the way, rework tool_bundle.py to use SCons' Node() objects in
place of direct path manipulation. This lets SCons produce better error
messages in some cases.
Reported-by: Kreeblah <https://github.com/dxx-rebirth/dxx-rebirth/pull/610>
This test covered __builtin_bswap32 and __builtin_bswap16 separately,
because it was written to support gcc versions that predated the
introduction of __builtin_bswap16. The minimum supported gcc version
now understands both intrinsics, so simplify the test to cover all three
at once.
- Add support for a sequence of guard predicates for a test, rather than
limiting to a single predicate.
- Use that support to skip the dylibbundler test when
user_settings.macos_add_frameworks makes the test unnecessary.
- Use StaticSubprocess to avoid running dylibbundler repeatedly if
building multiple targets for which the test is necessary.
- Capture stderr from the child process, and log it, instead of letting
it be written directly to the stderr inherited from the caller of
SCons.
- On failure, write to the SConf log the return code of dylibbundler,
its stdout, and its stderr. This may help users diagnose the problem
if it is more complicated than the tool not being installed.
- On failure, show a more direct suggestion about how to avoid needing
dylibbundler.