aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-09-24 14:40:44 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-09-24 14:40:44 +0000
commite3eb58d483c4033802dd73b2f07713ccd402eb49 (patch)
tree58f2cbe3a44348a38a58b1291c2812d613051f66
parentchangelog: add new ‘unreleased’ section (diff)
parentmeson: add -Dwith-docs=disabled|enabled|auto (diff)
Merge branch 'make-doc-generation-optional' into master
-rw-r--r--CHANGELOG.md7
-rw-r--r--doc/meson.build1
-rw-r--r--meson.build26
-rw-r--r--meson_options.txt2
4 files changed, 25 insertions, 11 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 03e64784..26741557 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -16,6 +16,13 @@
## Unreleased
### Added
+
+* `-Dwith-docs=disabled|enabled|auto` meson command line option. When
+ disabled, no documentation will be installed. This includes man
+ pages as well as `README.md`, `CHANGELOG.md` and `LICENSE`. Defaults
+ to `enabled`.
+
+
### Changed
### Deprecated
### Removed
diff --git a/doc/meson.build b/doc/meson.build
index 1f017db4..b26acd65 100644
--- a/doc/meson.build
+++ b/doc/meson.build
@@ -1,6 +1,5 @@
sh = find_program('sh', native: true)
-scdoc = dependency('scdoc', native: true)
scdoc_prog = find_program(scdoc.get_pkgconfig_variable('scdoc'), native: true)
foreach man_src : [{'name': 'foot', 'section' : 1},
diff --git a/meson.build b/meson.build
index fc79f8a8..a882dd0b 100644
--- a/meson.build
+++ b/meson.build
@@ -60,6 +60,9 @@ wayland_client = dependency('wayland-client')
wayland_cursor = dependency('wayland-cursor')
xkb = dependency('xkbcommon')
fontconfig = dependency('fontconfig')
+scdoc = dependency('scdoc', native: true, required: get_option('with-docs'))
+
+build_and_install_docs = scdoc.found()
tllist = dependency('tllist', version: '>=1.0.4', fallback: 'tllist')
fcft = dependency('fcft', version: ['>=2.3.0', '<3.0.0'], fallback: 'fcft')
@@ -158,20 +161,23 @@ custom_target(
install_dir: join_paths(get_option('datadir'), 'terminfo'))
install_data(
- 'LICENSE', 'README.md', 'CHANGELOG.md',
- install_dir: join_paths(get_option('datadir'), 'doc', 'foot'))
-install_data(
'foot.desktop', 'foot-server.desktop',
install_dir: join_paths(get_option('datadir'), 'applications'))
install_data('foot.ini', install_dir: join_paths(get_option('datadir'), 'foot'))
subdir('completions')
-subdir('doc')
subdir('icons')
-# summary(
-# {
-# '<feature>': false,
-# },
-# bool_yn: true
-# )
+if build_and_install_docs
+ install_data(
+ 'LICENSE', 'README.md', 'CHANGELOG.md',
+ install_dir: join_paths(get_option('datadir'), 'doc', 'foot'))
+ subdir('doc')
+endif
+
+summary(
+ {
+ 'Documentation': build_and_install_docs,
+ },
+ bool_yn: true
+)
diff --git a/meson_options.txt b/meson_options.txt
new file mode 100644
index 00000000..1e69f223
--- /dev/null
+++ b/meson_options.txt
@@ -0,0 +1,2 @@
+option('with-docs', type: 'feature', value: 'enabled',
+ description: 'generate and install documentation (man pages). Requires scdoc.')