Skip to content

fix build: fix debian protobuf build#1273

Open
Malevrovich wants to merge 1 commit into
userver-framework:developfrom
Malevrovich:fix-debian-proto
Open

fix build: fix debian protobuf build#1273
Malevrovich wants to merge 1 commit into
userver-framework:developfrom
Malevrovich:fix-debian-proto

Conversation

@Malevrovich

Copy link
Copy Markdown
Contributor

userver-protobuf-unittest-proto was defined after userver_module() called target_link_libraries with its name. Since the target didn't exist yet, CMake treated it as a plain linker flag and skipped transitive include-directory propagation. The compiler never received -I for the generated protobuf headers directory, causing "proto_json/messages.pb.h: No such file or directory" in parallel builds.

Move proto target setup into tests/CMakeLists.txt and add_subdirectory before userver_module() so the target exists when linked against.


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.

userver-protobuf-unittest-proto was defined after userver_module()
called target_link_libraries with its name. Since the target didn't
exist yet, CMake treated it as a plain linker flag and skipped
transitive include-directory propagation. The compiler never received
-I for the generated protobuf headers directory, causing
"proto_json/messages.pb.h: No such file or directory" in parallel
builds.

Move proto target setup into tests/CMakeLists.txt and add_subdirectory
before userver_module() so the target exists when linked against.
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.

1 participant