Enabling C++14 in PDFium by default?

146 views
Skip to first unread message

Lei Zhang

unread,
Oct 17, 2019, 11:22:07 PM10/17/19
to pdfium
Hi folks,

As you may know, PDFium currently runs the compiler in C++11 mode by
default. PDFium borrows a lot of build infrastructure from Chromium,
and Chromium has had C++14 enabled by default for a while. Many PDFium
developers are also Chromium developers, so it would be nice for
PDFium developers if the requirements for the two projects can stay in
sync.

Recently, V8, used for interpreting JS from PDFs, has also started
using C++14 features in a way where PDFium cannot be built with the
latest versions of V8. Given this situation, I would like to switch
PDFium to C++14 by default, so PDFium can stay in sync with the
version of V8 used in Chromium.

To help ease the transition, PDFium will continue to support C++11
mode when JS is turned off for some amount of time, say, 6 months.
After which, we will default to C++14 required everywhere, and PDFium
developers will start using C++14 features in the library.

I would like to hear your thoughts on this.

Miklos Vajna

unread,
Oct 18, 2019, 3:21:41 AM10/18/19
to Lei Zhang, pdfium
Hi Lei,

On Thu, Oct 17, 2019 at 08:21:54PM -0700, Lei Zhang <the...@chromium.org> wrote:
> I would like to hear your thoughts on this.

No problem with this on our side (LibreOffice).

Regards,

Miklos
signature.asc

Phil Richards

unread,
Oct 18, 2019, 3:54:22 PM10/18/19
to pdfium
No problems here. We build with a modern compiler.

Thanks

Lei Zhang

unread,
Oct 23, 2019, 9:12:38 PM10/23/19
to pdfium
Thanks for the feedback so far. I've filed
https://crbug.com/pdfium/1407 to keep track of the work for this. I'll
start work on this transition soon, and will keep everyone updated on
this thread when actions are required.

Lei Zhang

unread,
Nov 6, 2019, 8:02:52 PM11/6/19
to pdfium
Hi everyone,

Just to give you an update on what's happening with this transition.

[CL1] updates the documentation to explain what GN build flag needs to
be set once [CL2] lands. [CL1] will be committed shortly. Either
follow the instructions, or just wait. (See below)

[CL2] will start to require C++14 for build configs that use V8 or
XFA. I plan on committing [CL2] in about a week. If you sync to [CL2],
then please follow the instructions in [CL1].

Otherwise, wait for [CL3] to be committed to flip the default build
configuration to C++14. I think if you wait and sync straight to
[CL3], then no GN build flag changes are necessary and everything
should just work.

Of course, keep in mind [CL2] only affects those who are using V8, and
[CL3] only affects those who are using GN and Ninja to build PDFium.
If your PDFium usage is affected by this, and you use your own build
system, please adjust your build system accordingly.

As always, if you have questions or concerns, please let me know.

[CL1] https://pdfium-review.googlesource.com/c/pdfium/+/61930
[CL2] https://pdfium-review.googlesource.com/c/pdfium/+/61931
[CL3] https://pdfium-review.googlesource.com/c/pdfium/+/61936

Lei Zhang

unread,
Nov 13, 2019, 11:01:17 AM11/13/19
to pdfium
[CL2] and [CL3] have landed. Assuming everything goes well, PDFium
will completely default to C++14 in ~6 months.

Lei Zhang

unread,
Apr 3, 2020, 3:07:55 PM4/3/20
to pdfium
As a reminder, PDFium plans to require C++14 compiler in ~6 weeks.
After that, PDFium developers will start using C++14 library features
in PDFium internals.

Lei Zhang

unread,
Apr 29, 2020, 12:57:10 PM4/29/20
to pdfium
(Last reminder) PDFium will require C++14 in 2 weeks.

Lei Zhang

unread,
May 15, 2020, 5:23:02 PM5/15/20
to pdfium
Starting with [CL4], PDFium now requires C++14.

Looking forward, Chromium is evaluating C++17 support in [ISSUE1], so it is very likely PDFium will transition to C++17 at some point in the future.

Reply all
Reply to author
Forward
0 new messages