diff options
author | Michal Klocek <michal.klocek@qt.io> | 2018-07-18 11:06:14 +0200 |
---|---|---|
committer | Michal Klocek <michal.klocek@qt.io> | 2019-11-25 12:59:53 +0100 |
commit | 883f2a9969f02941f018b828749fea97d8b56582 (patch) | |
tree | 590c346b5b397ea5b10ecd0cf480f0691e4c8346 /src/pdf/pdfcore.pro | |
parent | 71663751e74c814e516e22d8a5e5532381e015e6 (diff) |
Add QtPdf and QtPdfWidgets modules
This change adds two new modules to qtwebengine repository.
New modules do not depend on webengine module, however webengine
chromium source code and Chromium "gn" configuration is
required to build QtPdf.
Adding two unrelated modules to webengine might look crazy:
however sharing gn build configuration and Chromium code base
with necessary qt adaptations simplifies code maintenance and
minimises required code checkouts. Back porting of security
patches for Chromium also affects Pdfium. Moreover, Pdfium is no
longer a separate project, but integrated into Chromium:
therefore moving it out of Chromium source tree would require
extra effort.
Rename webengine-core feature to build-qtwebengine-core, this
makes consistent feature naming with build-qtpdf
At the moment two new modules have integrated build, with possible
shortcuts:
qmake -- --no-build-qtwebengine-core
qmake -- --no-build-qtpdf
Webengine build is disabled by default now.
Change-Id: Iac3d9927d51f3ac316db0148d275eda843dcc19b
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/pdf/pdfcore.pro')
-rw-r--r-- | src/pdf/pdfcore.pro | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/src/pdf/pdfcore.pro b/src/pdf/pdfcore.pro new file mode 100644 index 000000000..752ae4468 --- /dev/null +++ b/src/pdf/pdfcore.pro @@ -0,0 +1,79 @@ +TARGET = QtPdf +MODULE = pdf + +QT += gui core core-private +QT_PRIVATE += network + +TEMPLATE = lib + +CONFIG += c++11 +CONFIG -= precompile_header # Not supported by upstream header files + +INCLUDEPATH += $$QTWEBENGINE_ROOT/src/pdf +CHROMIUM_SRC_DIR = $$QTWEBENGINE_ROOT/$$getChromiumSrcDir() +CHROMIUM_GEN_DIR = $$OUT_PWD/../$$getConfigDir()/gen +INCLUDEPATH += $$QTWEBENGINE_ROOT/src/pdf \ + $$CHROMIUM_GEN_DIR \ + $$CHROMIUM_SRC_DIR \ + api + +DEFINES += QT_BUILD_PDF_LIB +win32: DEFINES += NOMINMAX + +linking_pri = $$OUT_PWD/$$getConfigDir()/$${TARGET}.pri +!include($$linking_pri) { + error("Could not find the linking information that gn should have generated.") +} + +isEmpty(NINJA_OBJECTS): error("Missing object files from QtPdf linking pri.") +isEmpty(NINJA_LFLAGS): error("Missing linker flags from QtPdf linking pri") +isEmpty(NINJA_ARCHIVES): error("Missing archive files from QtPdf linking pri") +isEmpty(NINJA_LIBS): error("Missing library files from QtPdf linking pri") + +NINJA_OBJECTS = $$eval($$list($$NINJA_OBJECTS)) +RSP_FILE = $$OUT_PWD/$$getConfigDir()/$${TARGET}.rsp +for(object, NINJA_OBJECTS): RSP_CONTENT += $$object +write_file($$RSP_FILE, RSP_CONTENT) + +macos:LIBS_PRIVATE += -Wl,-filelist,$$shell_quote($$RSP_FILE) +linux:LIBS_PRIVATE += @$$RSP_FILE + +# QTBUG-58710 add main rsp file on windows +win32:QMAKE_LFLAGS += @$$RSP_FILE + +linux: LIBS_PRIVATE += -Wl,--start-group $$NINJA_ARCHIVES -Wl,--end-group +else: LIBS_PRIVATE += $$NINJA_ARCHIVES + +LIBS_PRIVATE += $$NINJA_LIB_DIRS $$NINJA_LIBS + +QMAKE_DOCS = $$PWD/doc/qtpdf.qdocconf + +gcc { + QMAKE_CXXFLAGS_WARN_ON += -Wno-unused-parameter +} + +msvc { + QMAKE_CXXFLAGS_WARN_ON += -wd"4100" +} + +SOURCES += \ + qpdfbookmarkmodel.cpp \ + qpdfdocument.cpp \ + qpdfpagenavigation.cpp \ + qpdfpagerenderer.cpp + +# all "public" headers must be in "api" for sync script and to hide auto generated headers +# by Chromium in case of in-source build + +HEADERS += \ + api/qpdfbookmarkmodel.h \ + api/qpdfdocument.h \ + api/qpdfdocument_p.h \ + api/qpdfdocumentrenderoptions.h \ + api/qpdfnamespace.h \ + api/qpdfpagenavigation.h \ + api/qpdfpagerenderer.h \ + api/qtpdfglobal.h \ + api/qpdfdocument_p.h + +load(qt_module) |