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

BUILD_SHARED_LIBS bypasses build type check in glad_add_library() #496

Open
shibotto opened this issue Nov 2, 2024 · 0 comments
Open

BUILD_SHARED_LIBS bypasses build type check in glad_add_library() #496

shibotto opened this issue Nov 2, 2024 · 0 comments

Comments

@shibotto
Copy link

shibotto commented Nov 2, 2024

glad/cmake/GladConfig.cmake

Lines 191 to 192 in f492295

if(BUILD_SHARED_LIBS)
set(GG_SHARED TRUE)

glad/cmake/GladConfig.cmake

Lines 260 to 268 in f492295

if(GG_SHARED)
list(APPEND GLAD_ADD_LIBRARY_ARGS SHARED)
elseif(GG_STATIC)
list(APPEND GLAD_ADD_LIBRARY_ARGS STATIC)
elseif(GG_MODULE)
list(APPEND GLAD_ADD_LIBRARY_ARGS MODULE)
elseif(GG_INTERFACE)
list(APPEND GLAD_ADD_LIBRARY_ARGS INTERFACE)
endif()

The problem with things in this order is that if BUILD_SHARED_LIBS is set, the build type will always be SHARED, despite what you may have specified when calling glad_add_library(). If I haven't misinterpreted the doc at the top of that file, BUILD_SHARED_LIBS should be the fallback behavior instead.

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

No branches or pull requests

1 participant