Libraries

PDFium 라이브러리 삽질기 - 6

respiro 2019. 12. 26. 17:08


PDFium 라이브러리 삽질기 - 6

윈도우에서 사용하기 (1)

작성일자: 2019년 12월 20일

작성자: N3



1. Windows 용 PDFium DLL 빌드하기

지난 삽질에서 리눅스에서 PDFium 을 빌드하고, GDAL 에서 사용하는 방법을 대충 훑어보았다.

이제 윈도우 환경에서 PDFium 을 빌드하고, 사용하는 방법에 대한 삽질을 해보도록 한다. 플랫폼은 Windwos 10 - x64 환경이다.


PDFium 에서는 아래와 같이 친절하게 빌드 방법을 설명하고 있다.

PDFium uses the same build tool as Chromium:


1) Visual Studio 요구 사항 및 컴포넌트 설치하기


 크롬 혹은 PDFium 을 빌드하기 위해서는 Visual Studio 2017(>= 15.7.2) 또는 Visual Studio 2019 (>=16.0.0) 이상이 설치되어 있어야 한다.  Visual Studio 헤더와 라이브러리등을 이용해서 clang-cl 도 사용할 수 있다.  Comminity Edition 고 가능하다.


설치 위치는 디폴트 설치 위치를 사용해라.

그렇지 않으면, 엄청난 삽질을 하게 될 것이다.

C:\Program Files (x86)


“Desktop development with C++ (C++를 사용한 데스크톱 개발)” 과 함께 C++ 설치 요소중 다음을 함께 설치해야 한다.

vc_installer.exe ^

More?  Microsoft.VisualStudio.Workload.NativeDesktop ^

More?  Microsoft.VisualStudio.Component.VC.ATLMFC ^

More? --includeRecommended


또한, Windows 10 SDK 버전 10.0.18362 이상이 설치되어 있어야 한다. Viual Studio 설치 프로그램에서 항목을 선택해서 설치하면 된다.

이미 설치되어 있다면, 다음 항목도 추가한다.


제어판 -> 프로그램 -> 프로그램 및 기능




Debugging Tools for Windows 항목을 변경으로 추가한다.


Python2 가 PATH 경로상에 있도록 한다.

Warning: gclient doesn't yet support Python 3 and may not work correctly.


2) Depot_tools 내려받기 또는 설치하기


Windows 용 git 이 설치되어 있다고 가정한다.


삽질의 편의를 위해 Windows 도스 CMD 창을 사용하지 않고, x64 Native Tools Command Promt for VS 2019 CMD 창을 띄운다.


D:\PDF\

D:\PDF\ git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git


D:\PDF\ set PATH=D:\PDF\depot_tools;%PATH%


참고로 depot_tools 는 third_party 폴더에도 있다.

아래에서 pdfium 내려받기에서 내려받을 수 있다.


D:\PDF\ set PATH=D:\PDF\pdfium\third_party\depot_tools;%PATH%


3) pdfium 내려받기


D:\PDF\ gclient config –-unmanaged https://pdfium.googlesource.com/pdfium.git

D:\PDF\ gclient sync

Downloading CIPD client for windows-amd64 from https://chrome-infra-packages.appspot.com/client?platform=windows-amd64&version=git_revision:9f9afb5ef6ef9d4887e8aa2bb617dfdd798f8005...



그런데, gclient sync 가 네트워크 리소스를 엄청 먹어치우는 것같은 느낌적인 느낌이 든다.


________ running 'vpython.bat pdfium/build/vs_toolchain.py update --force' in 'D:\PDF'




No downloadable toolchain found. In order to use your locally installed version of Visual Studio to build Chrome please set DEPOT_TOOLS_WIN_TOOLCHAIN=0.

For details search for DEPOT_TOOLS_WIN_TOOLCHAIN in the instructions at https://chromium.googlesource.com/chromium/src/+/master/docs/windows_build_instructions.md


