1 change: 0 additions & 1 deletion libc/src/signal/linux/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ add_entrypoint_object(
../sigaction.h
DEPENDS
.__restore
.raise
libc.config.linux.linux_syscall_h
libc.include.signal
libc.include.sys_syscall
Expand Down
21 changes: 18 additions & 3 deletions libc/test/loader/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,23 @@ function(add_loader_test target_name)

set_target_properties(${fq_target_name} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})

set(dep_objects "")
if(ADD_LOADER_TEST_DEPENDS)
get_fq_deps_list(fq_deps_list ${ADD_LOADER_TEST_DEPENDS})
add_dependencies(${fq_target_name} ${fq_deps_list})
foreach(dep IN LISTS fq_deps_list)
get_target_property(objfile ${dep} "OBJECT_FILES")
if(NOT objfile)
message(
FATAL_ERROR
"Unexpected dependency of an `add_loader_test` target. A dependency "
"should be a target of type `add_entrypoint_object, `add_object`, or "
"`add_loader_object`.")
endif()
list(APPEND dep_objects ${objfile})
endforeach(dep)
endif()

target_include_directories(
${fq_target_name}
PRIVATE
Expand All @@ -37,9 +54,7 @@ function(add_loader_test target_name)
${LIBC_BUILD_DIR}/include
)

get_fq_deps_list(fq_deps_list ${ADD_LOADER_TEST_DEPENDS})
get_object_files_for_test(link_object_files ${fq_deps_list})
target_link_libraries(${fq_target_name} ${link_object_files})
target_link_libraries(${fq_target_name} ${dep_objects})

target_link_options(
${fq_target_name}
Expand Down
5 changes: 5 additions & 0 deletions libc/test/src/math/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ add_header_library(
float.h
)

# TODO(sivachandra): Remove the dependency on __errno_location as the tested
# entry points depend on the already.
add_math_unittest(
cosf_test
NEED_MPFR
Expand All @@ -40,6 +42,7 @@ add_math_unittest(
sdcomp26094.h
DEPENDS
.float_utils
libc.src.errno.__errno_location
libc.src.math.cosf
libc.utils.CPP.standalone_cpp
)
Expand All @@ -55,6 +58,7 @@ add_math_unittest(
sdcomp26094.h
DEPENDS
.float_utils
libc.src.errno.__errno_location
libc.src.math.sinf
libc.utils.CPP.standalone_cpp
)
Expand All @@ -70,6 +74,7 @@ add_math_unittest(
sdcomp26094.h
DEPENDS
.float_utils
libc.src.errno.__errno_location
libc.src.math.sincosf
libc.utils.CPP.standalone_cpp
)
3 changes: 3 additions & 0 deletions libc/test/src/stdio/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,7 @@ add_libc_unittest(
fwrite_test.cpp
DEPENDS
libc.src.stdio.fwrite
# TODO(sivachandra): remove private dependencies of fwrite
libc.src.threads.mtx_lock
libc.src.threads.mtx_unlock
)
7 changes: 7 additions & 0 deletions libc/test/src/string/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ add_libc_unittest(
SRCS
strcat_test.cpp
DEPENDS
# TODO (sivachandra): remove redundant deps.
libc.src.string.memcpy
libc.src.string.strcat
libc.src.string.strcpy
libc.src.string.strlen
)

add_libc_unittest(
Expand All @@ -19,7 +23,10 @@ add_libc_unittest(
SRCS
strcpy_test.cpp
DEPENDS
# TODO (sivachandra): remove redundant deps.
libc.src.string.memcpy
libc.src.string.strcpy
libc.src.string.strlen
)

add_libc_unittest(
Expand Down
2 changes: 2 additions & 0 deletions libc/test/src/unistd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,7 @@ add_libc_unittest(
DEPENDS
libc.src.unistd.write
libc.include.errno
# TODO(sivachandra): Remove redundant deps.
libc.src.errno.__errno_location
libc.include.unistd
)