mirror of
https://github.com/XRPLF/rippled.git
synced 2026-04-29 15:37:57 +00:00
This change adds `cmake-format` as. a pre-commit hook. The style file closely matches that in Clio, and they will be made to be equivalent over time. For now, some files have been excluded, as those need some manual adjustments, which will be done in future changes.
17 lines
634 B
CMake
17 lines
634 B
CMake
include(isolate_headers)
|
|
|
|
function (xrpl_add_test name)
|
|
set(target ${PROJECT_NAME}.test.${name})
|
|
|
|
file(GLOB_RECURSE sources CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/${name}/*.cpp"
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/${name}.cpp")
|
|
add_executable(${target} ${ARGN} ${sources})
|
|
|
|
isolate_headers(${target} "${CMAKE_SOURCE_DIR}" "${CMAKE_SOURCE_DIR}/tests/${name}" PRIVATE)
|
|
|
|
# Make sure the test isn't optimized away in unity builds
|
|
set_target_properties(${target} PROPERTIES UNITY_BUILD_MODE GROUP UNITY_BUILD_BATCH_SIZE 0) # Adjust as needed
|
|
|
|
add_test(NAME ${target} COMMAND ${target})
|
|
endfunction ()
|