DEPOT_TOOLS_WIN_TOOLCHAING=0 을 설정하라고 한다.

D:\PDF\ set DEPOT_TOOLS_WIN_TOOLCHAING=0

D:\PDF\ gclient sync



Syncing projects: 100% (26/26), done.

Running hooks:  31% ( 5/16) clang_format_mac

________ running 'download_from_google_storage --no_resume --platform=darwin --no_auth --bucket chromium-clang-format -s pdfium/buildtools/mac/clang-format.sha1' in 'D:\PDF'

The current platform doesn't match "darwin", skipping.

Running hooks:  37% ( 6/16) clang_format_linux

________ running 'download_from_google_storage --no_resume --platform=linux* --no_auth --bucket chromium-clang-format -s pdfium/buildtools/linux64/clang-format.sha1' in 'D:\PDF'

The current platform doesn't match "linux*", skipping.

Running hooks:  43% ( 7/16) clang

________ running 'vpython.bat pdfium/tools/clang/scripts/update.py' in 'D:\PDF'

Downloading https://commondatastorage.googleapis.com/chromium-browser-clang/Win/clang-n332890-c2443155-1.tgz .......... Done.

Traceback (most recent call last):

  File "pdfium/tools/clang/scripts/update.py", line 381, in <module>

    sys.exit(main())

  File "pdfium/tools/clang/scripts/update.py", line 377, in main

    return UpdatePackage(args.package)

  File "pdfium/tools/clang/scripts/update.py", line 311, in UpdatePackage

    CopyDiaDllTo(os.path.join(LLVM_BUILD_DIR, 'bin'))

  File "pdfium/tools/clang/scripts/update.py", line 247, in CopyDiaDllTo

    GetWinSDKDir()

  File "pdfium/tools/clang/scripts/update.py", line 221, in GetWinSDKDir

    win_sdk_dir = vs_toolchain.SetEnvironmentAndGetSDKDir()

  File "D:\PDF\pdfium\build\vs_toolchain.py", line 536, in SetEnvironmentAndGetSDKDir

    SetEnvironmentAndGetRuntimeDllDirs()

  File "D:\PDF\pdfium\build\vs_toolchain.py", line 94, in SetEnvironmentAndGetRuntimeDllDirs

    os.environ['GYP_MSVS_OVERRIDE_PATH'] = DetectVisualStudioPath()

  File "D:\PDF\pdfium\build\vs_toolchain.py", line 183, in DetectVisualStudioPath

    version_as_year = GetVisualStudioVersion()

  File "D:\PDF\pdfium\build\vs_toolchain.py", line 173, in GetVisualStudioVersion

    ' Supported versions are: %s.' % supported_versions_str)

Exception: No supported Visual Studio can be found. Supported versions are: 16.0 (2019), 15.0 (2017).

Error: Command 'vpython.bat pdfium/tools/clang/scripts/update.py' returned non-zero exit status 1 in D:\PDF

Hook 'vpython.bat pdfium/tools/clang/scripts/update.py' took 25.66 secs


Visual Studio 툴체인 폴더를 찾지 못하고 있다.  GYP_MSVS_OVERRIDE_PATH 라는 환경변수가 있다.


D:\PDF\pdfium\ python build/vs_toolchain.py get_toolchain_dir


먼저, 소스를 살펴보자.

파이썬 소스를 추적해보자.

# VS versions are listed in descending order of priority (highest first).

MSVS_VERSIONS = collections.OrderedDict([

  ('2019', '16.0'),

  ('2017', '15.0'),

])


# List of preferred VC toolset version based on MSVS

MSVC_TOOLSET_VERSION = {

   '2019' : 'VC142',

   '2017' : 'VC141',

}


