BUILD_SHARED_LIBS bypasses build type check in glad_add_library()
https://github.com/Dav1dde/glad/blob/f49229523c58ad7698e941f7c51454e77dd9d6a8/cmake/GladConfig.cmake#L191-L192
https://github.com/Dav1dde/glad/blob/f49229523c58ad7698e941f7c51454e77dd9d6a8/cmake/GladConfig.cmake#L260-L268

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.