Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions devel/0726.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# [0726] 添加无 pdfhummus 选项

## What
在构建脚本中添加了无 pdfhummus 的选项

## 如何测试
```
xmake f -c --pdfhummus=no
xmake b stem
xmake r stem
```
5 changes: 5 additions & 0 deletions xmake/options.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ option("qt_frontend")
set_description("Build the Qt frontend (default: ImGui frontend)")
option_end()

option("pdfhummus")
set_default(true)
set_description("Enable PDFHummus plugin")
option_end()

option("mupdf")
set_default(true)
set_description("Enable MuPDF library")
Expand Down
8 changes: 5 additions & 3 deletions xmake/requires.lua
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,11 @@ else
add_requires("libcurl", {system=false})
end

add_requires("liii-pdfhummus", {system=false,configs={libpng=true,libjpeg=true}})
add_requires("freetype "..FREETYPE_VERSION, {system=false, configs={png=true}})
add_requireconfs("liii-pdfhummus.freetype", {version = FREETYPE_VERSION, system = false, configs={png=true}, override=true})
if has_config("pdfhummus") then
add_requires("liii-pdfhummus", {system=false,configs={libpng=true,libjpeg=true}})
add_requires("freetype "..FREETYPE_VERSION, {system=false, configs={png=true}})
add_requireconfs("liii-pdfhummus.freetype", {version = FREETYPE_VERSION, system = false, configs={png=true}, override=true})
end

add_requires("argh v1.3.2")

Expand Down
16 changes: 12 additions & 4 deletions xmake/targets/libmogan.lua
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,13 @@ target("libmogan") do
add_files("$(projectdir)/src/Scheme/Plugins/glue_bibtex.lua", {rule = "mogan.glue"})
add_files("$(projectdir)/src/Scheme/Plugins/glue_ghostscript.lua", {rule = "mogan.glue"})
add_files("$(projectdir)/src/Scheme/Plugins/glue_html.lua", {rule = "mogan.glue"})
add_files("$(projectdir)/src/Scheme/Plugins/glue_pdf.lua", {rule = "mogan.glue"})
add_files("$(projectdir)/src/Scheme/Plugins/glue_plugin.lua", {rule = "mogan.glue"})
add_files("$(projectdir)/src/Scheme/Plugins/glue_tex.lua", {rule = "mogan.glue"})
add_files("$(projectdir)/src/Scheme/Plugins/glue_updater.lua", {rule = "mogan.glue"})
add_files("$(projectdir)/src/Scheme/Plugins/glue_xml.lua", {rule = "mogan.glue"})
if has_config("pdfhummus") then
add_files("$(projectdir)/src/Scheme/Plugins/glue_pdf.lua", {rule = "mogan.glue"})
end
if has_config("qt_frontend") then
add_files("$(projectdir)/src/Scheme/L5/glue_qt.lua", {rule = "mogan.glue"})
set_configvar("QTTEXMACS", 1)
Expand All @@ -79,7 +81,9 @@ target("libmogan") do
add_packages("glfw")
end

add_packages("liii-pdfhummus")
if has_config("pdfhummus") then
add_packages("liii-pdfhummus")
end
add_packages("freetype")
add_packages("goldfish")
add_packages("liii-tbox")
Expand Down Expand Up @@ -129,7 +133,7 @@ target("libmogan") do
USE_PLUGIN_BIBTEX = true,
USE_PLUGIN_TEX = true,
USE_PLUGIN_ISPELL = true,
USE_PLUGIN_PDF = true,
USE_PLUGIN_PDF = has_config("pdfhummus"),
USE_PLUGIN_SPARKLE = false,
USE_PLUGIN_HTML = true,
USE_MUPDF_RENDERER = has_config("mupdf"),
Expand Down Expand Up @@ -258,7 +262,6 @@ target("libmogan") do
"$(projectdir)/src/Typeset/**.cpp",
"$(projectdir)/src/Plugins/Bibtex/**.cpp",
"$(projectdir)/src/Plugins/Freetype/**.cpp",
"$(projectdir)/src/Plugins/Pdf/**.cpp",
"$(projectdir)/src/Plugins/Ghostscript/**.cpp",
"$(projectdir)/src/Plugins/Ispell/**.cpp",
"$(projectdir)/src/Plugins/Metafont/**.cpp",
Expand All @@ -269,6 +272,11 @@ target("libmogan") do
"$(projectdir)/TeXmacs/plugins/goldfish/src/**.cpp",
"$(projectdir)/3rdparty/json-schema-validator/src/**.cpp"})

if has_config("pdfhummus") then
add_includedirs("$(projectdir)/src/Plugins/Pdf/**.hpp", {public=true})
add_files("$(projectdir)/src/Plugins/Pdf/**.cpp")
end

if has_config("qt_frontend") then
add_includedirs("$(projectdir)/src/Plugins/Qt", {public=true})
add_files("$(projectdir)/src/Plugins/Qt/**.cpp", "$(projectdir)/src/Plugins/Qt/**.hpp")
Expand Down
Loading