Migrated from Make to CMake.
This commit is contained in:
parent
cda05294f5
commit
b6ba093000
52 changed files with 1276 additions and 1210 deletions
57
cmake/Developer.cmake
Normal file
57
cmake/Developer.cmake
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
get_target_property(xtc_sources xtc-core SOURCES)
|
||||
add_custom_target(analyze COMMAND ${Python3_EXECUTABLE} tools/analyze.py ${xtc_sources}
|
||||
WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}" VERBATIM)
|
||||
if(BUILD_TESTING)
|
||||
xtc_executable(benchmark_graph tests/integration/benchmark_graph.c)
|
||||
set(XTC_BENCHMARK_BLOCKS 300 CACHE STRING "Benchmark iterations")
|
||||
set(XTC_BENCHMARK_MAX_REGRESSION 1.5 CACHE STRING "Benchmark regression limit")
|
||||
set(XTC_STRESS_ROUNDS 3 CACHE STRING "Stress iterations")
|
||||
set(XTC_BENCHMARK_BASELINE "${PROJECT_SOURCE_DIR}/docs/performance-baseline.json" CACHE FILEPATH "Graph benchmark baseline")
|
||||
set(XTC_PROJECT_BENCHMARK_BASELINE "${PROJECT_SOURCE_DIR}/docs/project-performance-baseline.json" CACHE FILEPATH "Project benchmark baseline")
|
||||
foreach(workload graph project)
|
||||
if(workload STREQUAL graph)
|
||||
set(binary benchmark_graph)
|
||||
set(stem benchmark)
|
||||
set(baseline "${XTC_BENCHMARK_BASELINE}")
|
||||
set(report performance.json)
|
||||
else()
|
||||
set(binary test_performance)
|
||||
set(stem benchmark-project)
|
||||
set(baseline "${XTC_PROJECT_BENCHMARK_BASELINE}")
|
||||
set(report project-performance.json)
|
||||
endif()
|
||||
foreach(compare "" "-compare")
|
||||
set(extra)
|
||||
if(compare)
|
||||
set(extra --baseline "${baseline}" --max-regression ${XTC_BENCHMARK_MAX_REGRESSION})
|
||||
endif()
|
||||
add_custom_target(${stem}${compare}
|
||||
COMMAND ${Python3_EXECUTABLE} tools/benchmark.py --workload ${workload}
|
||||
--binary $<TARGET_FILE:${binary}> --output "${CMAKE_CURRENT_BINARY_DIR}/${report}"
|
||||
--compiler "${CMAKE_C_COMPILER}" --flags "${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_RELEASE}"
|
||||
--blocks ${XTC_BENCHMARK_BLOCKS} ${extra}
|
||||
DEPENDS ${binary} WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}" VERBATIM)
|
||||
endforeach()
|
||||
endforeach()
|
||||
set(stress_deps test_realtime test_reliability test_scale test_portability test_project_diagnostics test_soak)
|
||||
if(TARGET test_backend)
|
||||
list(APPEND stress_deps test_backend)
|
||||
endif()
|
||||
set(gui_arg)
|
||||
if(TARGET test_gui)
|
||||
set(gui_arg --gui)
|
||||
list(APPEND stress_deps test_gui)
|
||||
endif()
|
||||
add_custom_target(test-stress COMMAND ${Python3_EXECUTABLE} tools/stress.py
|
||||
--build-dir "${CMAKE_CURRENT_BINARY_DIR}" --rounds ${XTC_STRESS_ROUNDS} ${gui_arg}
|
||||
DEPENDS ${stress_deps} WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}" VERBATIM)
|
||||
if(XTC_LADSPA_AVAILABLE)
|
||||
add_custom_target(test-stress-plugins COMMAND ${Python3_EXECUTABLE} tools/stress.py
|
||||
--build-dir "${CMAKE_CURRENT_BINARY_DIR}" --rounds ${XTC_STRESS_ROUNDS} --plugin $<TARGET_FILE:plugin-fixture>
|
||||
DEPENDS ${stress_deps} test_plugins plugin-fixture WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}" VERBATIM)
|
||||
endif()
|
||||
add_custom_target(test-plugins-real
|
||||
COMMAND test_plugins /usr/lib/ladspa/amp.so
|
||||
COMMAND test_plugins /usr/lib/ladspa/inv_1429.so
|
||||
COMMAND test_plugins /usr/lib/ladspa/sine.so 3 DEPENDS test_plugins VERBATIM)
|
||||
endif()
|
||||
Loading…
Add table
Add a link
Reference in a new issue