5
5
# Usage:
6
6
# get_object_files_for_test(<result var>
7
7
# <skipped_entrypoints_var>
8
+ # <internal_obj>
8
9
# <target0> [<target1> ...])
9
10
#
10
11
# The list of object files is collected in <result_var>.
11
12
# If skipped entrypoints were found, then <skipped_entrypoints_var> is
12
13
# set to a true value.
13
14
# targetN is either an "add_entrypoint_target" target or an
14
15
# "add_object_library" target.
15
- function (get_object_files_for_test result skipped_entrypoints_list )
16
+ # If internal_obj is TRUE, then we collect `target.__internal__` for entry points.
17
+ function (get_object_files_for_test result skipped_entrypoints_list internal_obj )
16
18
set (object_files "" )
17
19
set (skipped_list "" )
18
20
set (checked_list "" )
@@ -49,7 +51,7 @@ function(get_object_files_for_test result skipped_entrypoints_list)
49
51
set (dep_skip "" )
50
52
51
53
get_target_property (indirect_deps ${dep} "DEPS" )
52
- get_object_files_for_test (dep_obj dep_skip ${indirect_deps} )
54
+ get_object_files_for_test (dep_obj dep_skip ${internal_obj} ${ indirect_deps} )
53
55
54
56
if (${dep_type} STREQUAL ${OBJECT_LIBRARY_TARGET_TYPE} )
55
57
get_target_property (dep_object_files ${dep} "OBJECT_FILES" )
@@ -62,7 +64,11 @@ function(get_object_files_for_test result skipped_entrypoints_list)
62
64
list (APPEND dep_skip ${dep} )
63
65
list (REMOVE_ITEM dep_obj ${dep} )
64
66
endif ()
65
- get_target_property (object_file_raw ${dep} "OBJECT_FILE_RAW" )
67
+ if (${internal_obj} )
68
+ get_target_property (object_file_raw ${dep} "OBJECT_FILE_RAW" )
69
+ else ()
70
+ get_target_property (object_file_raw ${dep} "OBJECT_FILE" )
71
+ endif ()
66
72
if (object_file_raw )
67
73
list (APPEND dep_obj ${object_file_raw} )
68
74
endif ()
@@ -140,7 +146,7 @@ function(create_libc_unittest fq_target_name)
140
146
endif ()
141
147
142
148
get_object_files_for_test (
143
- link_object_files skipped_entrypoints_list ${fq_deps_list} )
149
+ link_object_files skipped_entrypoints_list TRUE ${fq_deps_list} )
144
150
if (skipped_entrypoints_list )
145
151
# If a test is OS/target machine independent, it has to be skipped if the
146
152
# OS/target machine combination does not provide any dependent entrypoints.
@@ -389,7 +395,7 @@ function(add_libc_fuzzer target_name)
389
395
get_fq_target_name (${target_name} fq_target_name )
390
396
get_fq_deps_list (fq_deps_list ${LIBC_FUZZER_DEPENDS} )
391
397
get_object_files_for_test (
392
- link_object_files skipped_entrypoints_list ${fq_deps_list} )
398
+ link_object_files skipped_entrypoints_list TRUE ${fq_deps_list} )
393
399
if (skipped_entrypoints_list )
394
400
if (LIBC_CMAKE_VERBOSE_LOGGING )
395
401
set (msg "Skipping fuzzer target ${fq_target_name} as it has missing deps: "
@@ -519,7 +525,7 @@ function(add_integration_test test_name)
519
525
# TODO: Instead of gathering internal object files from entrypoints,
520
526
# collect the object files with public names of entrypoints.
521
527
get_object_files_for_test (
522
- link_object_files skipped_entrypoints_list ${fq_deps_list} )
528
+ link_object_files skipped_entrypoints_list FALSE ${fq_deps_list} )
523
529
if (skipped_entrypoints_list )
524
530
if (LIBC_CMAKE_VERBOSE_LOGGING )
525
531
set (msg "Skipping integration test ${fq_target_name} as it has missing deps: "
@@ -703,7 +709,7 @@ function(add_libc_hermetic_test test_name)
703
709
# TODO: Instead of gathering internal object files from entrypoints,
704
710
# collect the object files with public names of entrypoints.
705
711
get_object_files_for_test (
706
- link_object_files skipped_entrypoints_list ${fq_deps_list} )
712
+ link_object_files skipped_entrypoints_list FALSE ${fq_deps_list} )
707
713
if (skipped_entrypoints_list )
708
714
set (msg "Skipping hermetic test ${fq_target_name} as it has missing deps: "
709
715
"${skipped_entrypoints_list} ." )
0 commit comments