def GetToolchainDir():

  """Gets location information about the current toolchain (must have been

  previously updated by 'update'). This is used for the GN build."""

  runtime_dll_dirs = SetEnvironmentAndGetRuntimeDllDirs()

  win_sdk_dir = SetEnvironmentAndGetSDKDir()


  print('''vs_path = %s

sdk_path = %s

vs_version = %s

wdk_dir = %s

runtime_dirs = %s

''' % (ToGNString(NormalizePath(os.environ['GYP_MSVS_OVERRIDE_PATH'])),

       ToGNString(win_sdk_dir), ToGNString(GetVisualStudioVersion()),

       ToGNString(NormalizePath(os.environ.get('WDK_DIR', ''))),

       ToGNString(os.path.pathsep.join(runtime_dll_dirs or ['None']))))


def GetVisualStudioVersion():

  """Return best available version of Visual Studio.

  """


  env_version = os.environ.get('GYP_MSVS_VERSION')

  if env_version:

    return env_version


  supported_versions = MSVS_VERSIONS.keys()


  # VS installed in depot_tools for Googlers

  if bool(int(os.environ.get('DEPOT_TOOLS_WIN_TOOLCHAIN', '1'))):

    return supported_versions[0]


  # VS installed in system for external developers

  supported_versions_str = ', '.join('{} ({})'.format(v,k)

      for k,v in MSVS_VERSIONS.items())

  available_versions = []

  for version in supported_versions:

    for path in (

        os.environ.get('vs%s_install' % version),

        os.path.expandvars('%ProgramFiles(x86)%' +

                           '/Microsoft Visual Studio/%s' % version)):

      if path and any(os.path.exists(os.path.join(path, edition)) for edition in

          ('Enterprise', 'Professional', 'Community', 'Preview')):

        available_versions.append(version)

        break


  if not available_versions:

    raise Exception('No supported Visual Studio can be found.'

                    ' Supported versions are: %s.' % supported_versions_str)

  return available_versions[0]



Visual Studio 2017과 2019의 설치폴더를 환경변수와 하드코딩된 경로로 찾고 있다.

set 으로 설정된 환경변수에서 vs2019_install vs_2017_install  같은 변수는 없으며, 아래와 같은 디폴트 경로를 찾고 있다.


vs%s_install'    <== %s 에는  GYP_MSVS_VERSION

C:\Program Files (x86)/Microsoft Visual Studio/2019

C:\Program Files (x86)/Microsoft Visual Studio/2017


하드링크 경로를 수정하거나, set 으로 환경변수를 만들어주자.

Visual Studio 설치시에 디폴트 경로로 깔지 않아서 삽질은 계속된다.


## 체크 코드를 회피한다.

D:\PDF\pdfium\ set GYP_MSVS_VERSION=2019

D:\PDF\pdfium\ set GYP_MSVS_OVERRIDE_PATH = "D:/Microsoft/Microsoft Visual Studio/2019/Community"


## 또는  코드를 수정해주자.

Line: 164


  for version in supported_versions:

    for path in (

        os.environ.get('vs%s_install' % version),

  os.path.expandvars('D:/Microsoft/Microsoft/Microsoft Visual Studio/%s' % version),

        os.path.expandvars('%ProgramFiles(x86)%' +

                           '/Microsoft Visual Studio/%s' % version)):

      if path and any(os.path.exists(os.path.join(path, edition)) for edition in

          ('Enterprise', 'Professional', 'Community', 'Preview')):

        available_versions.append(version)

        break


하드 코딩된 곳이 또 있다.

Line: 192


