Skip to content

Commit

Permalink
also order libobsd_license before libobsd_dep outside Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
guijan committed Jan 5, 2025
1 parent 8df2f3b commit 3eced82
Showing 1 changed file with 22 additions and 13 deletions.
35 changes: 22 additions & 13 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -132,25 +132,28 @@ if not subproj
endif

libobsd_license = 'LICENSE.txt'
libobsd_license_subproj = 'LICENSE_libobsd.txt'
libobsd_readme = 'README.md'
docdir = get_option('docdir')
if docdir == ''
docdir = get_option('datadir') / 'doc' \
/ meson.project_name() + '-' + meson.project_version()
docdir = get_option('datadir') / 'doc'
endif
docdir = docdir / meson.project_name() + '-' + meson.project_version()
before_libobsd_dep = []
if windows_host
unix2dos = find_program('unix2dos')
outname = subproj ? 'LICENSE_libobsd.txt' : libobsd_license
before_libobsd_dep += custom_target('license',
command: [unix2dos],
input: libobsd_license,
feed: true,
capture: true,
output: outname,
build_by_default: true,
install: not subproj,
install_dir: docdir)
outname = subproj ? libobsd_license_subproj : libobsd_license
libobsd_license_tgt += custom_target('license',
command: [unix2dos],
input: libobsd_license,
feed: true,
capture: true,
output: outname,
build_by_default: true,
install: not subproj,
install_dir: docdir)
libobsd_license = libobsd_license_tgt.full_path()
before_libobsd_dep += libobsd_license_tgt
custom_target('readme',
command: [unix2dos],
input: libobsd_readme,
Expand All @@ -160,7 +163,13 @@ if windows_host
build_by_default: true,
install: not subproj,
install_dir: docdir)
elif not subproj
elif subproj
fs = import('fs')
before_libobsd_dep_tgt = fs.copyfile(libobsd_license, libobsd_license_subproj)
before_libobsd_dep += libobsd_license_tgt
endif

if not subproj
install_data(libobsd_license, libobsd_readme,
install_dir: docdir,
install_tag: 'doc')
Expand Down

0 comments on commit 3eced82

Please sign in to comment.