[PATCH] D97989: [gn build] allow setting clang_base_path to a source-absolute path

Nico Weber via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 5 09:14:36 PST 2021


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG98c6d3194ed9: [gn build] allow setting clang_base_path to a source-absolute path (authored by thakis).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D97989/new/

https://reviews.llvm.org/D97989

Files:
  llvm/utils/gn/build/toolchain/BUILD.gn


Index: llvm/utils/gn/build/toolchain/BUILD.gn
===================================================================
--- llvm/utils/gn/build/toolchain/BUILD.gn
+++ llvm/utils/gn/build/toolchain/BUILD.gn
@@ -25,8 +25,8 @@
     cxx = "c++"
 
     if (clang_base_path != "") {
-      cc = "$clang_base_path/bin/clang"
-      cxx = "$clang_base_path/bin/clang++"
+      cc = rebase_path(clang_base_path, root_build_dir) + "/bin/clang"
+      cxx = rebase_path(clang_base_path, root_build_dir) + "/bin/clang++"
     }
 
     ld = cxx  # Don't use goma wrapper for linking.
@@ -185,7 +185,7 @@
     toolchain_args = {
       forward_variables_from(invoker.toolchain_args, "*")
 
-      clang_base_path = "."
+      clang_base_path = root_build_dir
       use_goma = false
     }
 
@@ -244,9 +244,9 @@
   link = "link"
 
   if (clang_base_path != "") {
-    cl = "$clang_base_path/bin/clang-cl"
+    cl = rebase_path(clang_base_path, root_build_dir) + "/bin/clang-cl"
     if (use_lld) {
-      link = "$clang_base_path/bin/lld-link"
+      link = rebase_path(clang_base_path, root_build_dir) + "/bin/lld-link"
     }
   }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D97989.328550.patch
Type: text/x-patch
Size: 1115 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210305/9becfd51/attachment.bin>


More information about the llvm-commits mailing list