def DetectVisualStudioPath():

  """Return path to the GYP_MSVS_VERSION of Visual Studio.

  """


  # Note that this code is used from

  # build/toolchain/win/setup_toolchain.py as well.

  version_as_year = GetVisualStudioVersion()


  # The VC++ >=2017 install location needs to be located using COM instead of

  # the registry. For details see:

  # https://blogs.msdn.microsoft.com/heaths/2016/09/15/changes-to-visual-studio-15-setup/

  # For now we use a hardcoded default with an environment variable override.

  for path in (

      os.environ.get('vs%s_install' % version_as_year),

      os.path.expandvars('D:/Microsoft/Microsoft Visual Studio/%s/Community' % version_as_year),

      os.path.expandvars('%ProgramFiles(x86)%' +

                         '/Microsoft Visual Studio/%s/Enterprise' %

                         version_as_year),

      os.path.expandvars('%ProgramFiles(x86)%' +

                         '/Microsoft Visual Studio/%s/Professional' %

                         version_as_year),

      os.path.expandvars('%ProgramFiles(x86)%' +

                         '/Microsoft Visual Studio/%s/Community' %

                         version_as_year),


      os.path.expandvars('%ProgramFiles(x86)%' +

                         '/Microsoft Visual Studio/%s/Preview' %

                         version_as_year)):

    if path and os.path.exists(path):

      return path


  raise Exception('Visual Studio Version %s (from GYP_MSVS_VERSION)'

                  ' not found.' % version_as_year)



소스를 좀 더 살펴서 테스트해보면,


D:\PDF\pdfium>python build\vs_toolchain.py get_toolchain_dir


vs_path = "\"D:\\\\Microsoft\\Microsoft Visual Studio\\2019\\Community\""

sdk_path = "C:\\Program Files (x86)\\Windows Kits\\10"

vs_version = "2019"

wdk_dir = ""

runtime_dirs = "C:\\WINDOWS\\System32;C:\\WINDOWS\\SysWOW64;Arm64Unused"


D:\PDF\pdfium>gn gen out/Default

...

Exception: "D:\Microsoft\Microsoft Visual Studio\2019\Community"\VC\vcvarsall.bat is missing - make sure VC++ tools are installed.


VC 컴파일을 위한 환경 변수 파일을 찾지 못한다.

위와 같이 경로가 2017 이전 버전의 위치다.


아래와 같이 폴더의 위치가 변경되었다.

D:\Microsoft\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build


D:\PDF\pdfium\build\toolchain\win\setup_toolchain.py 파일에 아래와 같이 찾는다.

def _LoadToolchainEnv(cpu, sdk_dir, target_store):

...


  else:

    if 'GYP_MSVS_OVERRIDE_PATH' not in os.environ:

      os.environ['GYP_MSVS_OVERRIDE_PATH'] = _DetectVisualStudioPath()

    # We only support x64-hosted tools.

    script_path = os.path.normpath(os.path.join(

                                       os.environ['GYP_MSVS_OVERRIDE_PATH'],

                                       'VC/vcvarsall.bat'))

    if not os.path.exists(script_path):

      # vcvarsall.bat for VS 2017 fails if run after running vcvarsall.bat from

      # VS 2013 or VS 2015. Fix this by clearing the vsinstalldir environment

      # variable.

      if 'VSINSTALLDIR' in os.environ:

        del os.environ['VSINSTALLDIR']

      other_path = os.path.normpath(os.path.join(

                                        os.environ['GYP_MSVS_OVERRIDE_PATH'],

                                        'VC/Auxiliary/Build/vcvarsall.bat'))

      if not os.path.exists(other_path):

        raise Exception('%s is missing - make sure VC++ tools are installed.' %

                        script_path)

      script_path = other_path

      cpu_arg = "amd64"


다시 내려받는다.

D:\PDF\ gclient sync

Syncing projects:  90% ( 9/10) pdfium\testing\corpus


pdfium\build (ERROR)

----------------------------------------

[0:00:00] Started.

[0:00:00] Finished running: git config remote.origin.url

[0:00:00] Finished running: git rev-list -n 1 HEAD

[0:00:01] Finished running: git rev-parse --abbrev-ref=strict HEAD

[0:00:01] Finished running: git rev-parse 4f02786eeacbf857df1397059572c11fa42bfed7

----------------------------------------

Error: 3>

3> ____ pdfium\build at 4f02786eeacbf857df1397059572c11fa42bfed7

