2
1
mirror of https://github.com/qpdf/qpdf.git synced 2024-12-22 10:58:58 +00:00

Merge pull request #1081 from jberkenbilt/future-build

Future build
This commit is contained in:
Jay Berkenbilt 2023-12-16 11:53:47 -05:00 committed by GitHub
commit 1d05390585
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 70 additions and 31 deletions

View File

@ -118,6 +118,14 @@ jobs:
- uses: actions/checkout@v3
- name: 'pikepdf'
run: build-scripts/test-pikepdf
pikepdf-future:
runs-on: ubuntu-latest
# Run after pikepdf to save concurrent runners
needs: pikepdf
steps:
- uses: actions/checkout@v3
- name: 'qpdf + pikepdf with FUTURE'
run: build-scripts/test-pikepdf future
Fuzzers:
runs-on: ubuntu-latest
needs: Prebuild
@ -139,3 +147,11 @@ jobs:
- uses: actions/checkout@v3
- name: 'Unsigned Char Tests'
run: build-scripts/test-unsigned-char
CxxNext:
runs-on: ubuntu-latest
# Build after Fuzzers to save concurrent runners
needs: Fuzzers
steps:
- uses: actions/checkout@v3
- name: 'Build with Next C++ standard'
run: build-scripts/test-c++-next

View File

@ -3,7 +3,8 @@ cmake_minimum_required(VERSION 3.16)
# make_dist expects the version line to be on a line by itself after
# the project line. When updating the version, check make_dist for all
# the places it has to be updated.
# the places it has to be updated. The doc configuration and CI build
# also find the version number here.
project(qpdf
VERSION 11.7.0
LANGUAGES C CXX)
@ -105,6 +106,7 @@ option(INSTALL_CMAKE_PACKAGE "Install cmake package files" ON)
option(INSTALL_EXAMPLES "Install example files" ON)
option(FUTURE "Include ABI-breaking changes CONSIDERED for the next major release" OFF)
option(CXX_NEXT "Build with next C++ standard version" OFF)
# *** END OPTIONS ***
@ -147,8 +149,14 @@ endif()
# increment SOVERSION every time we increment the project major
# version. This works because qpdf uses semantic versioning. qpdf 10.x
# was libqpdf28, so start from there.
math(EXPR qpdf_SOVERSION "${PROJECT_VERSION_MAJOR} + 18")
set(qpdf_LIBVERSION ${qpdf_SOVERSION}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH})
if(FUTURE)
math(EXPR qpdf_SOVERSION 0)
set(qpdf_LIBVERSION 0)
else()
math(EXPR qpdf_SOVERSION "${PROJECT_VERSION_MAJOR} + 18")
set(qpdf_LIBVERSION ${qpdf_SOVERSION}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH})
endif()
if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
message(FATAL_ERROR "
@ -159,7 +167,11 @@ Please build with cmake in a subdirectory, e.g.
Please remove CMakeCache.txt and the CMakeFiles directories.")
endif()
set(CMAKE_CXX_STANDARD 17)
if(CXX_NEXT)
set(CMAKE_CXX_STANDARD 20)
else()
set(CMAKE_CXX_STANDARD 17)
endif()
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_C_VISIBILITY_PRESET hidden)

View File

@ -10,7 +10,7 @@ pip3 install sphinx sphinx_rtd_theme
cmake -S . -B build -DBUILD_DOC=1
cmake --build build --verbose --target doc_dist
zip -r doc.zip build/manual/doc-dist
version=$(grep -E '^release' manual/conf.py | cut -d"'" -f 2)
version=$(grep -E '^ +VERSION [1-9]' CMakeLists.txt | awk '{print $2}')
mv build/manual/doc-dist qpdf-${version}-doc
mkdir distribution
zip -r distribution/qpdf-${version}-doc-ci.zip qpdf-${version}-doc

14
build-scripts/test-c++-next Executable file
View File

@ -0,0 +1,14 @@
#!/bin/bash
set -e
sudo apt-get update
sudo apt-get -y install \
build-essential cmake \
zlib1g-dev libjpeg-dev libgnutls28-dev libssl-dev
cmake -S . -B build \
-DCXX_NEXT=ON \
-DCI_MODE=1 -DBUILD_STATIC_LIBS=0 -DCMAKE_BUILD_TYPE=Release \
-DREQUIRE_CRYPTO_OPENSSL=1 -DREQUIRE_CRYPTO_GNUTLS=1 \
-DENABLE_QTC=1
cmake --build build --verbose -j$(nproc) -- -k
cd build
ctest --verbose

View File

@ -1,10 +1,20 @@
#!/bin/bash
set -ex
cmake_extra=
future=0
if [ "$1" = "future" ]; then
future=1
cmake_extra=-DFUTURE=ON
fi
sudo apt-get update
sudo apt-get -y install \
build-essential cmake zlib1g-dev libjpeg-dev libgnutls28-dev
cmake -S . -B build -DBUILD_STATIC_LIBS=0 -DCMAKE_BUILD_TYPE=RelWithDebInfo
cmake -S . -B build -DBUILD_STATIC_LIBS=0 -DCMAKE_BUILD_TYPE=RelWithDebInfo $cmake_extra
cmake --build build --verbose -j$(nproc) --target libqpdf -- -k
if [ "$future" = "1" ]; then
# Run qpdf's test suite in FUTURE mode as well
ctest --verbose
fi
export QPDF_SOURCE_TREE=$PWD
export QPDF_BUILD_LIBDIR=$QPDF_SOURCE_TREE/build/libqpdf
export LD_LIBRARY_PATH=$QPDF_BUILD_LIBDIR

View File

@ -27,7 +27,12 @@
#define QPDF_MAJOR_VERSION 11
#define QPDF_MINOR_VERSION 7
#define QPDF_PATCH_VERSION 0
#define QPDF_VERSION "11.7.0"
#ifdef QPDF_FUTURE
# define QPDF_VERSION "11.7.0+future"
#else
# define QPDF_VERSION "11.7.0"
#endif
/*
* This file defines symbols that control the which functions,

View File

@ -59,7 +59,6 @@ cd($tmpdir);
# Check versions
my $cmakeversion = get_version_from_cmake();
my $code_version = get_version_from_source();
my $doc_version = get_version_from_manual();
my $version_error = 0;
if ($version ne $cmakeversion)
@ -72,11 +71,6 @@ if ($version ne $code_version)
print "$whoami: QPDF.cc version = $code_version\n";
$version_error = 1;
}
if ($version ne $doc_version)
{
print "$whoami: doc version = $doc_version\n";
$version_error = 1;
}
if ($version_error)
{
die "$whoami: version numbers are not consistent\n";
@ -157,22 +151,6 @@ sub get_version_from_source
$code_version;
}
sub get_version_from_manual
{
my $fh = safe_open("manual/conf.py");
my $doc_version = 'unknown';
while (<$fh>)
{
if (m/release = '([^\']+)\'/)
{
$doc_version = $1;
last;
}
}
$fh->close();
$doc_version;
}
sub safe_open
{
my $file = shift;

View File

@ -15,8 +15,12 @@ sys.path.append(os.path.abspath("./_ext"))
project = 'QPDF'
copyright = '2005-2023, Jay Berkenbilt'
author = 'Jay Berkenbilt'
# make_dist and the CI build lexically find the release version from this file.
release = '11.7.0'
here = os.path.dirname(os.path.realpath(__file__))
with open(f'{here}/../CMakeLists.txt') as f:
for line in f.readlines():
if line.strip().startswith('VERSION '):
release = line.replace('VERSION', '').strip()
break
version = release
extensions = [
'sphinx_rtd_theme',