mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-27 17:40:49 +00:00
Don't include selftests objects in build when unit tests are disabled
While working on the preceding selftests patches, I noticed that some
selftests-specific files are included in the build even when selftests
are disabled, namely disasm-selftest.c and gdbarch-selftests.c. These
files are entirely #if'ed out when building with selftests disabled.
This is not a huge problem, but I think it would make more sense if
these files were simply not built.
With this patch, I propose to put all the selftests-specific source
files into a SELFTESTS_SRCS Makefile variable (even selftest-arch.c,
which is currently added by the configure script).
gdb/ChangeLog:
* Makefile.in (SUBDIR_UNITTESTS_SRCS): Rename to...
(SELFTESTS_SRCS): ... this. Add disasm-selftests.c,
gdbarch-selfselftests.c and selftest-arch.c.
(SUBDIR_UNITTESTS_OBS): Rename to...
(SELFTESTS_OBS): ... this.
(COMMON_SFILES): Remove disasm-selftests.c and
gdbarch-selftests.c.
* configure.ac: Don't add selftest-arch.{c,o} to
CONFIG_{SRCS,OBS}.
* disasm-selftests.c, gdbarch-selftests.c: Remove GDB_SELF_TEST
preprocessor conditions.
This commit is contained in:
4
gdb/configure
vendored
4
gdb/configure
vendored
@@ -19210,8 +19210,8 @@ if $enable_unittests; then
|
||||
$as_echo "#define GDB_SELF_TEST 1" >>confdefs.h
|
||||
|
||||
|
||||
CONFIG_OBS="$CONFIG_OBS \$(SUBDIR_UNITTESTS_OBS) selftest-arch.o"
|
||||
CONFIG_SRCS="$CONFIG_SRCS \$(SUBDIR_UNITTESTS_SRCS) selftest-arch.c"
|
||||
CONFIG_OBS="$CONFIG_OBS \$(SELFTESTS_OBS)"
|
||||
CONFIG_SRCS="$CONFIG_SRCS \$(SELFTESTS_SRCS)"
|
||||
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user