Skip to content

Commit c1cb0b8

Browse files
authored
[libc][NFC] Fix -DSHOW_INTERMEDIATE_OBJECTS=DEPS to work properly for entry points and unit tests. (#79254)
1 parent e099e7b commit c1cb0b8

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

libc/cmake/modules/LLVMLibCObjectRules.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,7 @@ function(create_entrypoint_object fq_target_name)
652652
if(SHOW_INTERMEDIATE_OBJECTS)
653653
message(STATUS "Adding entrypoint object ${fq_target_name}")
654654
if(${SHOW_INTERMEDIATE_OBJECTS} STREQUAL "DEPS")
655-
foreach(dep IN LISTS ADD_OBJECT_DEPENDS)
655+
foreach(dep IN LISTS ADD_ENTRYPOINT_OBJ_DEPENDS)
656656
message(STATUS " ${fq_target_name} depends on ${dep}")
657657
endforeach()
658658
endif()

libc/cmake/modules/LLVMLibCTestRules.cmake

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,16 @@ function(create_libc_unittest fq_target_name)
129129
list(APPEND fq_deps_list libc.src.__support.StringUtil.error_to_string
130130
libc.test.UnitTest.ErrnoSetterMatcher)
131131
list(REMOVE_DUPLICATES fq_deps_list)
132+
133+
if(SHOW_INTERMEDIATE_OBJECTS)
134+
message(STATUS "Adding unit test ${fq_target_name}")
135+
if(${SHOW_INTERMEDIATE_OBJECTS} STREQUAL "DEPS")
136+
foreach(dep IN LISTS LIBC_UNITTEST_DEPENDS)
137+
message(STATUS " ${fq_target_name} depends on ${dep}")
138+
endforeach()
139+
endif()
140+
endif()
141+
132142
get_object_files_for_test(
133143
link_object_files skipped_entrypoints_list ${fq_deps_list})
134144
if(skipped_entrypoints_list)
@@ -157,15 +167,6 @@ function(create_libc_unittest fq_target_name)
157167
return()
158168
endif()
159169

160-
if(SHOW_INTERMEDIATE_OBJECTS)
161-
message(STATUS "Adding unit test ${fq_target_name}")
162-
if(${SHOW_INTERMEDIATE_OBJECTS} STREQUAL "DEPS")
163-
foreach(dep IN LISTS ADD_OBJECT_DEPENDS)
164-
message(STATUS " ${fq_target_name} depends on ${dep}")
165-
endforeach()
166-
endif()
167-
endif()
168-
169170
if(LIBC_UNITTEST_NO_RUN_POSTBUILD)
170171
set(fq_build_target_name ${fq_target_name})
171172
else()
@@ -521,7 +522,7 @@ function(add_integration_test test_name)
521522
link_object_files skipped_entrypoints_list ${fq_deps_list})
522523
if(skipped_entrypoints_list)
523524
if(LIBC_CMAKE_VERBOSE_LOGGING)
524-
set(msg "Skipping unittest ${fq_target_name} as it has missing deps: "
525+
set(msg "Skipping integration test ${fq_target_name} as it has missing deps: "
525526
"${skipped_entrypoints_list}.")
526527
message(STATUS ${msg})
527528
endif()
@@ -704,7 +705,7 @@ function(add_libc_hermetic_test test_name)
704705
get_object_files_for_test(
705706
link_object_files skipped_entrypoints_list ${fq_deps_list})
706707
if(skipped_entrypoints_list)
707-
set(msg "Skipping unittest ${fq_target_name} as it has missing deps: "
708+
set(msg "Skipping hermetic test ${fq_target_name} as it has missing deps: "
708709
"${skipped_entrypoints_list}.")
709710
message(STATUS ${msg})
710711
return()

0 commit comments

Comments
 (0)