Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explicitly mark another library as static #271

Merged
merged 1 commit into from
Oct 29, 2024

Conversation

AnyOldName3
Copy link
Contributor

I've also figured out why this problem wasn't obvious. It only happens when someone's used the CMake-standard BUILD_SHARED_LIBS option, which controls the default behaviour for add_library. When MyGUI is built as a standalone project, this won't be set (unless someone's done it manually) so it's fine. However, when MyGUI is built as part of a larger project (e.g. package manager like vcpkg or CPM, or as a nested project with FetchContent or as a submodule), it's likely to have been set by something else.

It might be a good idea to pick the default value of MYGUI_STATIC to match BUILD_SHARED_LIBS if it's set, but I've not done that in this PR.

@AnyOldName3 AnyOldName3 changed the title Explicitly mark another library is static Explicitly mark another library as static Oct 29, 2024
I've also figured out why this problem wasn't obvious.
It only happens when someone's used the CMake-standard BUILD_SHARED_LIBS option, which controls the default behaviour for add_library.
When MyGUI is built as a standalone project, this won't be set (unless someone's done it manually) so it's fine.
When MyGUI is built as part of a larger project (e.g. package manager like vcpkg or CPM, or as a nested project with FetchContent), it's likely to have been set by something else.

It might be a good idea to pick the default value of MYGUI_STATIC to match BUILD_SHARED_LIBS if it's set, but I've not done that in this PR.
@AnyOldName3
Copy link
Contributor Author

A little more context: This is a follow-up to #270 as it was pointed out to me by a vcpkg person that the tools (which I'd not built when I tested the other PR) still didn't build.

AnyOldName3 added a commit to AnyOldName3/vcpkg that referenced this pull request Oct 29, 2024
Available upstream as MyGUI/mygui#271, which isn't merged when I'm writing this, but likely will be by the time anyone reviews this PR again.
@Altren
Copy link
Contributor

Altren commented Oct 29, 2024

Nice catch, thank you

@Altren Altren merged commit 8160d41 into MyGUI:master Oct 29, 2024
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