3>      You have unstaged changes.

3>      Please commit, stash, or reset.


소스를 변경했더니, 소스가 변경되었다고 투정부린다. 


짜증나기 시작한다.


디폴트 폴더에 정션 또는 링크를 걸어주자. 변경된 소스를 원위치하고 다시 내려받기 위해 --force 옵션을 준다.

C:\Program Files (x86)\Microsoft Visual Studio>mklink /j 2019 "D:\Microsoft\Microsoft Visual Studio\2019"

2019 <<===>> D:\Microsoft\Microsoft Visual Studio\2019에 대한 교차점을 만들었습니다.


D:\PDF\ gclient sync --force

Syncing projects: 100% (26/26), done.

Running hooks:  31% ( 5/16) clang_format_mac

________ running 'download_from_google_storage --no_resume --platform=darwin --no_auth --bucket chromium-clang-format -s pdfium/buildtools/mac/clang-format.sha1' in 'D:\PDF'

The current platform doesn't match "darwin", skipping.

Running hooks:  37% ( 6/16) clang_format_linux

________ running 'download_from_google_storage --no_resume --platform=linux* --no_auth --bucket chromium-clang-format -s pdfium/buildtools/linux64/clang-format.sha1' in 'D:\PDF'

The current platform doesn't match "linux*", skipping.

Running hooks:  43% ( 7/16) clang

________ running 'vpython.bat pdfium/tools/clang/scripts/update.py' in 'D:\PDF'

Downloading https://commondatastorage.googleapis.com/chromium-browser-clang/Win/clang-n332890-c2443155-1.tgz .......... Done.

Copying C:\Program Files (x86)/Microsoft Visual Studio/2019/Community\DIA SDK\bin\amd64\msdia140.dll to D:\PDF\pdfium\third_party\llvm-build\Release+Asserts\bin

Hook 'vpython.bat pdfium/tools/clang/scripts/update.py' took 27.03 secs

Running hooks: 100% (16/16), done.

4) 정적 라이브러리 빌드하기

테스트를 위해 기본 옵션만 켜서 테스트한다.


args.gn

is_official_build       = true

pdf_is_standalone    = true

is_component_build = false

pdf_is_complete_lib = true


is_debug = false

is_clang = false


pdf_enable_v8 = false

pdf_enable_xfa = false


pdf_use_win32_gdi = true


args.gn  파일을 out/Default  폴더에 복사한다.

D:\PDF\pdfium\ gn gen out/Default

Done. Made 141 targets from 79 files in 17057ms


D:\PDF\pdfium\ ninja -C out/Default

[12/1501] COPY ../../third_party/icu/common/icudtl.dat icudtl.dat

FAILED: icudtl.dat

D:/PDF/pdfium/third_party/depot_tools/bootstrap-3_8_0_chromium_8_bin/python/bin/python.exe ../../build/toolchain/win/tool_wrapper.py recursive-mirror ../../third_party/icu/common/icudtl.dat icudtl.dat

Traceback (most recent call last):

  File "../../build/toolchain/win/tool_wrapper.py", line 51, in <module>

    import win32file    # pylint: disable=import-error

ImportError: No module named win32file

...

...

ninja: build stopped: subcommand failed.


파이썬 모듈을 설치하고 다시 해보자.

D:\PDF\pdfium\ python -m pip install pywin32

DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support

Collecting pywin32

  Downloading https://files.pythonhosted.org/packages/a2/e6/6b395ea8bc9500158adea646e28077adb7f3d9587c681fd5d03693a4b5dc/pywin32-227-cp27-cp27m-win_amd64.whl (7.4MB)

     |################################| 7.4MB 538kB/s

Installing collected packages: pywin32


Successfully installed pywin32-227


다시 빌드한다.

D:\PDF\pdfium\ ninja -C out/Default

...

