Skip to content

Commit

Permalink
Back to shared_library
Browse files Browse the repository at this point in the history
  • Loading branch information
bblanchon committed May 11, 2019
1 parent 7e499c8 commit 298f21e
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 21 deletions.
4 changes: 2 additions & 2 deletions args/darwin.args.gn
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Enable component build
is_component_build = true
# Disable component build
is_component_build = false

# Build PDFium either with or without v8 support (default = true)
pdf_enable_v8 = false
Expand Down
4 changes: 2 additions & 2 deletions args/linux.args.gn
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Enable component build
is_component_build = true
# Disable component build
is_component_build = false

# Build PDFium either with or without v8 support (default = true)
pdf_enable_v8 = false
Expand Down
4 changes: 2 additions & 2 deletions args/windows.args.gn
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Enable component build
is_component_build = true
# Disable component build
is_component_build = false

# Build PDFium standalone (default = false)
pdf_is_standalone = true
Expand Down
2 changes: 1 addition & 1 deletion build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ git.exe checkout %PDFium_BRANCH% && call gclient sync
: Patch
cd %PDFium_SOURCE_DIR%
copy "%PDFium_PATCH_DIR%\resources.rc" . || exit /b
git.exe apply -v "%PDFium_PATCH_DIR%\resources.patch" || exit /b
git.exe apply -v "%PDFium_PATCH_DIR%\shared_library.patch" || exit /b
git.exe apply -v "%PDFium_PATCH_DIR%\relative_includes.patch" || exit /b
git.exe -C build apply -v "%PDFium_PATCH_DIR%\rc_compiler.patch" || exit /b

Expand Down
1 change: 1 addition & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ gclient sync

# Patch
cd "$PDFium_SOURCE_DIR"
git apply -v "$PDFium_PATCH_DIR/shared_library.patch"
git apply -v "$PDFium_PATCH_DIR/relative_includes.patch"
#git apply -v "$PDFium_PATCH_DIR/static_libstdcxx.patch"

Expand Down
14 changes: 0 additions & 14 deletions patches/resources.patch

This file was deleted.

47 changes: 47 additions & 0 deletions patches/shared_library.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
diff --git a/BUILD.gn b/BUILD.gn
index 97dfbd6ad..0dc75a6ee 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -129,7 +129,7 @@ jumbo_source_set("pdfium_public_headers") {
public_configs = [ ":pdfium_public_config" ]
}

-jumbo_component("pdfium") {
+shared_library("pdfium") {
sources = [
"fpdfsdk/fpdf_annot.cpp",
"fpdfsdk/fpdf_attachment.cpp",
@@ -201,6 +201,9 @@ jumbo_component("pdfium") {
"gdi32.lib",
"user32.lib",
]
+ sources += [
+ "resources.rc"
+ ]
}

if (is_mac) {
diff --git a/public/fpdfview.h b/public/fpdfview.h
index f5212599f..c337399a9 100644
--- a/public/fpdfview.h
+++ b/public/fpdfview.h
@@ -154,9 +154,6 @@ typedef int FPDF_ANNOT_APPEARANCEMODE;
// Dictionary value types.
typedef int FPDF_OBJECT_TYPE;

-#if defined(COMPONENT_BUILD)
-// FPDF_EXPORT should be consistent with |export| in the pdfium_fuzzer
-// template in testing/fuzzers/BUILD.gn.
#if defined(WIN32)
#if defined(FPDF_IMPLEMENTATION)
#define FPDF_EXPORT __declspec(dllexport)
@@ -170,9 +167,6 @@ typedef int FPDF_OBJECT_TYPE;
#define FPDF_EXPORT
#endif // defined(FPDF_IMPLEMENTATION)
#endif // defined(WIN32)
-#else
-#define FPDF_EXPORT
-#endif // defined(COMPONENT_BUILD)

#if defined(WIN32) && defined(FPDFSDK_EXPORTS)
#define FPDF_CALLCONV __stdcall

0 comments on commit 298f21e

Please sign in to comment.