blob: 9a06be5461152ce019ae021c4214ed4bb396af6e [file] [log] [blame]
add_custom_target(libc-tool-util-tests)
function(add_libc_tool_unittest target_name)
cmake_parse_arguments(
"LIBC_TOOL_UNITTEST"
"" # No optional arguments
"" # Single value arguments
"SRCS;DEPENDS;ARGS" # Multi-value arguments
${ARGN}
)
add_executable(${target_name}
EXCLUDE_FROM_ALL
${LIBC_TOOL_UNITTEST_SRCS}
)
target_link_libraries(${target_name}
PRIVATE
gtest_main
gtest
${LIBC_TOOL_UNITTEST_DEPENDS}
)
add_custom_command(
TARGET ${target_name}
POST_BUILD
COMMAND $<TARGET_FILE:${target_name}>
${LIBC_TOOL_UNITTEST_ARGS}
)
add_dependencies(libc-tool-util-tests ${target_name})
target_compile_options(${target_name} PUBLIC -fno-rtti)
target_link_libraries(${target_name} PRIVATE LLVMSupport)
endfunction()
add_subdirectory(WrapperGen)