참고: 포함 파일: D:\PDF\pdfium\third_party\yasm\source\patched-yasm\modules\preprocs\nasm\nasmlib.h

참고: 포함 파일: D:\PDF\pdfium\third_party\yasm\source\patched-yasm\modules\preprocs\nasm\nasm-pp.h

[1398/1482] LINK yasm.exe yasm.exe.pdb

LINK : /LTCG를 지정했지만 코드를 생성할 필요가 없습니다. 명령줄에서 /LTCG를 제거하면 링커 성능이 향상됩니다.


[1408/1482] LINK zlib_bench.exe zlib_bench.exe.pdb

코드를 생성하고 있습니다.


코드를 생성했습니다.


[1476/1482] LINK pdfium_test.exe pdfium_test.exe.pdb

LINK : /LTCG를 지정했지만 코드를 생성할 필요가 없습니다. 명령줄에서 /LTCG를 제거하면 링커 성능이 향상됩니다.


[1479/1482] LINK pdfium_diff.exe pdfium_diff.exe.pdb

LINK : /LTCG를 지정했지만 코드를 생성할 필요가 없습니다. 명령줄에서 /LTCG를 제거하면 링커 성능이 향상됩니다.


[1480/1482] LINK pdfium_embeddertests.exe pdfium_embeddertests.exe.pdb

LINK : /LTCG를 지정했지만 코드를 생성할 필요가 없습니다. 명령줄에서 /LTCG를 제거하면 링커 성능이 향상됩니다.


[1481/1482] LINK pdfium_unittests.exe pdfium_unittests.exe.pdb

LINK : /LTCG를 지정했지만 코드를 생성할 필요가 없습니다. 명령줄에서 /LTCG를 제거하면 링커 성능이 향상됩니다.


[1482/1482] STAMP obj/pdfium_all.stamp


out/Default/obj  폴더에 pdfium.lib Static Library 를 생성한 것을 볼 수 있다.


out/Default  폴더에는 테스트 프로그램들이 생성되어있다

D:\PDF\pdfium\out\Default>pdfium_embeddertests.exe

...

[----------] Global test environment tear-down

[==========] 489 tests from 40 test suites ran. (110955 ms total)

[  PASSED  ] 476 tests.

[  FAILED  ] 13 tests, listed below:

[  FAILED  ] FPDFAnnotEmbedderTest.BUG_1206

[  FAILED  ] FPDFJavaScriptEmbedderTest.GetJSScript

[  FAILED  ] FPDFPPOEmbedderTest.BadRepeatViewerPref

[  FAILED  ] FPDFPPOEmbedderTest.BadCircularViewerPref

[  FAILED  ] FPDFSaveEmbedderTest.SaveSimpleDoc

[  FAILED  ] FPDFSaveEmbedderTest.SaveSimpleDocWithVersion

[  FAILED  ] FPDFThumbnailEmbedderTest.GetDecodedThumbnailDataFromPageWithNoFilters

[  FAILED  ] FPDFThumbnailEmbedderTest.GetRawThumbnailDataFromPageWithFilters

[  FAILED  ] FPDFThumbnailEmbedderTest.GetRawThumbnailDataFromPageWithNoFilters

[  FAILED  ] FPDFThumbnailEmbedderTest.GetThumbnailDoesNotAlterPage

[  FAILED  ] FPDFViewEmbedderTest.Failed_213

[  FAILED  ] FPDFViewEmbedderTest.DocumentHasValidCrossReferenceTable

[  FAILED  ] FPDFViewEmbedderTest.LoadDocumentWithEmptyXRefConsistently


13 FAILED TESTS

  YOU HAVE 1 DISABLED TEST


리눅스와 다르게 13개나 실패가 생겼다.

D:\PDF\pdfium\out\Default>pdfium_unittests.exe

...

[----------] Global test environment tear-down

[==========] 635 tests from 86 test suites ran. (3894 ms total)

[  PASSED  ] 631 tests.

