spirv-llvm-translator-16.0.0-llvm-link-llvm-dylib.patch 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. From 98fadafeae0204defedd89f015f7fb88f2888b2f Mon Sep 17 00:00:00 2001
  2. From: Tulio Magno Quites Machado Filho <tuliom@redhat.com>
  3. Date: Fri, 17 Mar 2023 14:27:10 -0300
  4. Subject: [PATCH] Fix standalone builds with LLVM_LINK_LLVM_DYLIB=ON
  5. Move the LLVM components to LINK_COMPONENTS because the DEPENDS list has
  6. the same semantics as add_dependencies(). In this
  7. case it doesn't include the LLVM components when calling the linker.
  8. ---
  9. lib/SPIRV/CMakeLists.txt | 47 ++++++++++++----------------------------
  10. 1 file changed, 14 insertions(+), 33 deletions(-)
  11. diff --git a/lib/SPIRV/CMakeLists.txt b/lib/SPIRV/CMakeLists.txt
  12. index bbef00528..2810c6b2c 100644
  13. --- a/lib/SPIRV/CMakeLists.txt
  14. +++ b/lib/SPIRV/CMakeLists.txt
  15. @@ -38,42 +38,23 @@ set(SRC_LIST
  16. libSPIRV/SPIRVType.cpp
  17. libSPIRV/SPIRVValue.cpp
  18. )
  19. -if(LLVM_LINK_LLVM_DYLIB)
  20. - add_llvm_library(LLVMSPIRVLib STATIC DISABLE_LLVM_LINK_LLVM_DYLIB
  21. - ${SRC_LIST}
  22. - DEPENDS
  23. - intrinsics_gen
  24. - LLVMAnalysis
  25. - LLVMBitWriter
  26. - LLVMCodeGen
  27. - LLVMCore
  28. - LLVMDemangle
  29. - LLVMIRReader
  30. - LLVMLinker
  31. - LLVMPasses
  32. - LLVMSupport
  33. - LLVMTargetParser
  34. - LLVMTransformUtils
  35. - )
  36. -else()
  37. - add_llvm_library(LLVMSPIRVLib
  38. - ${SRC_LIST}
  39. - LINK_COMPONENTS
  40. - Analysis
  41. - BitWriter
  42. - CodeGen
  43. - Core
  44. - Demangle
  45. - IRReader
  46. - Linker
  47. - Passes
  48. - Support
  49. - TargetParser
  50. - TransformUtils
  51. +add_llvm_library(LLVMSPIRVLib
  52. + ${SRC_LIST}
  53. + LINK_COMPONENTS
  54. + Analysis
  55. + BitWriter
  56. + CodeGen
  57. + Core
  58. + Demangle
  59. + IRReader
  60. + Linker
  61. + Passes
  62. + Support
  63. + TargetParser
  64. + TransformUtils
  65. DEPENDS
  66. intrinsics_gen
  67. )
  68. -endif()
  69. target_include_directories(LLVMSPIRVLib
  70. PRIVATE