g-truc / glm

OpenGL Mathematics (GLM)
https://glm.g-truc.net
Other
9.05k stars 2.1k forks source link

Export symbols when compiling glm as shared lib #1280

Open seanharmer opened 5 months ago

seanharmer commented 5 months ago

Possible fix for https://github.com/g-truc/glm/issues/1279

orion160 commented 5 months ago

Oh, great! But I think that it does not export the symbols of free functions

seanharmer commented 5 months ago

Do you have an example please? The ones I looked at all seemed to be inline. If you can point me at an example I can try to export those too.

orion160 commented 5 months ago

https://github.com/g-truc/glm/blob/master/glm/detail/setup.hpp There are GLM_FUNC_QUALIFIER and GLM_FUNC_DECL

Mmmmm I dont know if inline functions have to be exported, but the linker has to know symbol names to perform relocation. So its probably that it is needed

orion160 commented 4 months ago

@christophe-lunarg what do you think?

xiaozhuai commented 2 months ago
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/glm_export.h
        DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/glm)

Anyway, install things should stay in if(GLM_BUILD_INSTALL) scope.