Skip to content

Commit

Permalink
Rewrite meson.build
Browse files Browse the repository at this point in the history
  • Loading branch information
wrvsrx authored and grafikrobot committed Feb 26, 2025
1 parent 67be590 commit 1a5c6f1
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 18 deletions.
30 changes: 20 additions & 10 deletions data/build.jam
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ local meson_build_header_join_str = ",
# ----

project('Lyra','cpp',
version: '1.6',
version: '1.6.1',
default_options : ['cpp_std=c++11', 'cpp_eh=none', 'b_lto=true', 'warning_level=3'],
license: 'BSL-1.0')

Expand All @@ -95,15 +95,25 @@ $(lyra_headers_relative:J=$(meson_build_header_join_str))
"
]

inc_dir = [include_directories('include')]

lyra_lib = shared_library('lyra',
sources : src,
include_directories: inc_dir,
install: true,
install_dir : '/usr/lib')

lyra_dep = declare_dependency(include_directories: inc_dir, link_with: lyra_lib)
fs = import('fs')
foreach header : src
# use substring to drop `include/` prefix
install_headers(header, subdir : fs.parent(header.substring(8)))
endforeach

inc_dir = include_directories('include')

lyra_dep = declare_dependency(include_directories: inc_dir)

pkg = import('pkgconfig')
pkg.generate(
subdirs : 'lyra',
filebase : 'lyra',
version : meson.project_version(),
name : meson.project_name(),
description : 'A simple to use, composing, header only, command line arguments parser for C++ 11 and beyond.',
url: 'https://github.com/bfgroup/Lyra',
)
" ;

.meson_build_file = $(.meson_build_file:J=) ;
Expand Down
26 changes: 18 additions & 8 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
# ----

project('Lyra','cpp',
version: '1.6',
version: '1.6.1',
default_options : ['cpp_std=c++11', 'cpp_eh=none', 'b_lto=true', 'warning_level=3'],
license: 'BSL-1.0')

Expand Down Expand Up @@ -68,12 +68,22 @@ src = [
'include/lyra/version.hpp'
]

inc_dir = [include_directories('include')]
fs = import('fs')
foreach header : src
# use substring to drop `include/` prefix
install_headers(header, subdir : fs.parent(header.substring(8)))
endforeach

lyra_lib = shared_library('lyra',
sources : src,
include_directories: inc_dir,
install: true,
install_dir : '/usr/lib')
inc_dir = include_directories('include')

lyra_dep = declare_dependency(include_directories: inc_dir, link_with: lyra_lib)
lyra_dep = declare_dependency(include_directories: inc_dir)

pkg = import('pkgconfig')
pkg.generate(
subdirs : 'lyra',
filebase : 'lyra',
version : meson.project_version(),
name : meson.project_name(),
description : 'A simple to use, composing, header only, command line arguments parser for C++ 11 and beyond.',
url: 'https://github.com/bfgroup/Lyra',
)

0 comments on commit 1a5c6f1

Please sign in to comment.