Skip to content

Commit dc5519d

Browse files
committed
Add implicit dependency to all targets
1 parent 5d3a240 commit dc5519d

File tree

4 files changed

+14
-15
lines changed

4 files changed

+14
-15
lines changed

libc/cmake/modules/LLVMLibCObjectRules.cmake

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,11 @@ function(create_object_library fq_target_name)
9393
endif()
9494
endif()
9595

96-
if(fq_deps_list)
97-
add_dependencies(${fq_target_name} ${fq_deps_list})
98-
# Add deps as link libraries to inherit interface compile and link options.
99-
target_link_libraries(${fq_target_name} PUBLIC ${fq_deps_list})
100-
endif()
96+
list(APPEND fq_deps_list libc.src.__support.macros.config)
97+
list(REMOVE_DUPLICATES fq_deps_list)
98+
add_dependencies(${fq_target_name} ${fq_deps_list})
99+
# Add deps as link libraries to inherit interface compile and link options.
100+
target_link_libraries(${fq_target_name} PUBLIC ${fq_deps_list})
101101

102102
set_target_properties(
103103
${fq_target_name}

utils/bazel/llvm-project-overlay/libc/BUILD.bazel

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,13 @@ config_setting(
5151
flag_values = {":mpfr": "system"},
5252
)
5353

54+
################################## Base Config #################################
55+
56+
cc_library(
57+
name = "__support_macros_config",
58+
hdrs = ["src/__support/macros/config.h"],
59+
)
60+
5461
################################# Include Files ################################
5562

5663
libc_support_library(
@@ -234,11 +241,6 @@ libc_support_library(
234241
],
235242
)
236243

237-
libc_support_library(
238-
name = "__support_macros_config",
239-
hdrs = ["src/__support/macros/config.h"],
240-
)
241-
242244
libc_support_library(
243245
name = "__support_macros_attributes",
244246
hdrs = ["src/__support/macros/attributes.h"],
@@ -252,17 +254,13 @@ libc_support_library(
252254
hdrs = ["src/__support/macros/optimization.h"],
253255
deps = [
254256
":__support_macros_attributes",
255-
":__support_macros_config",
256257
":__support_macros_properties_compiler",
257258
],
258259
)
259260

260261
libc_support_library(
261262
name = "__support_macros_sanitizer",
262263
hdrs = ["src/__support/macros/sanitizer.h"],
263-
deps = [
264-
":__support_macros_config",
265-
],
266264
)
267265

268266
libc_support_library(

utils/bazel/llvm-project-overlay/libc/libc_build_rules.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def _libc_library(name, hidden, copts = [], deps = [], local_defines = [], **kwa
4343
name = name,
4444
copts = copts + libc_common_copts(),
4545
local_defines = local_defines + LIBC_CONFIGURE_OPTIONS,
46-
deps = deps,
46+
deps = deps + ["//libc:__support_macros_config"],
4747
linkstatic = 1,
4848
**kwargs
4949
)

utils/bazel/llvm-project-overlay/libc/test/libc_test_rules.bzl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ def libc_test(name, srcs, libc_function_deps = [], copts = [], deps = [], local_
3434
local_defines = local_defines + LIBC_CONFIGURE_OPTIONS,
3535
deps = [libc_internal_target(d) for d in all_function_deps] + [
3636
"//libc/test/UnitTest:LibcUnitTest",
37+
"//libc:__support_macros_config",
3738
] + deps,
3839
features = ["-link_llvmlibc"], # Do not link libllvmlibc.a
3940
copts = copts + libc_common_copts(),

0 commit comments

Comments
 (0)