From 940b4d1848e8c70ab7642901a68594e8016caffc Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 27 Apr 2024 18:51:28 +0200 Subject: Adding upstream version 1:7.0.4. Signed-off-by: Daniel Baumann --- external/glm/Makefile | 7 +++++++ external/glm/Module_glm.mk | 16 ++++++++++++++++ external/glm/README | 3 +++ external/glm/UnpackedTarball_glm.mk | 23 +++++++++++++++++++++++ external/glm/c++20.patch.0 | 11 +++++++++++ external/glm/clang-cl.patch.0 | 14 ++++++++++++++ 6 files changed, 74 insertions(+) create mode 100644 external/glm/Makefile create mode 100644 external/glm/Module_glm.mk create mode 100644 external/glm/README create mode 100644 external/glm/UnpackedTarball_glm.mk create mode 100644 external/glm/c++20.patch.0 create mode 100644 external/glm/clang-cl.patch.0 (limited to 'external/glm') diff --git a/external/glm/Makefile b/external/glm/Makefile new file mode 100644 index 000000000..e4968cf85 --- /dev/null +++ b/external/glm/Makefile @@ -0,0 +1,7 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- + +module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST)))) + +include $(module_directory)/../../solenv/gbuild/partial_build.mk + +# vim: set noet sw=4 ts=4: diff --git a/external/glm/Module_glm.mk b/external/glm/Module_glm.mk new file mode 100644 index 000000000..617b067a2 --- /dev/null +++ b/external/glm/Module_glm.mk @@ -0,0 +1,16 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +$(eval $(call gb_Module_Module,glm)) + +$(eval $(call gb_Module_add_targets,glm,\ + UnpackedTarball_glm \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/external/glm/README b/external/glm/README new file mode 100644 index 000000000..30122f67b --- /dev/null +++ b/external/glm/README @@ -0,0 +1,3 @@ +Glm provides a header only library for OpenGL mathematics. + +It is available from http://glm.g-truc.net/0.9.4/index.html diff --git a/external/glm/UnpackedTarball_glm.mk b/external/glm/UnpackedTarball_glm.mk new file mode 100644 index 000000000..934621eac --- /dev/null +++ b/external/glm/UnpackedTarball_glm.mk @@ -0,0 +1,23 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +$(eval $(call gb_UnpackedTarball_UnpackedTarball,glm)) + +$(eval $(call gb_UnpackedTarball_set_tarball,glm,$(GLM_TARBALL))) + +$(eval $(call gb_UnpackedTarball_set_patchflags,glm,$(if $(filter MSC,$(COM)),--binary))) + +$(eval $(call gb_UnpackedTarball_set_patchlevel,glm,1)) + +$(eval $(call gb_UnpackedTarball_add_patches,glm, \ + external/glm/clang-cl.patch.0 \ + external/glm/c++20.patch.0 \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/external/glm/c++20.patch.0 b/external/glm/c++20.patch.0 new file mode 100644 index 000000000..34a40b5ef --- /dev/null +++ b/external/glm/c++20.patch.0 @@ -0,0 +1,11 @@ +--- glm/detail/type_half.inl ++++ glm/detail/type_half.inl +@@ -6,7 +6,7 @@ + volatile float f = 1e10; + + for(int i = 0; i < 10; ++i) +- f *= f; // this will overflow before the for loop terminates ++ f = f * f; // this will overflow before the for loop terminates + return f; + } + diff --git a/external/glm/clang-cl.patch.0 b/external/glm/clang-cl.patch.0 new file mode 100644 index 000000000..44713a196 --- /dev/null +++ b/external/glm/clang-cl.patch.0 @@ -0,0 +1,14 @@ +# "#pragma intrinsic" not (yet?) handled in the "if (LangOpts.MicrosoftExt)" +# block in Preprocessor::RegisterBuiltinPragmas in Clang's lib/Lex/Pragma.cpp: +--- glm/detail/func_integer.inl ++++ glm/detail/func_integer.inl +@@ -3,7 +3,9 @@ + #include "_vectorize.hpp" + #if(GLM_ARCH & GLM_ARCH_X86 && GLM_COMPILER & GLM_COMPILER_VC) + # include ++#if !defined __clang__^M + # pragma intrinsic(_BitScanReverse) ++#endif + #endif//(GLM_ARCH & GLM_ARCH_X86 && GLM_COMPILER & GLM_COMPILER_VC) + #include + -- cgit v1.2.3