0002-add-option-to-specify-path-to-g-ir-compiler.patch 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. From 118ac24b2c488f490ee8814336291a58eae45395 Mon Sep 17 00:00:00 2001
  2. From: Adam Duskett <aduskett@gmail.com>
  3. Date: Tue, 12 Oct 2021 13:21:19 -0700
  4. Subject: [PATCH] add option to specify path to g-ir-compiler
  5. By default, find_program (GIR_COMPILER_BIN g-ir-compiler) returns the host path
  6. to g-ir-compiler, which is undesirable in a cross-compile environment.
  7. Add an option to manually specify a path to the g-ir-compiler.
  8. Signed-off-by: Adam Duskett <aduskett@gmail.com>
  9. ---
  10. core/CMakeLists.txt | 8 +++++++-
  11. 1 file changed, 7 insertions(+), 1 deletion(-)
  12. diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt
  13. index c4982de..6584229 100644
  14. --- a/core/CMakeLists.txt
  15. +++ b/core/CMakeLists.txt
  16. @@ -66,7 +66,13 @@ set_target_properties("${LIBCORE}" PROPERTIES
  17. VERSION ${LIBCORE_VERSION}
  18. )
  19. -find_program (GIR_COMPILER_BIN g-ir-compiler)
  20. +option(GIR_COMPILER_PATH "Specify a path to g-ir-compiler" OFF)
  21. +if(GIR_COMPILER_PATH)
  22. + set(GIR_COMPILER_BIN "${GIR_COMPILER_PATH}")
  23. +else()
  24. + find_program (GIR_COMPILER_BIN g-ir-compiler)
  25. +endif(GIR_COMPILER_PATH)
  26. +
  27. add_custom_target(${LIBCORE_GIR}.typelib ALL
  28. COMMAND ${GIR_COMPILER_BIN} ${CMAKE_CURRENT_BINARY_DIR}/${LIBCORE_GIR}.gir
  29. --output ${CMAKE_CURRENT_BINARY_DIR}/${LIBCORE_GIR}.typelib
  30. --
  31. 2.30.2