Compare commits

...

5 Commits

Author SHA1 Message Date
Dylan Baker 125a13d3b9 meson: add -Wmisleading-indentation
A useful warning when loop and conditional statements are allowed
without braces.
2022-08-03 12:03:15 -07:00
Dylan Baker 96c61cbab0 libpkgconf: remove trailing ; from macro definition
GCC has a lovely bug (which I will report as soon as I have an account),
which causes -Wmisleading-indentation to miss cases of misleading
indentation after a `;;`, since the macro adds `;`, and in call cases
the caller also adds `;`, we end up with a double macro and gcc fails to
warn.
2022-08-03 12:03:15 -07:00
Ariadne Conill a042827951 Merge pull request 'meson cleanups and fixes' (#240) from dcbaker/pkgconf:submit/meson-cleanups into master
Reviewed-on: ariadne/pkgconf#240
2022-08-02 23:09:24 +00:00
Dylan Baker dd779ad9f8 meson: add check to run_command
Because we really should be checking that it succeeds, and because not
setting it is deprecated.
2022-08-01 09:40:08 -07:00
Dylan Baker c04097e491 meson: pass configured files idiomatically
Instead of attempting to figure out what the paths will be, take the
returned file object and pass that around, meson will then automatically
figure out the correct paths.
2022-08-01 09:40:08 -07:00
3 changed files with 7 additions and 7 deletions

View File

@ -298,11 +298,11 @@ PKGCONF_API bool pkgconf_default_error_handler(const char *msg, const pkgconf_cl
#if defined(__GNUC__) || defined(__INTEL_COMPILER) #if defined(__GNUC__) || defined(__INTEL_COMPILER)
#define PKGCONF_TRACE(client, ...) do { \ #define PKGCONF_TRACE(client, ...) do { \
pkgconf_trace(client, __FILE__, __LINE__, __PRETTY_FUNCTION__, __VA_ARGS__); \ pkgconf_trace(client, __FILE__, __LINE__, __PRETTY_FUNCTION__, __VA_ARGS__); \
} while (0); } while (0)
#else #else
#define PKGCONF_TRACE(client, ...) do { \ #define PKGCONF_TRACE(client, ...) do { \
pkgconf_trace(client, __FILE__, __LINE__, __func__, __VA_ARGS__); \ pkgconf_trace(client, __FILE__, __LINE__, __func__, __VA_ARGS__); \
} while (0); } while (0)
#endif #endif
#else #else
#define PKGCONF_TRACE(client, ...) #define PKGCONF_TRACE(client, ...)

View File

@ -12,6 +12,7 @@ add_project_arguments(
'-D_DEFAULT_SOURCE', '-D_DEFAULT_SOURCE',
cc.get_supported_arguments( cc.get_supported_arguments(
'-Wimplicit-function-declaration', '-Wimplicit-function-declaration',
'-Wmisleading-indentation',
), ),
language : 'c', language : 'c',
) )
@ -119,9 +120,8 @@ pkgconf_exe = executable('pkgconf',
if get_option('tests') if get_option('tests')
kyua_exe = find_program('kyua') kyua_exe = find_program('kyua')
atf_sh_exe = find_program('atf-sh') atf_sh_exe = find_program('atf-sh')
test('kyua', kyua_exe, args : ['--config=none', 'test', '--kyuafile=' + join_paths(meson.current_build_dir(), 'Kyuafile'), '--build-root=' + meson.current_build_dir()]) kyuafile = configure_file(input : 'Kyuafile.in', output : 'Kyuafile', configuration : cdata)
test('kyua', kyua_exe, args : ['--config=none', 'test', '--kyuafile', kyuafile, '--build-root', meson.current_build_dir()])
configure_file(input : 'Kyuafile.in', output : 'Kyuafile', configuration : cdata)
subdir('tests') subdir('tests')
endif endif

View File

@ -18,6 +18,6 @@ tests = [
# yuck # yuck
foreach test : tests foreach test : tests
configure_file(input: test + '.sh', output: test, copy: true) test_file = configure_file(input: test + '.sh', output: test, copy: true)
run_command('chmod', '755', join_paths(meson.current_build_dir(), 'tests', test)) run_command('chmod', '755', test_file, check : true)
endforeach endforeach