Files
cmake/Tests/RunCMake/alias_targets/target_compile_options.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
387 B
CMake

enable_language(CXX)
add_library(foo empty.cpp)
add_library(alias ALIAS foo)
target_compile_options(alias PRIVATE -Wall)
get_target_property(val foo COMPILE_OPTIONS)
if(NOT "-Wall" STREQUAL "${val}")
message(SEND_ERROR "target_compile_options(): Target property 'COMPILE_OPTIONS' set on ALIAS 'alias' has wrong value on aliased target 'foo': '${val}' instead of '-Wall'.")
endif()