Skip to content

BUILD_SHARED_LIBS bypasses build type check in glad_add_library() #496

Open
@shibotto

Description

@shibotto

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions