3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/development/interpreters/cling/use-patched-llvm.patch
2023-04-04 16:38:48 -07:00

35 lines
1.6 KiB
Diff

diff --git a/lib/Interpreter/CMakeLists.txt b/lib/Interpreter/CMakeLists.txt
index 75396717..6a617ab4 100644
--- a/lib/Interpreter/CMakeLists.txt
+++ b/lib/Interpreter/CMakeLists.txt
@@ -344,3 +344,29 @@ add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/cling-compiledata.h
add_file_dependencies(${CMAKE_CURRENT_SOURCE_DIR}/CIFactory.cpp
${CMAKE_CURRENT_BINARY_DIR}/cling-compiledata.h)
+
+# If LLVM is external, but Clang is builtin, we must use some files
+# from patched (builtin) version of LLVM
+if ((NOT builtin_llvm) AND builtin_clang)
+ set(FixInclude "${CMAKE_SOURCE_DIR}/interpreter/llvm/src/include")
+
+ get_property(P SOURCE IncrementalJIT.cpp PROPERTY INCLUDE_DIRECTORIES)
+ list(INSERT P 0 ${FixInclude})
+ set_property(SOURCE IncrementalJIT.cpp PROPERTY INCLUDE_DIRECTORIES "${P}")
+
+ get_property(P SOURCE IncrementalExecutor.cpp PROPERTY INCLUDE_DIRECTORIES)
+ list(INSERT P 0 ${FixInclude})
+ set_property(SOURCE IncrementalExecutor.cpp PROPERTY INCLUDE_DIRECTORIES "${P}")
+
+ get_property(P SOURCE Interpreter.cpp PROPERTY INCLUDE_DIRECTORIES)
+ list(INSERT P 0 ${FixInclude})
+ set_property(SOURCE Interpreter.cpp PROPERTY INCLUDE_DIRECTORIES "${P}")
+
+ get_property(P SOURCE Transaction.cpp PROPERTY INCLUDE_DIRECTORIES)
+ list(INSERT P 0 ${FixInclude})
+ set_property(SOURCE Transaction.cpp PROPERTY INCLUDE_DIRECTORIES "${P}")
+
+ get_property(P SOURCE TransactionUnloader.cpp PROPERTY INCLUDE_DIRECTORIES)
+ list(INSERT P 0 ${FixInclude})
+ set_property(SOURCE TransactionUnloader.cpp PROPERTY INCLUDE_DIRECTORIES "${P}")
+endif()