Skip to content

Commit

Permalink
update to clang 10
Browse files Browse the repository at this point in the history
Kind of a big rewrite to adapt to the new repository structure.

Change-Id: I7b437aaa6bdf684c4486fe91fe94984107b7f6f9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/279072
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
  • Loading branch information
Mike Klein authored and Skia Commit-Bot committed Mar 25, 2020
1 parent 988ce04 commit b6a99b7
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 88 deletions.
2 changes: 1 addition & 1 deletion infra/bots/assets/clang_linux/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
19
20
32 changes: 9 additions & 23 deletions infra/bots/assets/clang_linux/create.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,39 +14,24 @@
import subprocess
import tempfile

REPO = "https://llvm.googlesource.com/"
BRANCH = "release_90"
BRANCH = "release/10.x"

def create_asset(target_dir):
# CMake will sometimes barf if we pass it a relative path.
target_dir = os.path.abspath(target_dir)

# Build Clang, lld, compiler-rt (sanitizer support) and libc++.
os.chdir(tempfile.mkdtemp())
subprocess.check_call(["git", "clone", "--depth", "1", "-b",
BRANCH, REPO + "llvm"])
os.chdir("llvm/tools")
subprocess.check_call(["git", "clone", "--depth", "1", "-b",
BRANCH, REPO + "clang"])
subprocess.check_call(["git", "clone", "--depth", "1", "-b",
BRANCH, REPO + "lld"])
os.chdir("clang/tools")
subprocess.check_call(["git", "clone", "--depth", "1", "-b",
BRANCH, REPO + "clang-tools-extra", "extra"])

os.chdir("../../../projects")
subprocess.check_call(["git", "clone", "--depth", "1", "-b",
BRANCH, REPO + "compiler-rt"])
subprocess.check_call(["git", "clone", "--depth", "1", "-b",
BRANCH, REPO + "libcxx"])
subprocess.check_call(["git", "clone", "--depth", "1", "-b",
BRANCH, REPO + "libcxxabi"])
os.chdir("..")
subprocess.check_call(["git", "clone", "--depth", "1", "-b", BRANCH,
"https://llvm.googlesource.com/llvm-project"])
os.chdir("llvm-project")
os.mkdir("out")
os.chdir("out")
subprocess.check_call(["cmake", "..", "-G", "Ninja",
subprocess.check_call(["cmake", "../llvm", "-G", "Ninja",
"-DCMAKE_BUILD_TYPE=MinSizeRel",
"-DCMAKE_INSTALL_PREFIX=" + target_dir,
"-DLLVM_ENABLE_PROJECTS=clang;clang-tools-extra;" +
"compiler-rt;libcxx;libcxxabi;lld",
"-DLLVM_INSTALL_TOOLCHAIN_ONLY=ON",
"-DLLVM_ENABLE_TERMINFO=OFF"])
subprocess.check_call(["ninja", "install"])
Expand All @@ -64,10 +49,11 @@ def create_asset(target_dir):
os.mkdir("../{}_out".format(short))
os.chdir("../{}_out".format(short))
subprocess.check_call(
["cmake", "..", "-G", "Ninja",
["cmake", "../llvm", "-G", "Ninja",
"-DCMAKE_BUILD_TYPE=MinSizeRel",
"-DCMAKE_C_COMPILER=" + target_dir + "/bin/clang",
"-DCMAKE_CXX_COMPILER=" + target_dir + "/bin/clang++",
"-DLLVM_ENABLE_PROJECTS=libcxx;libcxxabi",
"-DLLVM_USE_SANITIZER={}".format(full)])
subprocess.check_call(["ninja", "cxx"])
subprocess.check_call(["cp", "-r", "lib", target_dir + "/" + short])
Expand Down
Loading

0 comments on commit b6a99b7

Please sign in to comment.