0001-support-out-of-tree-build.patch 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. From 495491e9d53bfb184c15753b5187e4bb55b19511 Mon Sep 17 00:00:00 2001
  2. From: Matt Weber <matthew.weber@rockwellcollins.com>
  3. Date: Tue, 9 Mar 2021 15:55:17 -0600
  4. Subject: [PATCH] support out of tree build
  5. (1) The package has a prepare_builtins tool which is built
  6. but not placed in the path for later use in the build. This
  7. fix allows the later build steps to use the binary in-place.
  8. (2) With cmake, find_file() when used for non-host builds is
  9. limited by CMAKE_FIND_ROOT_PATH* scope.
  10. In $(HOST_DIR)/share/buildroot/toolchainfile.cmake we set the
  11. following target settings for CMAKE_FIND_ROOT_PATH* which
  12. limit the scope.
  13. set(CMAKE_FIND_ROOT_PATH "${RELOCATED_HOST_DIR}/aarch64-buildroot-linux-gnu/sysroot")
  14. set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
  15. set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
  16. set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
  17. set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
  18. Signed-off-by: Matthew Weber <matthew.weber@rockwellcollins.com>
  19. ---
  20. CMakeLists.txt | 2 +-
  21. cmake/CMakeDetermineCLCCompiler.cmake | 4 ++++
  22. cmake/CMakeDetermineLLAsmCompiler.cmake | 4 ++++
  23. 3 files changed, 9 insertions(+), 1 deletion(-)
  24. diff --git a/CMakeLists.txt b/CMakeLists.txt
  25. index 9472f19..a784519 100644
  26. --- a/CMakeLists.txt
  27. +++ b/CMakeLists.txt
  28. @@ -279,7 +279,7 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
  29. # Add prepare target
  30. add_custom_command( OUTPUT "${obj_suffix}"
  31. - COMMAND prepare_builtins -o
  32. + COMMAND ./prepare_builtins -o
  33. "${obj_suffix}"
  34. "builtins.opt.${obj_suffix}"
  35. DEPENDS "opt.${obj_suffix}"
  36. diff --git a/cmake/CMakeDetermineCLCCompiler.cmake b/cmake/CMakeDetermineCLCCompiler.cmake
  37. index 94d85d9..5de6a48 100644
  38. --- a/cmake/CMakeDetermineCLCCompiler.cmake
  39. +++ b/cmake/CMakeDetermineCLCCompiler.cmake
  40. @@ -12,7 +12,7 @@ mark_as_advanced(CMAKE_CLC_ARCHIVE)
  41. set(CMAKE_CLC_COMPILER_ENV_VAR "CLC_COMPILER")
  42. set(CMAKE_CLC_ARCHIVE_ENV_VAR "CLC_LINKER")
  43. -find_file(clc_comp_in CMakeCLCCompiler.cmake.in PATHS ${CMAKE_ROOT}/Modules ${CMAKE_MODULE_PATH})
  44. +set(clc_comp_in "${CMAKE_MODULE_PATH}/CMakeCLCCompiler.cmake.in" )
  45. # configure all variables set in this file
  46. configure_file(${clc_comp_in} ${CMAKE_PLATFORM_INFO_DIR}/CMakeCLCCompiler.cmake @ONLY)
  47. mark_as_advanced(clc_comp_in)
  48. diff --git a/cmake/CMakeDetermineLLAsmCompiler.cmake b/cmake/CMakeDetermineLLAsmCompiler.cmake
  49. index 1c424c7..dd3bfb6 100644
  50. --- a/cmake/CMakeDetermineLLAsmCompiler.cmake
  51. +++ b/cmake/CMakeDetermineLLAsmCompiler.cmake
  52. @@ -18,7 +18,7 @@ mark_as_advanced(CMAKE_LLAsm_ARCHIVE)
  53. set(CMAKE_LLAsm_PREPROCESSOR_ENV_VAR "LL_PREPROCESSOR")
  54. set(CMAKE_LLAsm_COMPILER_ENV_VAR "LL_ASSEMBLER")
  55. set(CMAKE_LLAsm_ARCHIVE_ENV_VAR "LL_LINKER")
  56. -find_file(ll_comp_in CMakeLLAsmCompiler.cmake.in PATHS ${CMAKE_ROOT}/Modules ${CMAKE_MODULE_PATH})
  57. +set(ll_comp_in "${CMAKE_MODULE_PATH}/CMakeLLAsmCompiler.cmake.in" )
  58. # configure all variables set in this file
  59. configure_file(${ll_comp_in} ${CMAKE_PLATFORM_INFO_DIR}/CMakeLLAsmCompiler.cmake @ONLY)
  60. mark_as_advanced(ll_comp_in)
  61. --
  62. 2.17.1