Files
cmake/Tests/RunCMake/target_compile_features/alias_target.cmake
T
Arha Gatram 79e421b053 ALIAS: Add support for target_* commands
Now that set_property and set_target_properties support ALIAS targets,
we need to extend support to all the target_* type commands that modify
target properties.

Relaxes target_compile_definitions, target_compile_features,
target_compile_options, target_include_directories,
target_link_directories, target_link_libraries, target_link_options,
target_precompile_headers, and target_sources to now accept ALIAS
targets. These commands set properties on the target which the alias
references.
2026-07-08 11:51:50 -04:00

13 lines
563 B
CMake

enable_language(CXX)
add_executable(main empty.cpp)
add_executable(Alias::Main ALIAS main)
if("cxx_delegating_constructors" IN_LIST CMAKE_CXX_COMPILE_FEATURES)
target_compile_features(Alias::Main PRIVATE cxx_delegating_constructors)
get_target_property(val main COMPILE_FEATURES)
if(NOT "cxx_delegating_constructors" IN_LIST val)
message(SEND_ERROR "target_compile_features(): Target property 'COMPILE_FEATURES' is missing value added to ALIAS 'Alias::Main' on aliased target 'main': 'cxx_delegating_constructors' not in '${val}'.")
endif()
endif()