Skip to content

Commit

Permalink
build-llvm.py: Stop build extra files more
Browse files Browse the repository at this point in the history
  • Loading branch information
wloot committed Dec 25, 2019
1 parent 8fa67eb commit 97cbd01
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
10 changes: 8 additions & 2 deletions build-llvm.py
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,7 @@ def fetch_llvm_binutils(root_folder, update, ref, shallow=False):
if update:
utils.print_header("Updating LLVM")
subprocess.run(["git", "fetch", "origin"], check=True, cwd=cwd)
subprocess.run(["git", "reset", "--hard"], check=True, cwd=cwd)
subprocess.run(["git", "checkout", ref], check=True, cwd=cwd)
local_ref = None
try:
Expand Down Expand Up @@ -449,6 +450,10 @@ def fetch_llvm_binutils(root_folder, update, ref, shallow=False):
],
check=True)
subprocess.run(["git", "checkout", ref], check=True, cwd=cwd)

subprocess.run(
["sed", "-i", "/add_subdirectory(test)/d;/add_subdirectory(docs)/d;/add_subdirectory(tools)/d", "%s"
% p.joinpath("polly").joinpath("CMakeLists.txt").as_posix()], check=True, cwd=cwd)

# One might wonder why we are downloading binutils in an LLVM build script :)
# We need it for the LLVMgold plugin, which can be used for LTO with ld.gold,
Expand Down Expand Up @@ -570,6 +575,9 @@ def base_cmake_defines(dirs):
# Don't include example build targets to save on cmake cycles
'LLVM_INCLUDE_EXAMPLES': 'OFF',

'LLVM_INCLUDE_TESTS': 'OFF',
'LLVM_INCLUDE_UTILS': 'OFF',
'LLVM_INCLUDE_BENCHMARKS': 'OFF',
}
# yapf: enable

Expand Down Expand Up @@ -705,8 +713,6 @@ def stage_specific_cmake_defines(args, dirs, stage):
defines['CMAKE_BUILD_TYPE'] = 'Release'
defines['LLVM_ENABLE_BACKTRACES'] = 'OFF'
defines['LLVM_ENABLE_WARNINGS'] = 'OFF'
defines['LLVM_INCLUDE_TESTS'] = 'OFF'
defines['LLVM_INCLUDE_UTILS'] = 'OFF'
else:
# https://llvm.org/docs/CMake.html#frequently-used-cmake-variables
defines['CMAKE_BUILD_TYPE'] = args.build_type
Expand Down
1 change: 1 addition & 0 deletions build-tc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ msg "Building LLVM..."
./build-llvm.py \
--clang-vendor "LiuNian-$(date +%Y%m%d)" \
--projects "clang;compiler-rt;lld;polly" \
--build-type "MinSizeRel" \
--incremental \
--build-stage1-only \
--install-stage1-only \
Expand Down

0 comments on commit 97cbd01

Please sign in to comment.