aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJay Berkenbilt <jberkenbilt@users.noreply.github.com>2023-12-16 17:53:47 +0100
committerGitHub <noreply@github.com>2023-12-16 17:53:47 +0100
commit1d053905852b407eef472b0ef7886d10bb650383 (patch)
treeea3cc619a139a1fc8f96266a8bdb3432e4671400
parent290742b069756218cd9d2075ea18b9fa60fc56ca (diff)
parent762f232146f3edc234c898b48e9daacf72ee9577 (diff)
downloadqpdf-1d053905852b407eef472b0ef7886d10bb650383.tar.zst
Merge pull request #1081 from jberkenbilt/future-build
Future build
-rw-r--r--.github/workflows/main.yml16
-rw-r--r--CMakeLists.txt20
-rwxr-xr-xbuild-scripts/build-doc2
-rwxr-xr-xbuild-scripts/test-c++-next14
-rwxr-xr-xbuild-scripts/test-pikepdf12
-rw-r--r--include/qpdf/DLL.h7
-rwxr-xr-xmake_dist22
-rw-r--r--manual/conf.py8
8 files changed, 70 insertions, 31 deletions
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 03d6b929..44f6b142 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -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
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 31ee01ef..707db439 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -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)
diff --git a/build-scripts/build-doc b/build-scripts/build-doc
index e6c72757..7d45d4fa 100755
--- a/build-scripts/build-doc
+++ b/build-scripts/build-doc
@@ -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
diff --git a/build-scripts/test-c++-next b/build-scripts/test-c++-next
new file mode 100755
index 00000000..343a5a4d
--- /dev/null
+++ b/build-scripts/test-c++-next
@@ -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
diff --git a/build-scripts/test-pikepdf b/build-scripts/test-pikepdf
index e6c8a9a4..cdab79cf 100755
--- a/build-scripts/test-pikepdf
+++ b/build-scripts/test-pikepdf
@@ -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
diff --git a/include/qpdf/DLL.h b/include/qpdf/DLL.h
index 6dd5137e..8279da03 100644
--- a/include/qpdf/DLL.h
+++ b/include/qpdf/DLL.h
@@ -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,
diff --git a/make_dist b/make_dist
index acbf71e3..020852eb 100755
--- a/make_dist
+++ b/make_dist
@@ -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;
diff --git a/manual/conf.py b/manual/conf.py
index b95eb3c6..9d4eb5ec 100644
--- a/manual/conf.py
+++ b/manual/conf.py
@@ -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',