mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-24 22:02:23 +01:00
I think this will work on linux/mac, not windows obviously. But the essence is that running `bazel run -c opt //installers/local:install` will create: Symlink: /usr/bin/carbon-explorer -> /usr/lib/carbon/carbon BusyBox-style binary: /usr/lib/carbon/carbon File: /usr/lib/carbon/data/prelude.carbon And then just running `carbon-explorer foo.carbon` with no flags (in particular, not --prelude) will work. Since this removes the need for prelude_file in most cases, I'm removing the relative path logic added in #1179 -- it would otherwise conflict with what I'm doing here. I *think* overall this will result in something even simpler and more reliable for compiler explorer to use, and hopefully with enough flexibility that it's easy for us to change how it's implemented later without breaking much.
59 lines
1.4 KiB
Python
59 lines
1.4 KiB
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
|
|
|
|
load("@mypy_integration//:mypy.bzl", "mypy_test")
|
|
|
|
package(default_visibility = [
|
|
"//bazel/check_deps:__pkg__",
|
|
"//executable_semantics:__subpackages__",
|
|
"//installers:__subpackages__",
|
|
])
|
|
|
|
filegroup(
|
|
name = "standard_libraries",
|
|
srcs = ["data/prelude.carbon"],
|
|
)
|
|
|
|
cc_library(
|
|
name = "main",
|
|
srcs = ["main.cpp"],
|
|
hdrs = ["main.h"],
|
|
deps = [
|
|
"//common:error",
|
|
"//executable_semantics/common:arena",
|
|
"//executable_semantics/common:nonnull",
|
|
"//executable_semantics/interpreter:exec_program",
|
|
"//executable_semantics/syntax",
|
|
"//executable_semantics/syntax:prelude",
|
|
"@llvm-project//llvm:Support",
|
|
],
|
|
)
|
|
|
|
cc_binary(
|
|
name = "executable_semantics",
|
|
srcs = ["main_bin.cpp"],
|
|
deps = [
|
|
":main",
|
|
],
|
|
)
|
|
|
|
py_binary(
|
|
name = "gen_rtti",
|
|
srcs = ["gen_rtti.py"],
|
|
)
|
|
|
|
# This script should be run directly; the target is only provided for the
|
|
# mypy_test.
|
|
py_binary(
|
|
name = "update_checks_mypy_wrapper",
|
|
srcs = ["update_checks.py"],
|
|
main = "update_checks.py",
|
|
)
|
|
|
|
mypy_test(
|
|
name = "update_checks_mypy_test",
|
|
include_imports = True,
|
|
deps = [":update_checks_mypy_wrapper"],
|
|
)
|