summaryrefslogtreecommitdiff
path: root/data/meson.build
blob: 9ba09ef488dc3003a6ab62f60b97c9e278b4bf07 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
with_msi=false
if host_machine.system() == 'windows'
  wixl = find_program('wixl', required: false)
  wixl_heat = find_program('wixl-heat', required: false)

  python3 = find_program('python3', required: true)

  if wixl.found() and wixl_heat.found() and python3.found()
    with_msi=true
  endif
endif

if with_msi
  msi_filename = 'usbredirect-@0@-@1@.msi'.format(wixl_arch, meson.project_version())

  wxsfile = configure_file(
    input: 'usbredirect.wxs.in',
    output: 'usbredirect.wxs',
    configuration: config
  )

  msi = custom_target(
    msi_filename,
    input: [wxsfile],
    output: [msi_filename],
    build_by_default: false,
    command: [
      python3,
      join_paths(meson.source_root(), 'build-aux', 'msitool.py'),
      meson.build_root(),
      get_option('prefix'),
      wixl_arch,
      join_paths(meson.build_root(), 'data', msi_filename),
      wxsfile,
      wixl_heat,
      wixl,
    ],
  )

endif