DrDoom
DrDoom

Reputation: 1

PFDium Build with Ninja and GN under Windows OS

I have a problem compiling PDFium. The goal is to create an unmanaged PDFium.dll from the current sources. I have already started a wrapper for C# which works so far. However, with a foreign pdfium.dll which I do not want to use productively for security reasons.

But about the problem: I followed the “Building PDFium” instructions from pdfium.googlesource.com and

  1. Git installed
  2. Install Ninja (winget install Ninja-build.Ninja)
  3. Install Python (winget install -e --id Python.Python.3.12), although Python should be included in the depot tools
  4. Depot_tools installed (git clone https://chromium.googlesource.com/chromium/tools/depot_tools)
  5. Depot_tools -> Loaded the sources (gclient told me that “.” is invalid as a relative name, so I continued with “gclient config --name pdfium”)
  6. .gclient file checked (solutions -> 'pdfium' is included)
  7. PDFium subdirectory checked, all files and folders are actually there The next step should then be “Generate the build files”. So I adapted the \pdfium\args.gn file and added the necessary parameters.

Now the build process should follow. So I went to the \pdfium\ directory and ran "ninja -C "%CD%" pdfium_test".

Error: ninja: error: loading 'build.ninja': GetLastError() = 2

I also get the same message from the autoninja.bat of the depot tools. After some research and reading, I suspect that I need to create the build.ninja with gn.exe first. But how? I can't find any information here and the gn.exe under "\pdfium\buildtools\win\gn.exe" has so many parameters that I don't understand.

The gn.bat of the depot_tools (which calls gn.py) tells me… Error: ERROR No command specified. Most commonly you want "gn gen <out_dir>" to make a build dir.

Checked that the included Python3 (bat+exe) is found, that Ninja is found, files and directories checked.

Upvotes: 0

Views: 111

Answers (0)

Related Questions