Skip to content

[cppwinrt] Guard add_library to avoid "another target with the same name already exists" CMake error#49767

Open
nathan-white-mojang wants to merge 5 commits intomicrosoft:masterfrom
nathan-white-mojang:patch-1
Open

[cppwinrt] Guard add_library to avoid "another target with the same name already exists" CMake error#49767
nathan-white-mojang wants to merge 5 commits intomicrosoft:masterfrom
nathan-white-mojang:patch-1

Conversation

@nathan-white-mojang
Copy link
Copy Markdown

Fixes #49720.

Guards the add_library call so that consumers of the package can call find_package without needing to guard to avoid the CMake build:

_add_library cannot create imported target "Microsoft::CppWinRT" because
  another target with the same name already exists.

Copy link
Copy Markdown
Contributor

@dg0yt dg0yt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, it is not your fault, apart from theCPPWINRT_TOOL item. I just comment what I see.

@nathan-white-mojang

This comment was marked as resolved.

@nathan-white-mojang nathan-white-mojang marked this pull request as ready for review March 17, 2026 22:52
Copy link
Copy Markdown
Contributor

@dg0yt dg0yt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick.

@vicroms vicroms marked this pull request as draft March 18, 2026 08:02
@nathan-white-mojang nathan-white-mojang marked this pull request as ready for review April 7, 2026 21:39
Copy link
Copy Markdown
Contributor

@dg0yt dg0yt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but needs nathan-white-mojang#1.

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.

[cppwinrt] missing add_library guard

2 participants