Generator Expression Support in <LANG>_CLANG_TIDY
There may be cases when a project wants to build a plugin for clang-tidy that contains custom checks for the project. In those cases, being able to build the plugin as part of the project itself requires that <LANG>_CLANG_TIDY
supports generator expressions. An example to illustrate why:
find_package(Clang REQUIRED)
add_library(clang-tidy-module MODULE module.cxx)
target_link_libraries(clang-tidy-module PRIVATE clang-tidy)
set(CMAKE_CXX_CLANG_TIDY $<TARGET_FILE:clang-tidy> --load=$<COMMAND_CONFIG:$<TARGET_FILE:clang-tidy-module>>)
add_executable(tgt main.cxx)
Since we don't know the location of the plugin at configure time, the only thing we can pass to the --load
argument is a $<TARGET_FILE:...>
generator expression.
Edited by Kyle Edwards