[  FAILED  ] 4 tests, listed below:

[  FAILED  ] CPDF_CIDFontTest.BUG_920636

[  FAILED  ] cpdf_parser.RebuildCrossRefCorrectly

[  FAILED  ] WideString.ToDefANSI

[  FAILED  ] WideString.FromDefANSI


 4 FAILED TESTS

  YOU HAVE 3 DISABLED TESTS


Unit Test 도 4개가 실패다.

5) 동적 라이브러리 빌드하기

args.gn

is_official_build       = true

pdf_is_standalone    = true

is_component_build = true

pdf_is_complete_lib = false


is_debug = false

is_clang = false


pdf_enable_v8 = false

pdf_enable_xfa = false


pdf_use_win32_gdi = true


out/Dynamic 폴더로 복사하고 빌드한다.


D:\PDF\pdfium\ ninja -C out/Dynamic

ninja: Entering directory `out/Dynamic'

[1/311] LINK(DLL) icuuc.dll icuuc.dll.lib icuuc.dll.pdb

FAILED: icuuc.dll icuuc.dll.lib icuuc.dll.pdb

D:/PDF/pdfium/third_party/depot_tools/bootstrap-3_8_0_chromium_8_bin/python/bin/python.exe ../../build/toolchain/win/tool_wrapper.py link-wrapper environment.x64 False link.exe /nologo /IMPLIB:./icuuc.dll.lib /DLL /OUT:./icuuc.dll /PDB:./icuuc.dll.pdb @./icuuc.dll.rsp

LINK : warning LNK4075: '/INCREMENTAL'이(가) '/LTCG' 사양으로 인해 무시됩니다.

....

LINK : error LNK1218: 경고가 오류로 처리됩니다. 출력 파일이 생성되지 않습니다.

참고: 포함 파일:  D:\PDF\pdfium\third_party\libjpeg_turbo\jchuff.h

참고: 포함 파일: D:\PDF\pdfium\third_party\libjpeg_turbo\jconfigint.h

참고: 포함 파일: D:\PDF\pdfium\third_party\libjpeg_turbo\jpeg_nbits_table.h

ninja: build stopped: subcommand failed.


최적화 옵션을 제거한다.

is_official_build       = false


다시 빌드한다.

D:\PDF\pdfium\ ninja -C out/Dynamic

...

참고: 포함 파일: D:\PDF\pdfium\third_party\yasm\source\patched-yasm\modules/parsers/gas/gas-parser.h

참고: 포함 파일: D:\PDF\pdfium\third_party\yasm\source\patched-yasm\modules/parsers/nasm/nasm-parser-struct.h

[1487/1510] LINK pdfium_test.exe pdfium_test.exe.pdb

   .\pdfium_test.lib 라이브러리 및 .\pdfium_test.exp 개체를 생성하고 있습니다.


[1490/1510] LINK(DLL) pdfium.dll pdfium.dll.lib pdfium.dll.pdb

   ./pdfium.dll.lib 라이브러리 및 ./pdfium.dll.exp 개체를 생성하고 있습니다.


[1497/1510] LINK pdfium_embeddertests.exe pdfium_embeddertests.exe.pdb

   .\pdfium_embeddertests.lib 라이브러리 및 .\pdfium_embeddertests.exp 개체를 생성하고 있습니다.


[1509/1510] LINK pdfium_unittests.exe pdfium_unittests.exe.pdb

   .\pdfium_unittests.lib 라이브러리 및 .\pdfium_unittests.exp 개체를 생성하고 있습니다.


[1510/1510] STAMP obj/pdfium_all.stamp


out/Dynamic 폴더에 pdfium.dll 이 생성된 것을 확인할 수 있다.



테스트 프로그램을 실행해 본다.

Static 과 마찬가지의 오류를 갖고 있다.


DLL Export Viewer 로 Export 된 함수를 보면 아래와 같은 함수들을 볼 수 있다.