Skip to content

Wrapper script that needs paths to in-project executable #10981

Answered by LunarLambda
LunarLambda asked this question in Q&A
Discussion options

You must be logged in to vote

Ended up solving it like so:

tools/copy

#!/usr/bin/env python3

import shutil
from sys import argv

shutil.copy(argv[1], argv[2])

tools/meson.build

objcopy = find_program('objcopy')

gbafix = executable('gbafix', 'gbafix.c', native: true)

makerom = configure_file(
  input: 'makerom.in',
  output: 'makerom.in',
  configuration: {
    'OBJCOPY': objcopy.full_path(),
    'GBAFIX': gbafix.full_path(),
  })

makerom = custom_target('makerom',
  input: makerom,
  output: 'makerom',
  command: ['copy', '@INPUT@', '@OUTPUT@'],
  depends: [gbafix],
  build_by_default: true)

It's a hack, but it's the only reasonable way to let downstream projects use makerom without needing to worry about the impl…

Replies: 2 comments 15 replies

Comment options

You must be logged in to vote
15 replies
@LunarLambda
Comment options

@eli-schwartz
Comment options

@LunarLambda
Comment options

@eli-schwartz
Comment options

@LunarLambda
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by LunarLambda
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants