Skip to content

Commit 6e55913

Browse files
committed
Fixed the script for LLVM to handle paths with spaces.
Signed-off-by: Dimitar Dobrev <[email protected]>
1 parent 426572b commit 6e55913

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

build/scripts/LLVM.lua

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,23 +29,25 @@ function clone_llvm()
2929
error("LLVM directory is not a git repository.")
3030
end
3131

32+
local quotedLLVM = '"' .. llvm .. '"'
3233
if not os.isdir(llvm) then
33-
git.clone(llvm, "https://github.com/llvm-mirror/llvm.git")
34+
git.clone(quotedLLVM, "https://github.com/llvm-mirror/llvm.git")
3435
else
35-
git.reset_hard(llvm, "HEAD")
36-
git.pull_rebase(llvm)
36+
git.reset_hard(quotedLLVM, "HEAD")
37+
git.pull_rebase(quotedLLVM)
3738
end
3839

3940
local clang = llvm .. "/tools/clang"
41+
local quotedClang = '"' .. clang .. '"'
4042
if not os.isdir(clang) then
41-
git.clone(clang, "https://github.com/llvm-mirror/clang.git")
43+
git.clone(quotedClang, "https://github.com/llvm-mirror/clang.git")
4244
else
43-
git.reset_hard(clang, "HEAD")
44-
git.pull_rebase(clang)
45+
git.reset_hard(quotedClang, "HEAD")
46+
git.pull_rebase(quotedClang)
4547
end
4648

47-
git.reset_hard(llvm, llvm_release)
48-
git.reset_hard(clang, clang_release)
49+
git.reset_hard(quotedLLVM, llvm_release)
50+
git.reset_hard(quotedClang, clang_release)
4951
end
5052
function get_vs_version()
5153
local function map_msvc_to_vs_version(major, minor)
@@ -280,13 +282,13 @@ function build_llvm(llvm_build)
280282
options = options .. (is32bits and " -DLLVM_BUILD_32_BITS=true" or "")
281283
end
282284
cmake("Ninja", conf, llvm_build, options)
283-
ninja(llvm_build)
284-
ninja(llvm_build, "clang-headers")
285+
ninja('"' .. llvm_build .. '"')
286+
ninja('"' .. llvm_build .. '"', "clang-headers")
285287
end
286288
end
287289

288290
function package_llvm(conf, llvm, llvm_build)
289-
local rev = git.rev_parse(llvm, "HEAD")
291+
local rev = git.rev_parse('"' .. llvm .. '"', "HEAD")
290292
if string.is_empty(rev) then
291293
rev = get_llvm_rev()
292294
end

0 commit comments

Comments
 (0)