0001-CMake-don-t-enable-CXX-unless-building-tests-benchma.patch 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. From 8c2d8fc60306a8edd21182a1f5f267a7aca55763 Mon Sep 17 00:00:00 2001
  2. From: James Hilliard <james.hilliard1@gmail.com>
  3. Date: Sun, 29 Jan 2023 21:18:28 -0700
  4. Subject: [PATCH] CMake: don't enable CXX unless building tests/benchmarks
  5. We only need CXX support when building tests/benchmarks.
  6. Fixes:
  7. CMake Error at CMakeLists.txt:4 (PROJECT):
  8. No CMAKE_CXX_COMPILER could be found.
  9. Tell CMake where to find the compiler by setting either the environment
  10. variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
  11. to the compiler, or to the compiler name if it is in the PATH.
  12. Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
  13. [Upstream status:
  14. https://github.com/Maratyszcza/FXdiv/pull/3]
  15. ---
  16. CMakeLists.txt | 6 +++++-
  17. 1 file changed, 5 insertions(+), 1 deletion(-)
  18. diff --git a/CMakeLists.txt b/CMakeLists.txt
  19. index bcae6b5..c75f558 100644
  20. --- a/CMakeLists.txt
  21. +++ b/CMakeLists.txt
  22. @@ -1,7 +1,7 @@
  23. CMAKE_MINIMUM_REQUIRED(VERSION 3.5 FATAL_ERROR)
  24. # ---[ Project
  25. -PROJECT(FXdiv C CXX)
  26. +PROJECT(FXdiv C)
  27. # ---[ Options.
  28. OPTION(FXDIV_USE_INLINE_ASSEMBLY "Allow use of inline assembly in FXdiv" OFF)
  29. @@ -16,6 +16,10 @@ ENDIF()
  30. # ---[ CMake options
  31. INCLUDE(GNUInstallDirs)
  32. +IF(FXDIV_BUILD_TESTS OR FXDIV_BUILD_BENCHMARKS)
  33. + ENABLE_LANGUAGE(CXX)
  34. +ENDIF()
  35. +
  36. IF(FXDIV_BUILD_TESTS)
  37. ENABLE_TESTING()
  38. ENDIF()
  39. --
  40. 2.34.1