2
2
# See https://llvm.org/LICENSE.txt for license information.
3
3
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
4
4
5
- load (":write_cmake_config .bzl" , "write_cmake_config " )
5
+ load (":template_rule .bzl" , "template_rule " )
6
6
load (":tblgen.bzl" , "gentbl" )
7
- load (":config.bzl" , "config_h_values" , "llvm_config_h_values" , "llvm_global_defines " )
7
+ load (":config.bzl" , "llvm_config_defines " )
8
8
load (":targets.bzl" , "llvm_targets" )
9
9
load (":enum_targets_gen.bzl" , "enum_targets_gen" )
10
10
load (":binary_alias.bzl" , "binary_alias" )
@@ -101,30 +101,17 @@ genrule(
101
101
cmd = "echo '#define LLVM_VERSION_INFO \" git\" ' > $@" ,
102
102
)
103
103
104
- write_cmake_config (
104
+ template_rule (
105
105
name = "abi_breaking_h_gen" ,
106
106
src = "include/llvm/Config/abi-breaking.h.cmake" ,
107
107
out = "include/llvm/Config/abi-breaking.h" ,
108
- # Currently, in the Bazel build, we opt out of ABI breaking checks and
109
- # reverse iteration.
110
- values = [
111
- "LLVM_ENABLE_ABI_BREAKING_CHECKS=" ,
112
- "LLVM_ENABLE_REVERSE_ITERATION=" ,
113
- ],
114
- )
115
-
116
- write_cmake_config (
117
- name = "config_h_gen" ,
118
- src = "include/llvm/Config/config.h.cmake" ,
119
- out = "include/llvm/Config/config.h" ,
120
- values = config_h_values ,
121
- )
108
+ substitutions = {
109
+ # Define to enable checks that alter the LLVM C++ ABI
110
+ "#cmakedefine01 LLVM_ENABLE_ABI_BREAKING_CHECKS" : "#define LLVM_ENABLE_ABI_BREAKING_CHECKS 0" ,
122
111
123
- write_cmake_config (
124
- name = "llvm_config_h_gen" ,
125
- src = "include/llvm/Config/llvm-config.h.cmake" ,
126
- out = "include/llvm/Config/llvm-config.h" ,
127
- values = llvm_config_h_values ,
112
+ # Define to enable reverse iteration of unordered llvm containers
113
+ "#cmakedefine01 LLVM_ENABLE_REVERSE_ITERATION" : "#define LLVM_ENABLE_REVERSE_ITERATION 0" ,
114
+ },
128
115
)
129
116
130
117
# To enable diff testing out of tree
@@ -142,7 +129,7 @@ cc_library(
142
129
"include/llvm/Config/llvm-config.h" ,
143
130
],
144
131
copts = llvm_copts ,
145
- defines = llvm_global_defines ,
132
+ defines = llvm_config_defines ,
146
133
includes = ["include" ],
147
134
textual_hdrs = [
148
135
"include/llvm/Config/AsmParsers.def" ,
@@ -2920,11 +2907,11 @@ cc_binary(
2920
2907
copts = llvm_copts ,
2921
2908
stamp = 0 ,
2922
2909
deps = [
2910
+ ":Symbolize" ,
2923
2911
":BitReader" ,
2924
2912
":Core" ,
2925
- ":Debuginfod" ,
2926
2913
":Support" ,
2927
- ":Symbolize " ,
2914
+ ":Debuginfod " ,
2928
2915
],
2929
2916
)
2930
2917
@@ -4442,8 +4429,3 @@ cc_binary(
4442
4429
":Support" ,
4443
4430
],
4444
4431
)
4445
-
4446
- py_binary (
4447
- name = "write_cmake_config" ,
4448
- srcs = ["utils/write_cmake_config.py" ],
4449
- )
0 commit comments