Skip to content

Commit

Permalink
fix: set runpath for unbuntu with patchelf
Browse files Browse the repository at this point in the history
  • Loading branch information
peilinok committed Feb 20, 2025
1 parent d679311 commit 7408a67
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
7 changes: 4 additions & 3 deletions cxx-parser/cxx/cppast_backend/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ if(APPLE)
LINK_FLAGS "-Wl, -rpath @loader_path"
)
elseif(UNIX)
set_target_properties(cppast_backend PROPERTIES
LINK_FLAGS "-Wl,-rpath,$ORIGIN/;$ORIGIN/lib"
)
# TODO: add rpath to the executable
# set_target_properties(cppast_backend PROPERTIES
# LINK_FLAGS "-Wl,-rpath,$ORIGIN/;$ORIGIN/lib"
# )
endif()

# copy the libclang library to the build directory
Expand Down
8 changes: 4 additions & 4 deletions cxx-parser/cxx/cppast_backend/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ if [[ $CPPAST_BACKEND_BUILD != 1 ]]; then
# if [[ "$OS" == "Darwin" ]]; then
# install_name_tool -add_rpath ${OUTPUT_PATH} ${OUTPUT_PATH}/cppast_backend
# fi
# if [[ "$OS" == "Linux" ]]; then
# sudo ln -s ${OUTPUT_PATH}/libclang.so ${OUTPUT_PATH}/libclang.so.15
# patchelf --set-rpath ${OUTPUT_PATH} ${OUTPUT_PATH}/cppast_backend
# fi
if [[ "$OS" == "Linux" ]]; then
sudo ln -s ${OUTPUT_PATH}/libclang.so ${OUTPUT_PATH}/libclang.so.15
patchelf --set-rpath ${OUTPUT_PATH} ${OUTPUT_PATH}/cppast_backend
fi
else
echo "Prebuilt cppast_backend already exists, skipping download."
fi
Expand Down

0 comments on commit 7408a67

Please sign in to comment.