[Lldb-commits] [PATCH] D114465: [lldb] Move create_relative_symlink function up in CMake hierarchy
Dimitry Andric via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Tue Nov 23 11:58:38 PST 2021
dim created this revision.
dim added reviewers: clayborg, emaste, labath, lawrence_danna, siger-young, tammela.
Herald added a subscriber: mgorny.
dim requested review of this revision.
Herald added a project: LLDB.
Configuring lldb with `LLDB_ENABLE_PYTHON=OFF` and `LLDB_ENABLE_LUA=ON` results in a CMake error:
CMake Error at lldb/bindings/lua/CMakeLists.txt:47 (create_relative_symlink):
Unknown CMake command "create_relative_symlink".
Call Stack (most recent call first):
lldb/CMakeLists.txt:117 (finish_swig_lua)
This is because the CMake function `create_relative_symlink` only exists in `lldb/bindings/python/CMakeLists.txt`, and not in `lldb/bindings/lua/CMakeLists.txt`.
Move the function to `lldb/bindings/CMakeLists.txt`, so it is available for all language bindings.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D114465
Files:
lldb/bindings/CMakeLists.txt
lldb/bindings/python/CMakeLists.txt
Index: lldb/bindings/python/CMakeLists.txt
===================================================================
--- lldb/bindings/python/CMakeLists.txt
+++ lldb/bindings/python/CMakeLists.txt
@@ -52,20 +52,6 @@
WORKING_DIRECTORY ${working_dir})
endfunction()
-function(create_relative_symlink swig_target dest_file output_dir output_name)
- get_filename_component(dest_file ${dest_file} ABSOLUTE)
- get_filename_component(output_dir ${output_dir} ABSOLUTE)
- file(RELATIVE_PATH rel_dest_file ${output_dir} ${dest_file})
- if(CMAKE_HOST_UNIX)
- set(LLVM_LINK_OR_COPY create_symlink)
- else()
- set(LLVM_LINK_OR_COPY copy)
- endif()
- add_custom_command(TARGET ${swig_target} POST_BUILD VERBATIM
- COMMAND ${CMAKE_COMMAND} -E ${LLVM_LINK_OR_COPY} ${rel_dest_file} ${output_name}
- WORKING_DIRECTORY ${output_dir})
-endfunction()
-
function(finish_swig_python swig_target lldb_python_bindings_dir lldb_python_target_dir)
# Add a Post-Build Event to copy over Python files and create the symlink to
# liblldb.so for the Python API(hardlink on Windows).
Index: lldb/bindings/CMakeLists.txt
===================================================================
--- lldb/bindings/CMakeLists.txt
+++ lldb/bindings/CMakeLists.txt
@@ -31,6 +31,20 @@
${DARWIN_EXTRAS}
)
+function(create_relative_symlink swig_target dest_file output_dir output_name)
+ get_filename_component(dest_file ${dest_file} ABSOLUTE)
+ get_filename_component(output_dir ${output_dir} ABSOLUTE)
+ file(RELATIVE_PATH rel_dest_file ${output_dir} ${dest_file})
+ if(CMAKE_HOST_UNIX)
+ set(LLVM_LINK_OR_COPY create_symlink)
+ else()
+ set(LLVM_LINK_OR_COPY copy)
+ endif()
+ add_custom_command(TARGET ${swig_target} POST_BUILD VERBATIM
+ COMMAND ${CMAKE_COMMAND} -E ${LLVM_LINK_OR_COPY} ${rel_dest_file} ${output_name}
+ WORKING_DIRECTORY ${output_dir})
+endfunction()
+
if (LLDB_ENABLE_PYTHON)
add_subdirectory(python)
endif()
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D114465.389277.patch
Type: text/x-patch
Size: 1947 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20211123/21619edc/attachment.bin>
More information about the lldb-commits
mailing list