Skip to content

Commit 61c7354

Browse files
hvdijkjsji
authored andcommitted
Limit NO_INSTALL_RPATH to out-of-tree builds. (#2935)
For in-tree builds with shared libraries, setting the rpath not only works, but is required. Fixes #2906 Original commit: KhronosGroup/SPIRV-LLVM-Translator@7c0db925422d1f5
1 parent a5bef9f commit 61c7354

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

llvm-spirv/tools/llvm-spirv/CMakeLists.txt

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,18 @@ if(SPIRV_BACKEND_FOUND)
1414
list(APPEND LLVM_LINK_COMPONENTS "SPIRVCodeGen")
1515
endif()
1616

17+
# llvm_setup_rpath messes with the rpath making llvm-spirv not
18+
# executable from the build directory in out-of-tree builds
19+
set(add_llvm_tool_options)
20+
if(LLVM_SPIRV_BUILD_EXTERNAL)
21+
set(add_llvm_tool_options
22+
NO_INSTALL_RPATH
23+
)
24+
endif()
25+
1726
add_llvm_tool(llvm-spirv
1827
llvm-spirv.cpp
19-
# llvm_setup_rpath messes with the rpath making llvm-spirv not executable from the build directory
20-
NO_INSTALL_RPATH
28+
${add_llvm_tool_options}
2129
)
2230

2331
setup_host_tool(llvm-spirv LLVM_SPIRV llvm-spirv_exe llvm-spirv_target)

0 commit comments

Comments
 (0)