mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-04 10:31:04 +01:00
Per chandlerc's comment: First, this builds inside the Bazel tree rather than in the source repository. This ensures we start in a clean directory each time the repository rule is run again. We don't need to detect an existing build with this, and it will only be rebuilt when the workspace file or the repository rule implementation is changed. This can be forced by using: ``` bazel sync --configure ``` Second, we use an implicit dependency on the `WORKSPACE` file to locate the workspace directory automatically, and the `HEAD` file from the `llvm-project` submodule to trigger a rebuild if the submodule is updated. Third, teach the CMake script to try to use a system-installed `clang` if installed and not overridden by the `CC` environment variable. This is very different from the prior logic -- this is only used with the CMake build, and so should work with any system C++ compiler that can build Clang and LLVM. Lastly, this tweaks the CMake options to tune this build given that we now fully control it and it will only be used in this context. This still results in a 1.5gb build for me. =/ But its as small as I can make it really. It's a frustrating long list, but I couldn't find a more brief way of representing this. Co-authored-by: Chandler Carruth <chandlerc@gmail.com>
15 lines
535 B
Python
15 lines
535 B
Python
# Part of the Carbon Language project, under the Apache License v2.0 with LLVM
|
|
# Exceptions. See /LICENSE for license information.
|
|
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
|
|
"""A Starlark file exporting detected Clang configuration variables.
|
|
|
|
This file gets processed by a repository rule, substituting the
|
|
`{VARIABLE}`s with values detected by invoking Clang.
|
|
"""
|
|
|
|
llvm_bindir = "{LLVM_BINDIR}"
|
|
clang_resource_dir = "{CLANG_RESOURCE_DIR}"
|
|
clang_include_dirs_list = {CLANG_INCLUDE_DIRS_LIST}
|
|
sysroot_dir = "{SYSROOT}"
|