DEB uncrustify: allow build on older distributions.

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
pull/2/head
Slávek Banko 4 years ago committed by Michele Calgaro
parent 7f3c5d7e3e
commit 243aa916cf
Signed by: MicheleC
GPG Key ID: 2A75B7CA8ADED5CF

@ -1,8 +1,8 @@
Source: uncrustify-trinity
Section: devel
Section: deps-r14/devel
Priority: optional
Maintainer: Alexander GQ Gerasiov <gq@debian.org>
Build-Depends: debhelper-compat (= 12), cmake, python3
Build-Depends: debhelper (>= 9~), cmake (>= 3.0~), python3 (>= 3.3~), gcc (>= 4:4.9~)
Standards-Version: 4.5.0
Homepage: https://github.com/uncrustify/uncrustify
Vcs-Git: https://salsa.debian.org/debian/uncrustify.git

@ -0,0 +1,40 @@
Index: b/CMakeLists.txt
===================================================================
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.2)
+cmake_minimum_required(VERSION 3.0)
project(uncrustify-trinity)
@@ -51,8 +51,12 @@
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
endif()
-set(CMAKE_CXX_STANDARD 11)
-set(CMAKE_CXX_STANDARD_REQUIRED YES)
+if( ${CMAKE_VERSION} VERSION_LESS "3.1" )
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11")
+else()
+ set(CMAKE_CXX_STANDARD 11)
+ set(CMAKE_CXX_STANDARD_REQUIRED YES)
+endif()
if(ENABLE_SANITIZER)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O1 -fno-omit-frame-pointer -fsanitize=${ENABLE_SANITIZER}")
@@ -139,8 +143,13 @@
else()
# Add target to generate version header;
# do this every build to ensure git SHA is up to date
+ if( ${CMAKE_VERSION} VERSION_LESS "3.2" )
+ set( VERSION_HEADER_BYPRODUCTS "" )
+ else()
+ set( VERSION_HEADER_BYPRODUCTS "BYPRODUCTS" "${PROJECT_BINARY_DIR}/uncrustify_version.h" )
+ endif()
add_custom_target(generate_version_header
- BYPRODUCTS "${PROJECT_BINARY_DIR}/uncrustify_version.h"
+ ${VERSION_HEADER_BYPRODUCTS}
COMMAND
${CMAKE_COMMAND}
-D PYTHON_EXECUTABLE:STRING=${PYTHON_EXECUTABLE}

@ -1,2 +1,3 @@
001_docs-remove-remote-images.patch
002_trinity_customization.diff
003_allow_older_distributions.diff

@ -0,0 +1,3 @@
# Use xz instead of gzip
compression = "xz"
compression-level = 9
Loading…
Cancel
Save