[PATCH] D77184: Make it possible for lit.site.cfg to contain relative paths, and use it for llvm and clang
George Rimar via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 3 06:57:43 PDT 2020
grimar added a comment.
In D77184#1959351 <https://reviews.llvm.org/D77184#1959351>, @andrewng wrote:
> The following patch fixes my issues on Windows, but I haven't tested that it doesn't break anything else:
>
> diff --git a/llvm/cmake/modules/AddLLVM.cmake b/llvm/cmake/modules/AddLLVM.cmake
> index 91bec7d8081..f630af211fd 100644
> --- a/llvm/cmake/modules/AddLLVM.cmake
> +++ b/llvm/cmake/modules/AddLLVM.cmake
> @@ -1495,7 +1495,7 @@ function(configure_lit_site_cfg site_in site_out)
> string(REPLACE ";" "\\;" ARG_PATH_VALUES_ESCAPED "${ARG_PATH_VALUES}")
> get_filename_component(OUTPUT_DIR ${site_out} DIRECTORY)
> execute_process(COMMAND "${PYTHON_EXECUTABLE}" "-c"
> - "import os, sys; sys.stdout.write(';'.join(os.path.relpath(p, sys.argv[1]).replace(os.sep, '/') if p else '' for p in sys.argv[2].split(';')))"
> + "import os, sys; drive = os.path.splitdrive(sys.argv[1])[0]; sys.stdout.write(';'.join('' if not p else p if os.path.splitdrive(p)[0] != drive else os.path.relpath(p, sys.argv[1]).replace(os.sep, '/') for p in sys.argv[2].split(';')))"
> ${OUTPUT_DIR}
> ${ARG_PATH_VALUES_ESCAPED}
> OUTPUT_VARIABLE ARG_PATH_VALUES_RELATIVE)
>
This helped me, thanks for posting this! (I've just updated and faced the build issue on windows. Seems it doesn't like that I build it on `D:` drive)
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D77184/new/
https://reviews.llvm.org/D77184
More information about the llvm-commits
mailing list