From a9f29d9c4c33d93619e3ad463b7703136adeff31 Mon Sep 17 00:00:00 2001 From: Sean Harmer Date: Wed, 20 Mar 2024 15:05:29 +0000 Subject: [PATCH] Export symbols when compiling glm as shared lib --- glm/CMakeLists.txt | 6 + glm/detail/glm.cpp | 378 ++++++++++++++++++++++----------------------- 2 files changed, 195 insertions(+), 189 deletions(-) diff --git a/glm/CMakeLists.txt b/glm/CMakeLists.txt index 178d23ab..14269046 100644 --- a/glm/CMakeLists.txt +++ b/glm/CMakeLists.txt @@ -67,3 +67,9 @@ else() add_library(glm::glm ALIAS glm) target_link_libraries(glm INTERFACE glm-header-only) endif() + +include(GenerateExportHeader) +generate_export_header(glm BASE_NAME glm) +target_include_directories(glm PUBLIC $) +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/glm_export.h + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/glm) diff --git a/glm/detail/glm.cpp b/glm/detail/glm.cpp index e0755bd6..c6628f8c 100644 --- a/glm/detail/glm.cpp +++ b/glm/detail/glm.cpp @@ -4,6 +4,7 @@ #ifndef GLM_ENABLE_EXPERIMENTAL #define GLM_ENABLE_EXPERIMENTAL #endif +#include #include #include #include @@ -14,250 +15,249 @@ namespace glm { // tvec1 type explicit instantiation -template struct vec<1, uint8, lowp>; -template struct vec<1, uint16, lowp>; -template struct vec<1, uint32, lowp>; -template struct vec<1, uint64, lowp>; -template struct vec<1, int8, lowp>; -template struct vec<1, int16, lowp>; -template struct vec<1, int32, lowp>; -template struct vec<1, int64, lowp>; -template struct vec<1, float32, lowp>; -template struct vec<1, float64, lowp>; +template struct GLM_EXPORT vec<1, uint8, lowp>; +template struct GLM_EXPORT vec<1, uint16, lowp>; +template struct GLM_EXPORT vec<1, uint32, lowp>; +template struct GLM_EXPORT vec<1, uint64, lowp>; +template struct GLM_EXPORT vec<1, int8, lowp>; +template struct GLM_EXPORT vec<1, int16, lowp>; +template struct GLM_EXPORT vec<1, int32, lowp>; +template struct GLM_EXPORT vec<1, int64, lowp>; +template struct GLM_EXPORT vec<1, float32, lowp>; +template struct GLM_EXPORT vec<1, float64, lowp>; -template struct vec<1, uint8, mediump>; -template struct vec<1, uint16, mediump>; -template struct vec<1, uint32, mediump>; -template struct vec<1, uint64, mediump>; -template struct vec<1, int8, mediump>; -template struct vec<1, int16, mediump>; -template struct vec<1, int32, mediump>; -template struct vec<1, int64, mediump>; -template struct vec<1, float32, mediump>; -template struct vec<1, float64, mediump>; +template struct GLM_EXPORT vec<1, uint8, mediump>; +template struct GLM_EXPORT vec<1, uint16, mediump>; +template struct GLM_EXPORT vec<1, uint32, mediump>; +template struct GLM_EXPORT vec<1, uint64, mediump>; +template struct GLM_EXPORT vec<1, int8, mediump>; +template struct GLM_EXPORT vec<1, int16, mediump>; +template struct GLM_EXPORT vec<1, int32, mediump>; +template struct GLM_EXPORT vec<1, int64, mediump>; +template struct GLM_EXPORT vec<1, float32, mediump>; +template struct GLM_EXPORT vec<1, float64, mediump>; -template struct vec<1, uint8, highp>; -template struct vec<1, uint16, highp>; -template struct vec<1, uint32, highp>; -template struct vec<1, uint64, highp>; -template struct vec<1, int8, highp>; -template struct vec<1, int16, highp>; -template struct vec<1, int32, highp>; -template struct vec<1, int64, highp>; -template struct vec<1, float32, highp>; -template struct vec<1, float64, highp>; +template struct GLM_EXPORT vec<1, uint8, highp>; +template struct GLM_EXPORT vec<1, uint16, highp>; +template struct GLM_EXPORT vec<1, uint32, highp>; +template struct GLM_EXPORT vec<1, uint64, highp>; +template struct GLM_EXPORT vec<1, int8, highp>; +template struct GLM_EXPORT vec<1, int16, highp>; +template struct GLM_EXPORT vec<1, int32, highp>; +template struct GLM_EXPORT vec<1, int64, highp>; +template struct GLM_EXPORT vec<1, float32, highp>; +template struct GLM_EXPORT vec<1, float64, highp>; // tvec2 type explicit instantiation -template struct vec<2, uint8, lowp>; -template struct vec<2, uint16, lowp>; -template struct vec<2, uint32, lowp>; -template struct vec<2, uint64, lowp>; -template struct vec<2, int8, lowp>; -template struct vec<2, int16, lowp>; -template struct vec<2, int32, lowp>; -template struct vec<2, int64, lowp>; -template struct vec<2, float32, lowp>; -template struct vec<2, float64, lowp>; +template struct GLM_EXPORT vec<2, uint8, lowp>; +template struct GLM_EXPORT vec<2, uint16, lowp>; +template struct GLM_EXPORT vec<2, uint32, lowp>; +template struct GLM_EXPORT vec<2, uint64, lowp>; +template struct GLM_EXPORT vec<2, int8, lowp>; +template struct GLM_EXPORT vec<2, int16, lowp>; +template struct GLM_EXPORT vec<2, int32, lowp>; +template struct GLM_EXPORT vec<2, int64, lowp>; +template struct GLM_EXPORT vec<2, float32, lowp>; +template struct GLM_EXPORT vec<2, float64, lowp>; -template struct vec<2, uint8, mediump>; -template struct vec<2, uint16, mediump>; -template struct vec<2, uint32, mediump>; -template struct vec<2, uint64, mediump>; -template struct vec<2, int8, mediump>; -template struct vec<2, int16, mediump>; -template struct vec<2, int32, mediump>; -template struct vec<2, int64, mediump>; -template struct vec<2, float32, mediump>; -template struct vec<2, float64, mediump>; +template struct GLM_EXPORT vec<2, uint8, mediump>; +template struct GLM_EXPORT vec<2, uint16, mediump>; +template struct GLM_EXPORT vec<2, uint32, mediump>; +template struct GLM_EXPORT vec<2, uint64, mediump>; +template struct GLM_EXPORT vec<2, int8, mediump>; +template struct GLM_EXPORT vec<2, int16, mediump>; +template struct GLM_EXPORT vec<2, int32, mediump>; +template struct GLM_EXPORT vec<2, int64, mediump>; +template struct GLM_EXPORT vec<2, float32, mediump>; +template struct GLM_EXPORT vec<2, float64, mediump>; -template struct vec<2, uint8, highp>; -template struct vec<2, uint16, highp>; -template struct vec<2, uint32, highp>; -template struct vec<2, uint64, highp>; -template struct vec<2, int8, highp>; -template struct vec<2, int16, highp>; -template struct vec<2, int32, highp>; -template struct vec<2, int64, highp>; -template struct vec<2, float32, highp>; -template struct vec<2, float64, highp>; +template struct GLM_EXPORT vec<2, uint8, highp>; +template struct GLM_EXPORT vec<2, uint16, highp>; +template struct GLM_EXPORT vec<2, uint32, highp>; +template struct GLM_EXPORT vec<2, uint64, highp>; +template struct GLM_EXPORT vec<2, int8, highp>; +template struct GLM_EXPORT vec<2, int16, highp>; +template struct GLM_EXPORT vec<2, int32, highp>; +template struct GLM_EXPORT vec<2, int64, highp>; +template struct GLM_EXPORT vec<2, float32, highp>; +template struct GLM_EXPORT vec<2, float64, highp>; // tvec3 type explicit instantiation -template struct vec<3, uint8, lowp>; -template struct vec<3, uint16, lowp>; -template struct vec<3, uint32, lowp>; -template struct vec<3, uint64, lowp>; -template struct vec<3, int8, lowp>; -template struct vec<3, int16, lowp>; -template struct vec<3, int32, lowp>; -template struct vec<3, int64, lowp>; -template struct vec<3, float32, lowp>; -template struct vec<3, float64, lowp>; +template struct GLM_EXPORT vec<3, uint8, lowp>; +template struct GLM_EXPORT vec<3, uint16, lowp>; +template struct GLM_EXPORT vec<3, uint32, lowp>; +template struct GLM_EXPORT vec<3, uint64, lowp>; +template struct GLM_EXPORT vec<3, int8, lowp>; +template struct GLM_EXPORT vec<3, int16, lowp>; +template struct GLM_EXPORT vec<3, int32, lowp>; +template struct GLM_EXPORT vec<3, int64, lowp>; +template struct GLM_EXPORT vec<3, float32, lowp>; +template struct GLM_EXPORT vec<3, float64, lowp>; -template struct vec<3, uint8, mediump>; -template struct vec<3, uint16, mediump>; -template struct vec<3, uint32, mediump>; -template struct vec<3, uint64, mediump>; -template struct vec<3, int8, mediump>; -template struct vec<3, int16, mediump>; -template struct vec<3, int32, mediump>; -template struct vec<3, int64, mediump>; -template struct vec<3, float32, mediump>; -template struct vec<3, float64, mediump>; +template struct GLM_EXPORT vec<3, uint8, mediump>; +template struct GLM_EXPORT vec<3, uint16, mediump>; +template struct GLM_EXPORT vec<3, uint32, mediump>; +template struct GLM_EXPORT vec<3, uint64, mediump>; +template struct GLM_EXPORT vec<3, int8, mediump>; +template struct GLM_EXPORT vec<3, int16, mediump>; +template struct GLM_EXPORT vec<3, int32, mediump>; +template struct GLM_EXPORT vec<3, int64, mediump>; +template struct GLM_EXPORT vec<3, float32, mediump>; +template struct GLM_EXPORT vec<3, float64, mediump>; -template struct vec<3, uint8, highp>; -template struct vec<3, uint16, highp>; -template struct vec<3, uint32, highp>; -template struct vec<3, uint64, highp>; -template struct vec<3, int8, highp>; -template struct vec<3, int16, highp>; -template struct vec<3, int32, highp>; -template struct vec<3, int64, highp>; -template struct vec<3, float32, highp>; -template struct vec<3, float64, highp>; +template struct GLM_EXPORT vec<3, uint8, highp>; +template struct GLM_EXPORT vec<3, uint16, highp>; +template struct GLM_EXPORT vec<3, uint32, highp>; +template struct GLM_EXPORT vec<3, uint64, highp>; +template struct GLM_EXPORT vec<3, int8, highp>; +template struct GLM_EXPORT vec<3, int16, highp>; +template struct GLM_EXPORT vec<3, int32, highp>; +template struct GLM_EXPORT vec<3, int64, highp>; +template struct GLM_EXPORT vec<3, float32, highp>; +template struct GLM_EXPORT vec<3, float64, highp>; // tvec4 type explicit instantiation -template struct vec<4, uint8, lowp>; -template struct vec<4, uint16, lowp>; -template struct vec<4, uint32, lowp>; -template struct vec<4, uint64, lowp>; -template struct vec<4, int8, lowp>; -template struct vec<4, int16, lowp>; -template struct vec<4, int32, lowp>; -template struct vec<4, int64, lowp>; -template struct vec<4, float32, lowp>; -template struct vec<4, float64, lowp>; +template struct GLM_EXPORT vec<4, uint8, lowp>; +template struct GLM_EXPORT vec<4, uint16, lowp>; +template struct GLM_EXPORT vec<4, uint32, lowp>; +template struct GLM_EXPORT vec<4, uint64, lowp>; +template struct GLM_EXPORT vec<4, int8, lowp>; +template struct GLM_EXPORT vec<4, int16, lowp>; +template struct GLM_EXPORT vec<4, int32, lowp>; +template struct GLM_EXPORT vec<4, int64, lowp>; +template struct GLM_EXPORT vec<4, float32, lowp>; +template struct GLM_EXPORT vec<4, float64, lowp>; -template struct vec<4, uint8, mediump>; -template struct vec<4, uint16, mediump>; -template struct vec<4, uint32, mediump>; -template struct vec<4, uint64, mediump>; -template struct vec<4, int8, mediump>; -template struct vec<4, int16, mediump>; -template struct vec<4, int32, mediump>; -template struct vec<4, int64, mediump>; -template struct vec<4, float32, mediump>; -template struct vec<4, float64, mediump>; +template struct GLM_EXPORT vec<4, uint8, mediump>; +template struct GLM_EXPORT vec<4, uint16, mediump>; +template struct GLM_EXPORT vec<4, uint32, mediump>; +template struct GLM_EXPORT vec<4, uint64, mediump>; +template struct GLM_EXPORT vec<4, int8, mediump>; +template struct GLM_EXPORT vec<4, int16, mediump>; +template struct GLM_EXPORT vec<4, int32, mediump>; +template struct GLM_EXPORT vec<4, int64, mediump>; +template struct GLM_EXPORT vec<4, float32, mediump>; +template struct GLM_EXPORT vec<4, float64, mediump>; -template struct vec<4, uint8, highp>; -template struct vec<4, uint16, highp>; -template struct vec<4, uint32, highp>; -template struct vec<4, uint64, highp>; -template struct vec<4, int8, highp>; -template struct vec<4, int16, highp>; -template struct vec<4, int32, highp>; -template struct vec<4, int64, highp>; -template struct vec<4, float32, highp>; -template struct vec<4, float64, highp>; +template struct GLM_EXPORT vec<4, uint8, highp>; +template struct GLM_EXPORT vec<4, uint16, highp>; +template struct GLM_EXPORT vec<4, uint32, highp>; +template struct GLM_EXPORT vec<4, uint64, highp>; +template struct GLM_EXPORT vec<4, int8, highp>; +template struct GLM_EXPORT vec<4, int16, highp>; +template struct GLM_EXPORT vec<4, int32, highp>; +template struct GLM_EXPORT vec<4, int64, highp>; +template struct GLM_EXPORT vec<4, float32, highp>; +template struct GLM_EXPORT vec<4, float64, highp>; // tmat2x2 type explicit instantiation -template struct mat<2, 2, float32, lowp>; -template struct mat<2, 2, float64, lowp>; +template struct GLM_EXPORT mat<2, 2, float32, lowp>; +template struct GLM_EXPORT mat<2, 2, float64, lowp>; -template struct mat<2, 2, float32, mediump>; -template struct mat<2, 2, float64, mediump>; +template struct GLM_EXPORT mat<2, 2, float32, mediump>; +template struct GLM_EXPORT mat<2, 2, float64, mediump>; -template struct mat<2, 2, float32, highp>; -template struct mat<2, 2, float64, highp>; +template struct GLM_EXPORT mat<2, 2, float32, highp>; +template struct GLM_EXPORT mat<2, 2, float64, highp>; // tmat2x3 type explicit instantiation -template struct mat<2, 3, float32, lowp>; -template struct mat<2, 3, float64, lowp>; +template struct GLM_EXPORT mat<2, 3, float32, lowp>; +template struct GLM_EXPORT mat<2, 3, float64, lowp>; -template struct mat<2, 3, float32, mediump>; -template struct mat<2, 3, float64, mediump>; +template struct GLM_EXPORT mat<2, 3, float32, mediump>; +template struct GLM_EXPORT mat<2, 3, float64, mediump>; -template struct mat<2, 3, float32, highp>; -template struct mat<2, 3, float64, highp>; +template struct GLM_EXPORT mat<2, 3, float32, highp>; +template struct GLM_EXPORT mat<2, 3, float64, highp>; // tmat2x4 type explicit instantiation -template struct mat<2, 4, float32, lowp>; -template struct mat<2, 4, float64, lowp>; +template struct GLM_EXPORT mat<2, 4, float32, lowp>; +template struct GLM_EXPORT mat<2, 4, float64, lowp>; -template struct mat<2, 4, float32, mediump>; -template struct mat<2, 4, float64, mediump>; +template struct GLM_EXPORT mat<2, 4, float32, mediump>; +template struct GLM_EXPORT mat<2, 4, float64, mediump>; -template struct mat<2, 4, float32, highp>; -template struct mat<2, 4, float64, highp>; +template struct GLM_EXPORT mat<2, 4, float32, highp>; +template struct GLM_EXPORT mat<2, 4, float64, highp>; // tmat3x2 type explicit instantiation -template struct mat<3, 2, float32, lowp>; -template struct mat<3, 2, float64, lowp>; +template struct GLM_EXPORT mat<3, 2, float32, lowp>; +template struct GLM_EXPORT mat<3, 2, float64, lowp>; -template struct mat<3, 2, float32, mediump>; -template struct mat<3, 2, float64, mediump>; +template struct GLM_EXPORT mat<3, 2, float32, mediump>; +template struct GLM_EXPORT mat<3, 2, float64, mediump>; -template struct mat<3, 2, float32, highp>; -template struct mat<3, 2, float64, highp>; +template struct GLM_EXPORT mat<3, 2, float32, highp>; +template struct GLM_EXPORT mat<3, 2, float64, highp>; // tmat3x3 type explicit instantiation -template struct mat<3, 3, float32, lowp>; -template struct mat<3, 3, float64, lowp>; +template struct GLM_EXPORT mat<3, 3, float32, lowp>; +template struct GLM_EXPORT mat<3, 3, float64, lowp>; -template struct mat<3, 3, float32, mediump>; -template struct mat<3, 3, float64, mediump>; +template struct GLM_EXPORT mat<3, 3, float32, mediump>; +template struct GLM_EXPORT mat<3, 3, float64, mediump>; -template struct mat<3, 3, float32, highp>; -template struct mat<3, 3, float64, highp>; +template struct GLM_EXPORT mat<3, 3, float32, highp>; +template struct GLM_EXPORT mat<3, 3, float64, highp>; // tmat3x4 type explicit instantiation -template struct mat<3, 4, float32, lowp>; -template struct mat<3, 4, float64, lowp>; +template struct GLM_EXPORT mat<3, 4, float32, lowp>; +template struct GLM_EXPORT mat<3, 4, float64, lowp>; -template struct mat<3, 4, float32, mediump>; -template struct mat<3, 4, float64, mediump>; +template struct GLM_EXPORT mat<3, 4, float32, mediump>; +template struct GLM_EXPORT mat<3, 4, float64, mediump>; -template struct mat<3, 4, float32, highp>; -template struct mat<3, 4, float64, highp>; +template struct GLM_EXPORT mat<3, 4, float32, highp>; +template struct GLM_EXPORT mat<3, 4, float64, highp>; // tmat4x2 type explicit instantiation -template struct mat<4, 2, float32, lowp>; -template struct mat<4, 2, float64, lowp>; +template struct GLM_EXPORT mat<4, 2, float32, lowp>; +template struct GLM_EXPORT mat<4, 2, float64, lowp>; -template struct mat<4, 2, float32, mediump>; -template struct mat<4, 2, float64, mediump>; +template struct GLM_EXPORT mat<4, 2, float32, mediump>; +template struct GLM_EXPORT mat<4, 2, float64, mediump>; -template struct mat<4, 2, float32, highp>; -template struct mat<4, 2, float64, highp>; +template struct GLM_EXPORT mat<4, 2, float32, highp>; +template struct GLM_EXPORT mat<4, 2, float64, highp>; // tmat4x3 type explicit instantiation -template struct mat<4, 3, float32, lowp>; -template struct mat<4, 3, float64, lowp>; +template struct GLM_EXPORT mat<4, 3, float32, lowp>; +template struct GLM_EXPORT mat<4, 3, float64, lowp>; -template struct mat<4, 3, float32, mediump>; -template struct mat<4, 3, float64, mediump>; +template struct GLM_EXPORT mat<4, 3, float32, mediump>; +template struct GLM_EXPORT mat<4, 3, float64, mediump>; -template struct mat<4, 3, float32, highp>; -template struct mat<4, 3, float64, highp>; +template struct GLM_EXPORT mat<4, 3, float32, highp>; +template struct GLM_EXPORT mat<4, 3, float64, highp>; // tmat4x4 type explicit instantiation -template struct mat<4, 4, float32, lowp>; -template struct mat<4, 4, float64, lowp>; +template struct GLM_EXPORT mat<4, 4, float32, lowp>; +template struct GLM_EXPORT mat<4, 4, float64, lowp>; -template struct mat<4, 4, float32, mediump>; -template struct mat<4, 4, float64, mediump>; +template struct GLM_EXPORT mat<4, 4, float32, mediump>; +template struct GLM_EXPORT mat<4, 4, float64, mediump>; -template struct mat<4, 4, float32, highp>; -template struct mat<4, 4, float64, highp>; +template struct GLM_EXPORT mat<4, 4, float32, highp>; +template struct GLM_EXPORT mat<4, 4, float64, highp>; // tquat type explicit instantiation -template struct qua; -template struct qua; +template struct GLM_EXPORT qua; +template struct GLM_EXPORT qua; -template struct qua; -template struct qua; +template struct GLM_EXPORT qua; +template struct GLM_EXPORT qua; -template struct qua; -template struct qua; +template struct GLM_EXPORT qua; +template struct GLM_EXPORT qua; -//tdualquat type explicit instantiation -template struct tdualquat; -template struct tdualquat; +// tdualquat type explicit instantiation +template struct GLM_EXPORT tdualquat; +template struct GLM_EXPORT tdualquat; -template struct tdualquat; -template struct tdualquat; +template struct GLM_EXPORT tdualquat; +template struct GLM_EXPORT tdualquat; -template struct tdualquat; -template struct tdualquat; - -}//namespace glm +template struct GLM_EXPORT tdualquat; +template struct GLM_EXPORT tdualquat; +} // namespace glm