Skip to content

Conversation

ae-ignatiev
Copy link

Subsequent calls of cmake function _userver_codegen_register_files fails with error "userver-codegen target already defined".
Reproduces in case of adding grpc proto libs using userver_add_grpc_library in a subsequent call chain.

simplified example:

find_package(
    userver
    COMPONENTS grpc
    REQUIRED
)

userver_add_grpc_library(${PROJECT_NAME}-proto PROTOS samples/greeter.proto)

add_subdirectory(another_grpc_lib)
# there CMakeLists.txt inside another_grpc_lib with content like
# userver_add_grpc_library(another-lib-proto PROTOS samples/service.proto)
#

Note: by creating a PR or an issue you automatically agree to the CLA. See CONTRIBUTING.md. Feel free to remove this note, the agreement holds.

robot-piglet pushed a commit that referenced this pull request Sep 3, 2025
Tests: протестировано локально и в CI
commit_hash:4c76245dce6da4ba97a76268ffae6dd6f16caa49
@apolukhin
Copy link
Member

We tried to reproduce the issue in 69f95f2 but the CMake keeps working fine

@ae-ignatiev please add a reproducer test to this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants