summaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build40
1 files changed, 37 insertions, 3 deletions
diff --git a/meson.build b/meson.build
index 5dd299b496..2b763f7c53 100644
--- a/meson.build
+++ b/meson.build
@@ -220,7 +220,7 @@ project('git', 'c',
# learned to define __STDC_VERSION__ with C11 and later. We thus require
# GNU C99 and fall back to C11. Meson only learned to handle the fallback
# with version 1.3.0, so on older versions we use GNU C99 unconditionally.
- default_options: meson.version().version_compare('>=1.3.0') ? ['c_std=gnu99,c11'] : ['c_std=gnu99'],
+ default_options: meson.version().version_compare('>=1.3.0') ? ['rust_std=2018', 'c_std=gnu99,c11'] : ['rust_std=2018', 'c_std=gnu99'],
)
fs = import('fs')
@@ -287,7 +287,6 @@ libgit_sources = [
'blob.c',
'bloom.c',
'branch.c',
- 'bulk-checkin.c',
'bundle-uri.c',
'bundle.c',
'cache-tree.c',
@@ -407,6 +406,7 @@ libgit_sources = [
'pack-check.c',
'pack-mtimes.c',
'pack-objects.c',
+ 'pack-refs.c',
'pack-revindex.c',
'pack-write.c',
'packfile.c',
@@ -452,6 +452,7 @@ libgit_sources = [
'reftable/error.c',
'reftable/block.c',
'reftable/blocksource.c',
+ 'reftable/fsck.c',
'reftable/iter.c',
'reftable/merged.c',
'reftable/pq.c',
@@ -462,6 +463,12 @@ libgit_sources = [
'reftable/tree.c',
'reftable/writer.c',
'remote.c',
+ 'repack.c',
+ 'repack-cruft.c',
+ 'repack-filtered.c',
+ 'repack-geometry.c',
+ 'repack-midx.c',
+ 'repack-promisor.c',
'replace-object.c',
'repo-settings.c',
'repository.c',
@@ -522,7 +529,6 @@ libgit_sources = [
'usage.c',
'userdiff.c',
'utf8.c',
- 'varint.c',
'version.c',
'versioncmp.c',
'walker.c',
@@ -607,6 +613,7 @@ builtin_sources = [
'builtin/index-pack.c',
'builtin/init-db.c',
'builtin/interpret-trailers.c',
+ 'builtin/last-modified.c',
'builtin/log.c',
'builtin/ls-files.c',
'builtin/ls-remote.c',
@@ -645,6 +652,7 @@ builtin_sources = [
'builtin/repack.c',
'builtin/replace.c',
'builtin/replay.c',
+ 'builtin/repo.c',
'builtin/rerere.c',
'builtin/reset.c',
'builtin/rev-list.c',
@@ -1701,6 +1709,21 @@ version_def_h = custom_target(
)
libgit_sources += version_def_h
+cargo = find_program('cargo', dirs: program_path, native: true, required: get_option('rust'))
+rust_option = get_option('rust').disable_auto_if(not cargo.found())
+if rust_option.allowed()
+ subdir('src')
+ libgit_c_args += '-DWITH_RUST'
+
+ if host_machine.system() == 'windows'
+ libgit_dependencies += compiler.find_library('userenv')
+ endif
+else
+ libgit_sources += [
+ 'varint.c',
+ ]
+endif
+
libgit = declare_dependency(
link_with: static_library('git',
sources: libgit_sources,
@@ -2099,11 +2122,20 @@ endif
subdir('bin-wrappers')
if get_option('docs') != []
+ doc_targets = []
subdir('Documentation')
+else
+ docs_backend = 'none'
endif
subdir('contrib')
+# Note that the target is intentionally configured after including the
+# 'contrib' directory, as some tool there also have their own manpages.
+if get_option('docs') != []
+ alias_target('docs', doc_targets)
+endif
+
exclude_from_check_headers = [
'compat/',
'unicode-width.h',
@@ -2238,10 +2270,12 @@ summary({
'pcre2': pcre2,
'perl': perl_features_enabled,
'python': target_python.found(),
+ 'rust': rust_option.allowed(),
}, section: 'Auto-detected features', bool_yn: true)
summary({
'csprng': csprng_backend,
+ 'docs': docs_backend,
'https': https_backend,
'sha1': sha1_backend,
'sha1_unsafe': sha1_unsafe_backend,