0001-Fix-build-without-threads.patch 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. From fc1b821c80c78f4ae635639c7fce5bad754edda7 Mon Sep 17 00:00:00 2001
  2. From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  3. Date: Sat, 27 Aug 2022 23:24:44 +0200
  4. Subject: [PATCH] Fix build without threads
  5. Allow the user to disable cpp tests to avoid the following build failure
  6. without threads raised since version 1.17.1 and
  7. https://git.gnupg.org/cgi-bin/gitweb.cgi?p=gpgme.git;a=commit;h=f3177d3ee0a1d30e15f33ff226b5e4c96b7610db
  8. run-wkdlookup.cpp: In function 'int main(int, char**)':
  9. run-wkdlookup.cpp:130:18: error: 'std::this_thread' has not been declared
  10. 130 | std::this_thread::sleep_for(std::chrono::milliseconds{250 * cnt});
  11. | ^~~~~~~~~~~
  12. Fixes:
  13. - http://autobuild.buildroot.org/results/2915f6105bae595274fabaa12de7cc53926d22d0
  14. Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  15. [Upstream status: https://dev.gnupg.org/T6165]
  16. ---
  17. configure.ac | 5 +++++
  18. lang/cpp/Makefile.am | 6 +++++-
  19. 2 files changed, 10 insertions(+), 1 deletion(-)
  20. diff --git a/configure.ac b/configure.ac
  21. index e7fe04a7..d1c87486 100644
  22. --- a/configure.ac
  23. +++ b/configure.ac
  24. @@ -553,6 +553,11 @@ AC_ARG_ENABLE(g13-test,
  25. run_g13_test=$enableval)
  26. AM_CONDITIONAL(RUN_G13_TESTS, test "$run_g13_test" = "yes")
  27. +run_cpp_test="yes"
  28. +AC_ARG_ENABLE(cpp-test,
  29. + AS_HELP_STRING([--disable-cpp-test],[disable CPP regression test]),
  30. + run_cpp_test=$enableval)
  31. +AM_CONDITIONAL(RUN_CPP_TESTS, test "$run_cpp_test" = "yes")
  32. # Checks for header files.
  33. AC_CHECK_HEADERS_ONCE([locale.h sys/select.h sys/uio.h argp.h stdint.h
  34. diff --git a/lang/cpp/Makefile.am b/lang/cpp/Makefile.am
  35. index 724da6ca..243c463d 100644
  36. --- a/lang/cpp/Makefile.am
  37. +++ b/lang/cpp/Makefile.am
  38. @@ -18,6 +18,10 @@
  39. # License along with this program; if not, see <https://gnu.org/licenses/>.
  40. # SPDX-License-Identifier: LGPL-2.1-or-later
  41. -SUBDIRS = src tests
  42. +SUBDIRS = src
  43. +
  44. +if RUN_CPP_TESTS
  45. +SUBDIRS += tests
  46. +endif
  47. EXTRA_DIST = README
  48. --
  49. 2.35.1