645
':!sha1dc',
646
':!t/unit-tests/clar',
647
':!t/t[0-9][0-9][0-9][0-9]*',
648
+ ':!xdiff',
649
]
650
651
headers_to_check = []
1995
1996
subdir('contrib')
1997
1998
+exclude_from_check_headers = [
1999
+ 'compat/',
2000
+ 'unicode-width.h',
2001
+]
2002
+
2003
+if sha1_backend != 'openssl'
2004
+ exclude_from_check_headers += 'sha1/openssl.h'
2005
+endif
2006
+if sha256_backend != 'openssl'
2007
+ exclude_from_check_headers += 'sha256/openssl.h'
2008
+endif
2009
+if sha256_backend != 'nettle'
2010
+ exclude_from_check_headers += 'sha256/nettle.h'
2011
+endif
2012
+if sha256_backend != 'gcrypt'
2013
+ exclude_from_check_headers += 'sha256/gcrypt.h'
2014
+endif
2015
+
2016
+if headers_to_check.length() != 0 and compiler.get_argument_syntax() == 'gcc'
2017
+ hco_targets = []
2018
+ foreach h : headers_to_check
2019
+ skip_header = false
2020
+ foreach exclude : exclude_from_check_headers
2021
+ if h.startswith(exclude)
2022
+ skip_header = true
2023
+ break
2024
+ endif
2025
+ endforeach
2026
+
2027
+ if skip_header
2028
+ continue
2029
+ endif
2030
+
2031
+ hcc = custom_target(
2032
+ input: h,
2033
+ output: h.underscorify() + 'cc',
2034
+ command: [
2035
+ shell,
2036
+ '-c',
2037
+ 'echo \'#include "git-compat-util.h"\' > @OUTPUT@ && echo \'#include "' + h + '"\' >> @OUTPUT@'
2038
+ ]
2039
+ )
2040
+
2041
+ hco = custom_target(
2042
+ input: hcc,
2043
+ output: fs.replace_suffix(h.underscorify(), '.hco'),
2044
+ command: [
2045
+ compiler.cmd_array(),
2046
+ libgit_c_args,
2047
+ '-I', meson.project_source_root(),
2048
+ '-I', meson.project_source_root() / 't/unit-tests',
2049
+ '-o', '/dev/null',
2050
+ '-c', '-xc',
2051
+ '@INPUT@'
2052
+ ]
2053
+ )
2054
+ hco_targets += hco
2055
+ endforeach
2056
+
2057
+ alias_target('hdr-check', hco_targets)
2058
+endif
2059
+
2060
foreach key, value : {
2061
'DIFF': diff.full_path(),
2062
'GIT_SOURCE_DIR': meson.project_source_root(),