Files
project_6/cccl_upstream/cmake/CCCLEnsureMetaTargets.cmake
muh-bot dedf08166a [CCCL] Add missing CCCL components: c2h, nvbench_helper, cmake, cudax, AGENTS.md
Added 863 files from NVIDIA/cccl sparse checkout:
- c2h/ (27 files): Catch2 test helpers — generators, validators, runner
- nvbench_helper/ (10 files): Benchmark harness utilities
- cmake/ (29 files): CMake presets and build helpers
- cudax/ (794 files): Experimental CUDA extensions
- AGENTS.md: NVIDIA's official AI agent instructions for CCCL
- CMakePresets.json: Standardized build configurations
- cccl-version.json: Version tracking

Also added CCCL_ASSET_MAP.md mapping all 4295 CCCL files to
competition value and PRD items.

cccl_upstream now covers 100% of competition-critical assets:
- 27 tuning headers (SM80/90/100 benchmark data)
- 32 dispatch headers (algorithm implementations)
- 60 Thrust examples (correctness verification)
- 217 CUB Catch2 tests (regression matrix)
- 153 CUB benchmarks (parameter space search)
- 18 CUB examples (API verification)
- 27 test helpers + benchmark harness
- 794 cudax experimental extensions
2026-08-06 02:14:18 +00:00

53 lines
1.5 KiB
CMake

# Adds "metatargets" using the target_name or METATARGET_PATH.
#
# A metatarget is a custom target that depends on its children targets. For example,
# a target named foo.bar.baz would create metatargets foo and foo.bar, where
# foo depends on foo.bar, and foo.bar depends on foo.bar.baz.
# This allows, for instance, `ninja cudax` to build all cudax.* targets, and `ninja cudax.test`
# to build all cudax.test.* targets.
function(cccl_ensure_metatargets target_name)
set(options)
set(oneValueArgs METATARGET_PATH)
set(multiValueArgs)
cmake_parse_arguments(
_cccl
"${options}"
"${oneValueArgs}"
"${multiValueArgs}"
${ARGN}
)
if (_cccl_UNPARSED_ARGUMENTS)
message(FATAL_ERROR "Unrecognized arguments: ${_cccl_UNPARSED_ARGUMENTS}")
endif()
if (NOT DEFINED _cccl_METATARGET_PATH)
set(_cccl_METATARGET_PATH ${target_name})
endif()
set(parent_path "")
set(current_path "")
string(REPLACE "." ";" path_parts "${_cccl_METATARGET_PATH}")
foreach (part IN LISTS path_parts)
if (current_path STREQUAL "")
set(current_path "${part}")
else()
set(current_path "${current_path}.${part}")
endif()
if (NOT TARGET ${current_path})
add_custom_target(${current_path})
endif()
if (NOT parent_path STREQUAL "")
add_dependencies(${parent_path} ${current_path})
endif()
set(parent_path ${current_path})
endforeach()
if (NOT target_name STREQUAL current_path)
add_dependencies(${current_path} ${target_name})
endif()
endfunction()