Skip to content

Commit 71d4c9c

Browse files
authored
cmake: Allow CLANG_RESOURCE_DIR to be absolute.
Currently an absolute CLANG_RESOURCE_DIR is treated as being relative to bin. Fix that by using cmake_path(APPEND) to append the path to bin. The prepending of PREFIX is left as-is because callers passing PREFIX are usually forming a path within the build directory and would not want build products to be written to an absolute resource directory that is likely to be an installation prefix. One exception is the caller in lldb/cmake/modules/LLDBStandalone.cmake; for now it is not possible to build LLDB with an absolute resource directory until the users are disambiguated. Reviewers: petrhosek Reviewed By: petrhosek Pull Request: llvm#145996
1 parent 5ecd21a commit 71d4c9c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

cmake/Modules/GetClangResourceDir.cmake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ function(get_clang_resource_dir out_var)
1010
cmake_parse_arguments(ARG "" "PREFIX;SUBDIR" "" ${ARGN})
1111

1212
if(DEFINED CLANG_RESOURCE_DIR AND NOT CLANG_RESOURCE_DIR STREQUAL "")
13-
set(ret_dir bin/${CLANG_RESOURCE_DIR})
13+
set(ret_dir bin)
14+
cmake_path(APPEND ret_dir ${CLANG_RESOURCE_DIR})
1415
else()
1516
if (NOT CLANG_VERSION_MAJOR)
1617
string(REGEX MATCH "^[0-9]+" CLANG_VERSION_MAJOR ${PACKAGE_VERSION})

0 commit comments

Comments
 (0)