"Fossies" - the Fresh Open Source Software Archive

Member "sshfs-3.7.2/meson.build" (8 Jun 2021, 2388 Bytes) of package /linux/misc/sshfs-3.7.2.tar.xz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "meson.build": 3.7.1_vs_3.7.2.

    1 project('sshfs', 'c', version: '3.7.2',
    2         meson_version: '>= 0.40',
    3         default_options: [ 'buildtype=debugoptimized' ])
    4 
    5 add_global_arguments('-D_REENTRANT', '-DHAVE_CONFIG_H',
    6                      '-Wall', '-Wextra', '-Wno-sign-compare',
    7                      '-Wmissing-declarations', '-Wwrite-strings',
    8                      language: 'c')
    9 
   10 # Some (stupid) GCC versions warn about unused return values even when they are
   11 # casted to void. This makes -Wunused-result pretty useless, since there is no
   12 # way to suppress the warning when we really *want* to ignore the value.
   13 cc = meson.get_compiler('c')
   14 code = '''
   15 __attribute__((warn_unused_result)) int get_4() {
   16     return 4;
   17 }
   18 int main(void) {
   19     (void) get_4();
   20     return 0;
   21 }'''
   22 if not cc.compiles(code, args: [ '-O0', '-Werror=unused-result' ])
   23      message('Compiler warns about unused result even when casting to void')
   24      add_global_arguments('-Wno-unused-result', language: 'c')
   25 endif
   26 
   27 
   28 rst2man = find_program('rst2man', 'rst2man.py', required: false)
   29   
   30 cfg = configuration_data()
   31 
   32 cfg.set_quoted('PACKAGE_VERSION', meson.project_version())
   33 
   34 include_dirs = [ include_directories('.') ]
   35 sshfs_sources = ['sshfs.c', 'cache.c']
   36 if target_machine.system() == 'darwin'
   37   cfg.set_quoted('IDMAP_DEFAULT', 'user')
   38   sshfs_sources += [ 'compat/fuse_opt.c', 'compat/darwin_compat.c' ]
   39   include_dirs += [ include_directories('compat') ]
   40 else
   41   cfg.set_quoted('IDMAP_DEFAULT', 'none')
   42 endif
   43 
   44 configure_file(output: 'config.h',
   45                configuration : cfg)
   46 
   47 sshfs_deps = [ dependency('fuse3', version: '>= 3.1.0'),
   48                dependency('glib-2.0'),
   49                dependency('gthread-2.0') ]
   50 
   51 executable('sshfs', sshfs_sources,
   52            include_directories: include_dirs,
   53            dependencies: sshfs_deps,
   54            c_args: ['-DFUSE_USE_VERSION=31'],
   55            install: true,
   56            install_dir: get_option('bindir'))
   57 
   58 if rst2man.found()
   59     custom_target('manpages', input: [ 'sshfs.rst' ], output: [ 'sshfs.1' ],
   60                   command: [rst2man, '@INPUT@', '@OUTPUT@'], install: true,
   61                   install_dir: join_paths(get_option('mandir'), 'man1'))
   62 else
   63     message('rst2man not found, not building manual page.')
   64 endif
   65 
   66 meson.add_install_script('utils/install_helper.sh',
   67                          get_option('sbindir'),
   68                          get_option('bindir'))
   69 
   70 
   71 subdir('test')
   72