-
Notifications
You must be signed in to change notification settings - Fork 198
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
183 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Disable component build (must be false) | ||
is_component_build = false | ||
|
||
# Build PDFium either with or without v8 support (default = true) | ||
pdf_enable_v8 = false | ||
|
||
# Build PDFium standalone (default = false) | ||
pdf_is_standalone = true | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
cmake_minimum_required(VERSION 2.8) | ||
project(example) | ||
enable_testing() | ||
|
||
find_package(PDFium REQUIRED) | ||
|
||
add_executable(example example.c) | ||
target_link_libraries(example pdfium) | ||
|
||
# Optional: copy library alongside with the excecutable | ||
add_custom_command( | ||
TARGET example POST_BUILD | ||
COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_FILE:pdfium> $<TARGET_FILE_DIR:example>) | ||
|
||
add_test(example example) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#include <fpdfview.h> | ||
|
||
int main() | ||
{ | ||
FPDF_InitLibrary(); | ||
|
||
FPDF_DestroyLibrary(); | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
diff --git a/public/cpp/fpdf_deleters.h b/public/cpp/fpdf_deleters.h | ||
index 238ef30e6..720074222 100644 | ||
--- a/public/cpp/fpdf_deleters.h | ||
+++ b/public/cpp/fpdf_deleters.h | ||
@@ -5,12 +5,12 @@ | ||
#ifndef PUBLIC_CPP_FPDF_DELETERS_H_ | ||
#define PUBLIC_CPP_FPDF_DELETERS_H_ | ||
|
||
-#include "public/fpdf_dataavail.h" | ||
-#include "public/fpdf_edit.h" | ||
-#include "public/fpdf_formfill.h" | ||
-#include "public/fpdf_structtree.h" | ||
-#include "public/fpdf_text.h" | ||
-#include "public/fpdfview.h" | ||
+#include "../fpdf_dataavail.h" | ||
+#include "../fpdf_edit.h" | ||
+#include "../fpdf_formfill.h" | ||
+#include "../fpdf_structtree.h" | ||
+#include "../fpdf_text.h" | ||
+#include "../fpdfview.h" | ||
|
||
// Custom deleters for using FPDF_* types with std::unique_ptr<>. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
diff --git a/BUILD.gn b/BUILD.gn | ||
index b4b93b584..d57bb555d 100644 | ||
--- a/BUILD.gn | ||
+++ b/BUILD.gn | ||
@@ -23,6 +23,7 @@ config("pdfium_common_config") { | ||
"OPJ_STATIC", | ||
"PNG_PREFIX", | ||
"PNG_USE_READ_MACROS", | ||
+ "FPDFSDK_EXPORTS" | ||
] | ||
|
||
if (pdf_use_skia) { | ||
@@ -100,7 +101,7 @@ config("xfa_warnings") { | ||
} | ||
} | ||
|
||
-static_library("pdfium") { | ||
+shared_library("pdfium") { | ||
sources = [ | ||
"fpdfsdk/cba_annotiterator.cpp", | ||
"fpdfsdk/cba_annotiterator.h", | ||
diff --git a/public/fpdfview.h b/public/fpdfview.h | ||
index 135d00a8f..89c89ed9c 100644 | ||
--- a/public/fpdfview.h | ||
+++ b/public/fpdfview.h | ||
@@ -142,13 +142,22 @@ typedef int FPDF_ANNOTATION_SUBTYPE; | ||
// Dictionary value types. | ||
typedef int FPDF_OBJECT_TYPE; | ||
|
||
-#if defined(_WIN32) && defined(FPDFSDK_EXPORTS) | ||
-// On Windows system, functions are exported in a DLL | ||
-#define FPDF_EXPORT __declspec(dllexport) | ||
-#define FPDF_CALLCONV __stdcall | ||
+#ifdef FPDFSDK_EXPORTS | ||
+# if defined(_WIN32) | ||
+# define FPDF_EXPORT __declspec(dllexport) | ||
+# define FPDF_CALLCONV __stdcall | ||
+# else | ||
+# define FPDF_EXPORT __attribute__((visibility("default"))) | ||
+# define FPDF_CALLCONV | ||
+# endif | ||
#else | ||
-#define FPDF_EXPORT | ||
-#define FPDF_CALLCONV | ||
+# if defined(_WIN32) | ||
+# define FPDF_EXPORT __declspec(dllimport) | ||
+# define FPDF_CALLCONV __stdcall | ||
+# else | ||
+# define FPDF_EXPORT | ||
+# define FPDF_CALLCONV | ||
+# endif | ||
#endif | ||
|
||
// Exported Functions |
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
set SOURCE_DIR=%CD%\example | ||
set PDFium_DIR=%CD%\staging | ||
set CMAKE_GENERATOR=Visual Studio 15 2017 | ||
|
||
if "%PLATFORM%"=="x64" set CMAKE_GENERATOR=%CMAKE_GENERATOR% Win64 | ||
|
||
@echo on | ||
|
||
mkdir build | ||
cd build | ||
cmake -G "%CMAKE_GENERATOR%" "%SOURCE_DIR%" | ||
cmake --build . | ||
ctest --output-on-failure . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -eux | ||
|
||
export SOURCE_DIR="$PWD/example" | ||
export PDFium_DIR="$PWD/staging" | ||
|
||
mkdir build | ||
cd build | ||
cmake "$SOURCE_DIR" | ||
cmake --build . | ||
ctest --output-on-failure . |