From 8fd279abdf948a3b68dcd0ce1da53b79d62233f3 Mon Sep 17 00:00:00 2001 From: Dominik Nussbaumer <4436784+tnixeu@users.noreply.github.com> Date: Mon, 28 Oct 2019 18:21:35 +0100 Subject: [PATCH] Update 'glm' to v0.9.9.5 (#49) * update glm * removes old default for android * fixes 'unused' warnings in example --- cmake/configs/default.cmake | 7 +------ cmake/projects/glm/hunter.cmake | 19 ++++++++++++++++++- examples/glm/core_func_common.cpp | 12 +++++++----- 3 files changed, 26 insertions(+), 12 deletions(-) diff --git a/cmake/configs/default.cmake b/cmake/configs/default.cmake index 3a64eb6428..7109d4023e 100644 --- a/cmake/configs/default.cmake +++ b/cmake/configs/default.cmake @@ -262,12 +262,7 @@ hunter_default_version(glbinding VERSION 3.0.2-p0) hunter_default_version(glew VERSION 2.0.0-p1) hunter_default_version(glfw VERSION 3.3.0-f9923e9-p0) hunter_default_version(glib VERSION 2.54.0) -if(ANDROID) - #compile error in the latest glm on Android - hunter_default_version(glm VERSION 0.9.9.0) -else() - hunter_default_version(glm VERSION 0.9.9.2) -endif() +hunter_default_version(glm VERSION 0.9.9.5) hunter_default_version(globjects VERSION 1.1.0-p0) hunter_default_version(glog VERSION 0.4.0) hunter_default_version(glproto VERSION 1.4.17) diff --git a/cmake/projects/glm/hunter.cmake b/cmake/projects/glm/hunter.cmake index 91801eb212..529fbc7be2 100644 --- a/cmake/projects/glm/hunter.cmake +++ b/cmake/projects/glm/hunter.cmake @@ -61,11 +61,28 @@ hunter_add_version( SHA1 e25b219ead246b255b369e35c37c2e31430021f2 ) + +hunter_add_version( + PACKAGE_NAME + glm + VERSION + "0.9.9.5" + URL + "https://github.com/g-truc/glm/releases/download/0.9.9.5/glm-0.9.9.5.7z" + SHA1 + 86ac27949abbd6654a74c3530ec4fe900768fb84 +) + include(GNUInstallDirs) # glm use custom bundled GNUInstallDirs module so we have to # set correct value explicitly -hunter_cmake_args(glm CMAKE_ARGS CMAKE_INSTALL_LIBDIR=${CMAKE_INSTALL_LIBDIR}) +hunter_cmake_args( + glm + CMAKE_ARGS + CMAKE_INSTALL_LIBDIR=${CMAKE_INSTALL_LIBDIR} + GLM_TEST_ENABLE=OFF +) hunter_pick_scheme(DEFAULT url_sha1_cmake) hunter_cacheable(glm) diff --git a/examples/glm/core_func_common.cpp b/examples/glm/core_func_common.cpp index 2cb289ff14..c37ac123f1 100644 --- a/examples/glm/core_func_common.cpp +++ b/examples/glm/core_func_common.cpp @@ -50,11 +50,13 @@ namespace floor_ { float A(1.1f); float B = glm::floor(A); + Error += glm::epsilonEqual(B, 1.f, 0.0001f) ? 0 : 1; } { - double A(1.1f); + double A = 1.1; double B = glm::floor(A); + Error += glm::epsilonEqual(B, 1.0, 0.0001) ? 0 : 1; } { @@ -315,8 +317,8 @@ namespace min_ int test() { int Error = 0; - - glm::vec1 A0 = glm::min(glm::vec1(1), glm::vec1(1)); +// is not used +// glm::vec1 A0 = glm::min(glm::vec1(1), glm::vec1(1)); glm::vec2 B0 = glm::min(glm::vec2(1), glm::vec2(1)); glm::vec2 B1 = glm::min(glm::vec2(1), 1.0f); @@ -342,8 +344,8 @@ namespace max_ int test() { int Error = 0; - - glm::vec1 A0 = glm::max(glm::vec1(1), glm::vec1(1)); +// is not used +// glm::vec1 A0 = glm::max(glm::vec1(1), glm::vec1(1)); glm::vec2 B0 = glm::max(glm::vec2(1), glm::vec2(1)); glm::vec2 B1 = glm::max(glm::vec2(1), 1.0f);