paulocoutinhox / pdfium-lib

PDFium - Project to compile PDFium library to multiple platforms.

Home Page:https://pdfviewer.github.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Clang 13 required

RalphBergmannKMB opened this issue · comments

For a few days, the Chromium developers are using -ffile-compilation-dir= instead of -fdebug-compilation-dir=, see
https://source.chromium.org/chromium/chromium/src/+/34a955823630096f5b01c2b01d51c1ea59d22763

But this -ffile-compilation-dir= was introduced with Clang 13 (https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-ffile-compilation-dir).

On my Mac with macOS 11.5.1 I have Clang 12:

clang++ --version
Apple clang version 12.0.5 (clang-1205.0.22.11)
Target: x86_64-apple-darwin20.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

I guess there is a way to update Clang without waiting for Apple to do this. Can you please update the build documentation on how to do this?

Hi,

I don't understand. This is how i see today:

image

You want change from -fdebug-compilation-dir to -ffile-compilation-dir? Like this:

image

I downloaded it again, but still have a difference.

CleanShot 2021-08-05 at 17 22 37@2x

git status show that I have this version https://chromium.googlesource.com/chromium/src/build.git/+/1ae483ee7

When I revert the changes from this commit, I can build the library.
https://source.chromium.org/chromium/chromium/src/+/34a955823630096f5b01c2b01d51c1ea59d22763:build/config/compiler/BUILD.gn;dlc=b283335cc5579f0105a4df08aca9e9b53d7b4196

Hi,

Can you add a patch to the project?

Only need add something like this:
https://github.com/paulo-coutinho/pdfium-lib/blob/master/modules/ios.py#L225-L232

My code not tested:

# clang 12
source_file = os.path.join(
    source_dir,
    "build",
    "config",
    "compiler",
    "BUILD.gn",
)
if f.file_line_has_content(source_file, 1230, '      cflags += [ "-ffile-compilation-dir=." ]\n'):
    f.replace_line_in_file(source_file, 1230, '      cflags += ["-Xclang","-fdebug-compilation-dir","-Xclang",".",]\n')

    f.debug("Applied: Clang 12")
else:
    f.debug("Skipped: Clang 12")

Put after latest patch on file "ios.py".

After you try, please, let me know if you have success.

Hi,

I made a new release with this fix:
https://github.com/paulo-coutinho/pdfium-lib/releases

Thanks.