Skip to content
Extraits de code Groupes Projets
Sélectionner une révision Git
  • b6189d5931440178b52347089833e0f0f9159c2c
  • master par défaut protégée
  • rust-playlist-sync
  • rust
  • fix-qt-deprecated-qvariant-type
  • fix-mpris-qtwindow-race-condition
  • rust-appimage-wayland
  • windows-build-rebased
  • v2.5 protégée
  • v2.4 protégée
  • v2.3-1 protégée
  • v2.3 protégée
  • v2.2 protégée
  • v2.1 protégée
  • v2.0 protégée
  • v1.8-3 protégée
  • v1.8-2 protégée
  • v1.8-1 protégée
  • v1.8 protégée
  • v1.7 protégée
  • v1.6 protégée
  • v1.5 protégée
  • v1.4 protégée
  • v1.3 protégée
  • v1.2 protégée
  • v1.1 protégée
  • v1.0 protégée
27 résultats

README.md

Blame
  • meson.build 6,94 Kio
    project( 'lektor'
           , 'c'
           , version: '0.1.0'
           , license: 'ISC'
           , default_options: [ 'c_std=c18'
                              , 'cpp_std=c++17'
                              , 'warning_level=3'
                              , 'werror=true'
                              , 'strip=true'
                              , 'debug=true'
                              , 'buildtype=debug'
                              ]
           )
    
    libdl   = meson.get_compiler('c').find_library('dl')
    dep_x11 = dependency('x11',  required: false)
    dep_mpv = dependency('mpv',  required: false)
    dep_sdl = dependency('sdl2', required: false)
    
    ## Get architecture
    archi = run_command('uname', '-p').stdout().strip()
    if archi == 'unknown'
      archi = run_command('uname', '-m').stdout().strip()
    endif
    if archi == 'unknown'
      archi = run_command('arch').stdout().strip()
    endif
    add_global_arguments('-D' + archi + '_ARCH', language: 'c')
    add_global_arguments('-D_REENTRANT', language: 'c')
    
    ## Sources for mthread
    mthread_sources = [ 'src/mthread/mthread.c'
                      , 'src/mthread/mthread_cond.c'
                      , 'src/mthread/mthread_key.c'
                      , 'src/mthread/mthread_mutex.c'
                      , 'src/mthread/mthread_once.c'
                      , 'src/mthread/mthread_sem.c'
                      , 'src/mthread/mthread_tst.c'
                      ]
    
    ## Sources for the server
    core_sources =  [ 'src/mkv/bufferfd.c'
                    , 'src/mkv/write.c'
                    , 'src/commands.c'
                    , 'src/database/stickers.c'
                    , 'src/database/open.c'
                    , 'src/database/queue.c'
                    , 'src/database/update.c'
                    , 'src/database/find.c'
                    , 'src/database/config.c'
                    , 'src/database/playlist.c'
                    , 'src/database/user.c'
                    , 'src/mkv/mkv.c'
                    , 'src/net/command.c'
                    , 'src/net/listen.c'
                    , 'src/net/message.c'
                    , 'src/net/downloader.c'
                    , 'src/config.c'
                    , 'src/uri.c'
                    , 'src/thread.c'
                    , 'src/cmd.c'
                    ]
    
    # Global includes
    includes = include_directories('inc')
    
    # Server
    core_deps = [ dependency('sqlite3', version: '>= 3.31.0')
                , dependency('libcurl')
                , dependency('json-c')
                , dependency('threads', required: true)
                ]
    
    common_deps = [ declare_dependency( link_with: static_library( 'common'
                                                                 , files('src/common.c')
                                                                 , include_directories: includes )
                                      , include_directories: includes ) ]
    
    mthread_deps = [ declare_dependency( link_with: static_library( 'mthread'
                                                                  , files(mthread_sources)
                                                                  , include_directories: includes )
                                       , include_directories: includes
                                       , dependencies: [ common_deps ] ) ]
    
    generated_deps = [ declare_dependency( link_with: static_library( 'generated'
                                                                    , [ custom_target( 'sqlinit'
                                                                                     , output: 'sqlinit.c'
                                                                                     , input: 'scripts/init.sql'
                                                                                     , command: [ find_program('xxd'), '-i', '@INPUT@', '@OUTPUT@' ] ) ]
                                                                    , [ custom_target( 'manpath'
                                                                                     , output: 'manpath.c'
                                                                                     , input: 'scripts/getmanpath.sh'
                                                                                     , command: [ find_program('scripts/getmanpath.sh'), '@OUTPUT@' ] ) ] )
                                         ) ]
    
    lib = static_library( 'lektor'
                        , files(core_sources)
                        , include_directories: includes
                        , dependencies: [ core_deps, libdl, common_deps, mthread_deps, generated_deps ] )
    
    bin_deps = [ declare_dependency( link_with: lib, include_directories: includes) ]
    
    srv = executable( meson.project_name() + 'd'
                    , files('src/main/server.c')
                    , include_directories: includes
                    , dependencies: [ bin_deps ]
                    , install: true )
    
    # Admin executable
    lktadm = executable( 'lktadm'
                       , files('src/main/lktadm.c', 'src/cmd.c')
                       , include_directories : includes
                       , dependencies: [ bin_deps ]
                       , install: true )
    
    # Client executable
    lkt = executable( 'lkt'
                    , files('src/main/lkt.c', 'src/cmd.c', 'src/common.c')
                    , include_directories: includes
                    , dependencies: [ generated_deps ]
                    , install: true )
    
    # X11 window module
    if dep_x11.found() and dep_mpv.found()
      lib_mod_x11 = shared_library ( '_module_x11'
                                   , files(['src/module/module_x11.c', 'src/module/mpv.c'])
                                   , include_directories: includes
                                   , dependencies: [ dep_x11, dep_mpv ]
                                   , link_with: lib
                                   , install: true
                                   , install_dir: 'lib/lektor' )
    endif
    
    # SQL2 window module
    if dep_sdl.found() and dep_mpv.found()
      lib_mod_sdl = shared_library ( '_module_sdl2'
                                   , files(['src/module/module_sdl2.c', 'src/module/mpv.c'])
                                   , include_directories: includes
                                   , dependencies: [ dep_sdl, dep_mpv ]
                                   , link_with: lib
                                   , install: true
                                   , install_dir: 'lib/lektor' )
    endif
    
    # Man pages
    man_sh     = find_program('scripts/man.sh')
    man_header = run_command('realpath', 'doc/header').stdout().strip()
    man_footer = run_command('realpath', 'doc/footer').stdout().strip()
    man_files  = [ [ 'lektord', '1' ]
                 , [ 'lektor',  '1' ]
                 , [ 'lktadm',  '1' ]
                 , [ 'lkt',     '1' ]
                 ]
    
    foreach man: man_files
      man_name    = man.get(0)
      man_section = man.get(1, '1')
      custom_target( '@0@.@1@'.format(man_name, man_section)
                   , input: 'doc/@0@.@1@'.format(man_name, man_section)
                   , output: '@0@.@1@'.format(man_name, man_section)
                   , command: [ man_sh, '@INPUT@', '@OUTPUT@', man_header, man_footer ]
                   , depend_files: [ man_header, man_footer ]
                   , install: true
                   , install_dir: join_paths(get_option('mandir'), 'man@0@'.format(man_section)) )
    endforeach
    
    # Install
    meson.add_install_script('scripts/install.sh')