Skip to content

Commit

Permalink
Limit NO_INSTALL_RPATH to out-of-tree builds.
Browse files Browse the repository at this point in the history
For in-tree builds with shared libraries, setting the rpath not only
works, but is required.

Fixes KhronosGroup#2906
  • Loading branch information
hvdijk committed Dec 16, 2024
1 parent 112caf9 commit da1fec9
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions tools/llvm-spirv/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,18 @@ if(SPIRV_BACKEND_FOUND)
list(APPEND LLVM_LINK_COMPONENTS "SPIRVCodeGen")
endif()

# llvm_setup_rpath messes with the rpath making llvm-spirv not
# executable from the build directory in out-of-tree builds
set(add_llvm_tool_options)
if(LLVM_SPIRV_BUILD_EXTERNAL)
set(add_llvm_tool_options
NO_INSTALL_RPATH
)
endif()

add_llvm_tool(llvm-spirv
llvm-spirv.cpp
# llvm_setup_rpath messes with the rpath making llvm-spirv not executable from the build directory
NO_INSTALL_RPATH
${add_llvm_tool_options}
)

setup_host_tool(llvm-spirv LLVM_SPIRV llvm-spirv_exe llvm-spirv_target)
Expand Down

0 comments on commit da1fec9

Please sign in to comment.