-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBUILD.bazel
57 lines (53 loc) · 1.71 KB
/
BUILD.bazel
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
load("@rules_foreign_cc//foreign_cc:cmake.bzl", "cmake")
CMAKE_EXE_LINKER_FLAGS = " ".join([
# Pass in the location of libtinfo.a:
"-L${EXT_BUILD_DEPS}/ncurses_lib/lib",
# And force-link against -ltinfo.
# This is required because we remove the system libtinfo.so from
# LLVMExports.cmake (see patch_cmds in //tools/llvm:package.bzl for details).
"-ltinfo",
])
cmake(
name = "flang",
# Force some make parallelism, otherwise this build takes over an hour.
# This will override whatever was passed via --action_env='MAKEFLAGS="-j..."'.
build_args = ["--parallel=4"],
build_data = ["@llvm//:all"],
cache_entries = {
"BUILD_SHARED_LIBS": "OFF",
"CMAKE_EXE_LINKER_FLAGS": CMAKE_EXE_LINKER_FLAGS,
"CMAKE_PREFIX_PATH": "${EXT_BUILD_DEPS}/z_lib",
"FLANG_INCLUDE_TESTS": "OFF",
"LIBXML2_INCLUDE_DIR": "${EXT_BUILD_DEPS}/xml_lib/include",
"LIBXML2_LIBRARY": "${EXT_BUILD_DEPS}/xml_lib/lib/libxml2.a",
"LLVM_CMAKE_PATH": "${EXT_BUILD_ROOT}/external/llvm/lib/cmake/llvm",
"MLIR_DIR": "${EXT_BUILD_ROOT}/external/llvm/lib/cmake/mlir",
},
lib_source = "@flang//:all",
out_binaries = [
"f18",
"flang",
],
visibility = ["//lib:__subpackages__"],
deps = [
"//lib/ncurses",
"//lib/xml",
"//lib/z",
],
)
filegroup(
name = "flang_runtime",
srcs = [":flang"],
output_group = "gen_dir",
visibility = ["//lib:__subpackages__"],
)
bzl_library(
name = "package",
srcs = ["package.bzl"],
visibility = ["//tools:__pkg__"],
deps = [
"//:http_archive",
"//toolchains:utils_bzl",
],
)