[packages/CGAL] fix passing compiler/linker flags

atler atler at pld-linux.org
Tue Aug 10 13:29:31 CEST 2021


commit 68d6bebe191bba606ae819f865c79079baabe788
Author: Jan Palus <atler at pld-linux.org>
Date:   Tue Aug 10 13:28:33 2021 +0200

    fix passing compiler/linker flags

 CGAL-buildtype.patch | 13 +++++++++++++
 CGAL.spec            |  8 ++++----
 2 files changed, 17 insertions(+), 4 deletions(-)
---
diff --git a/CGAL.spec b/CGAL.spec
index 91fcc0b..caf5e00 100644
--- a/CGAL.spec
+++ b/CGAL.spec
@@ -17,6 +17,7 @@ License:	GPL v3+ and LGPL v3+
 Group:		Libraries
 Source0:	https://github.com/CGAL/releases/archive/%{name}-%{version}.tar.gz
 # Source0-md5:	50b29d3f3372cd93aaa31d01f0e45036
+Patch0:		%{name}-buildtype.patch
 URL:		http://www.cgal.org/
 BuildRequires:	OpenGL-GLU-devel
 BuildRequires:	Qt5Core-devel >= %{qt5_ver}
@@ -115,6 +116,7 @@ demonstracyjnych do algorytmów CGAL.
 
 %prep
 %setup -q -n releases-%{name}-%{version}
+%patch0 -p1
 
 %build
 install -d build
@@ -122,10 +124,8 @@ cd build
 # override build type, because:
 # PLD is not a valid build type: only Release or Debug is allowed
 %cmake .. \
-	-DCMAKE_BUILD_TYPE=%{!?debug:Release}%{?debug:Debug} \
-	-DCMAKE_CXX_FLAGS_Release="%{rpmcxxflags}" \
-	-DCMAKE_EXE_LINKER_FLAGS_Release="%{rpmldflags}" \
-	-DCMAKE_SHARED_LINKER_FLAGS_Release="%{rpmldflags}" \
+	-DCGAL_CXX_FLAGS="%{rpmcxxflags} %{rpmcppflags}" \
+	-DCGAL_SHARED_LINKER_FLAGS="%{rpmldflags}" \
 	-DCGAL_INSTALL_LIB_DIR=%{_lib} \
 	-DCGAL_INSTALL_DOC_DIR= \
 	%{?with_qt3:-DWITH_CGAL_Qt3=ON} \
diff --git a/CGAL-buildtype.patch b/CGAL-buildtype.patch
new file mode 100644
index 0000000..534e04e
--- /dev/null
+++ b/CGAL-buildtype.patch
@@ -0,0 +1,13 @@
+--- releases-CGAL-4.7/cmake/modules/CGAL_SetupFlags.cmake.orig	2015-10-20 09:06:23.000000000 +0200
++++ releases-CGAL-4.7/cmake/modules/CGAL_SetupFlags.cmake	2021-08-10 13:26:55.346479677 +0200
+@@ -61,10 +61,6 @@
+   add_definitions(-DCGAL_TEST_SUITE)
+ endif()
+ 
+-if ( NOT "${CMAKE_BUILD_TYPE}" STREQUAL "Release" AND NOT "${CMAKE_BUILD_TYPE}" STREQUAL "Debug" )
+-  message( FATAL_ERROR "${CMAKE_BUILD_TYPE} is not a valid build type: only Release or Debug is allowed" )
+-endif()
+-
+ message( STATUS "Build type: ${CMAKE_BUILD_TYPE}" )
+ 
+ string( TOUPPER "${CMAKE_BUILD_TYPE}" CGAL_BUILD_TYPE_UPPER )
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/CGAL.git/commitdiff/63aecd1f62a3159fee0ee06696a294ca687052a5



More information about the pld-cvs-commit mailing list