From 6ffee1b5816be108d73bcd86c954d4dae79ef9f4 Mon Sep 17 00:00:00 2001 From: "D. Ben Knoble" Date: Sat, 20 Jun 2026 12:00:24 -0400 Subject: [PATCH] meson: wire up USE_NSEC build knob Autotools-style builds permit enabling USE_NSEC for cases where that's desired; the equivalent knob is missing from meson-based builds. Signed-off-by: D. Ben Knoble Signed-off-by: Junio C Hamano --- meson.build | 4 ++++ meson_options.txt | 2 ++ 2 files changed, 6 insertions(+) diff --git a/meson.build b/meson.build index 11488623bfd..02496b059e0 100644 --- a/meson.build +++ b/meson.build @@ -835,6 +835,10 @@ if help_format_opt != 'man' libgit_c_args += '-DDEFAULT_HELP_FORMAT="' + help_format_opt + '"' endif +if get_option('nanosec') + libgit_c_args += '-DUSE_NSEC' +endif + libgit_include_directories = [ '.' ] libgit_dependencies = [ ] diff --git a/meson_options.txt b/meson_options.txt index 659cbb218f4..4e7baed89cd 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -21,6 +21,8 @@ option('runtime_prefix', type: 'boolean', value: false, description: 'Resolve ancillary tooling and support files relative to the location of the runtime binary instead of hard-coding them into the binary.') option('sane_tool_path', type: 'array', value: [], description: 'An array of paths to pick up tools from in case the normal tools are broken or lacking.') +option('nanosec', type: 'boolean', value: false, + description: 'Care about sub-second file mtimes and ctimes.') # Build information compiled into Git and other parts like documentation. option('build_date', type: 'string', value: '',