Remove incorrect architecture check

The version configuration file generated by cmake by default has a
slight problem. It checks that the pointer width of the detected library
matches the project being built. This check would usually have little
significance to a header-only library, but it breaks with our noarch
packages which may well get built on a 32-bit host and then get deployed
e.g. on x86_64.

This fixes bug #1758009
f41
Joonas Sarajärvi 5 years ago
parent 70ecac4264
commit e29ce188d8

@ -0,0 +1,34 @@
From a53e3414e5566b288005a8cd59be67ac3af81cec Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Joonas=20Saraj=C3=A4rvi?= <muep@iki.fi>
Date: Sat, 2 May 2020 20:57:48 +0300
Subject: [PATCH] Use built-in mechanism for marking arch-independent
---
CMakeLists.txt | 11 +----------
1 file changed, 1 insertion(+), 10 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2325ebf8..46ed4ef8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -246,16 +246,7 @@ set(GLM_INSTALL_CONFIGDIR "${CMAKE_INSTALL_LIBDIR}/cmake/glm")
install(DIRECTORY glm DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
-# CMake automatically adds an architecture compatibility check to make sure
-# 32 and 64 bit code is not accidentally mixed. For a header-only library this
-# is not required. The check can be disabled by temporarily unsetting
-# CMAKE_SIZEOF_VOID_P. In CMake 3.14 and later this can be achieved more cleanly
-# with write_basic_package_version_file(ARCH_INDEPENDENT).
-# TODO: Use this once a newer CMake can be required.
-set(GLM_SIZEOF_VOID_P ${CMAKE_SIZEOF_VOID_P})
-unset(CMAKE_SIZEOF_VOID_P)
-write_basic_package_version_file("${CMAKE_CURRENT_BINARY_DIR}/glmConfigVersion.cmake" VERSION ${GLM_VERSION} COMPATIBILITY AnyNewerVersion)
-set(CMAKE_SIZEOF_VOID_P ${GLM_SIZEOF_VOID_P})
+write_basic_package_version_file("${CMAKE_CURRENT_BINARY_DIR}/glmConfigVersion.cmake" VERSION ${GLM_VERSION} COMPATIBILITY AnyNewerVersion ARCH_INDEPENDENT)
# build tree package config
configure_file(cmake/glmBuildConfig.cmake.in glmConfig.cmake @ONLY)
--
2.25.4

@ -3,17 +3,18 @@
Name: glm
Version: 0.9.9.6
Release: 2%{?dist}
Release: 3%{?dist}
Summary: C++ mathematics library for graphics programming
License: MIT
URL: http://glm.g-truc.net/
Source0: https://github.com/g-truc/glm/releases/download/%{version}/%{name}-%{version}.zip
Patch0: glm-0.9.9.6-install.patch
Patch1: glm-0.9.9.6-noarch.patch
BuildRequires: gcc
BuildRequires: gcc-c++
BuildRequires: cmake
BuildRequires: cmake >= 3.14
%description
GLM is a C++ library for doing mathematics operations
@ -82,6 +83,7 @@ sed -i 's/\r//' glm/simd/platform.h
sed -i 's/\r//' test/core/core_setup_message.cpp
%patch0 -p1
%patch1 -p1
%build
mkdir build
@ -126,6 +128,9 @@ rmdir $RPM_BUILD_ROOT%{_libdir}
%doc doc/api/
%changelog
* Sat May 02 2020 Joonas Sarajärvi <muep@iki.fi> - 0.9.9.6-3
- Remove arch check from glmConfigVersion.cmake, fix #1758009
* Tue Jan 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.9.6-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild

Loading…
Cancel
Save