meson.build 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. #
  2. # The main gdbstub still relies on per-build definitions of various
  3. # types. The bits pushed to softmmu/user.c try to use guest agnostic
  4. # types such as hwaddr.
  5. #
  6. # We need to build the core gdb code via a library to be able to tweak
  7. # cflags so:
  8. gdb_user_ss = ss.source_set()
  9. gdb_softmmu_ss = ss.source_set()
  10. # We build two versions of gdbstub, one for each mode
  11. gdb_user_ss.add(files('gdbstub.c', 'user.c'))
  12. gdb_softmmu_ss.add(files('gdbstub.c', 'softmmu.c'))
  13. gdb_user_ss = gdb_user_ss.apply(config_host, strict: false)
  14. gdb_softmmu_ss = gdb_softmmu_ss.apply(config_host, strict: false)
  15. libgdb_user = static_library('gdb_user',
  16. gdb_user_ss.sources() + genh,
  17. name_suffix: 'fa',
  18. c_args: '-DCONFIG_USER_ONLY',
  19. build_by_default: have_user)
  20. libgdb_softmmu = static_library('gdb_softmmu',
  21. gdb_softmmu_ss.sources() + genh,
  22. name_suffix: 'fa',
  23. build_by_default: have_system)
  24. gdb_user = declare_dependency(link_whole: libgdb_user)
  25. user_ss.add(gdb_user)
  26. gdb_softmmu = declare_dependency(link_whole: libgdb_softmmu)
  27. softmmu_ss.add(gdb_softmmu)
  28. common_ss.add(files('syscalls.c'))
  29. # The user-target is specialised by the guest
  30. specific_ss.add(when: 'CONFIG_USER_ONLY', if_true: files('user-target.c'))