diff options
-rwxr-xr-x | meson.py | 16 | ||||
-rw-r--r-- | mesonbuild/backend/backends.py | 2 | ||||
-rw-r--r-- | test cases/common/117 custom target capture/meson.build | 12 |
3 files changed, 22 insertions, 8 deletions
@@ -17,4 +17,18 @@ from mesonbuild import mesonmain import sys, os -sys.exit(mesonmain.run(sys.argv[0], sys.argv[1:])) +def main(): + thisfile = __file__ + if not os.path.isabs(thisfile): + thisfile = os.path.normpath(os.path.join(os.getcwd(), thisfile)) + if __package__ == '': + thisfile = os.path.dirname(thisfile) + + # The first argument *must* be an absolute path because + # the user may have launched the program from a dir + # that is not in path. + sys.exit(mesonmain.run(thisfile, sys.argv[1:])) + +if __name__ == '__main__': + main() + diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py index bdbfee1..ec897aa 100644 --- a/mesonbuild/backend/backends.py +++ b/mesonbuild/backend/backends.py @@ -620,7 +620,7 @@ class Backend(): final_commands = [] previous = '-fsuch_arguments=woof' for c in commands: - if c.startswith(('-I' '-L', '/LIBPATH')): + if c.startswith(('-I', '-L', '/LIBPATH')): if c in includes: continue includes[c] = True diff --git a/test cases/common/117 custom target capture/meson.build b/test cases/common/117 custom target capture/meson.build index 6c19752..fa59d51 100644 --- a/test cases/common/117 custom target capture/meson.build +++ b/test cases/common/117 custom target capture/meson.build @@ -7,10 +7,10 @@ python = find_program('python3') comp = '@0@/@1@'.format(meson.current_source_dir(), 'my_compiler.py') mytarget = custom_target('bindat', -output : 'data.dat', -input : 'data_source.txt', -capture : true, -command : [python, comp, '@INPUT@'], -install : true, -install_dir : 'subdir' + output : 'data.dat', + input : 'data_source.txt', + capture : true, + command : [python, comp, '@INPUT@'], + install : true, + install_dir : 'subdir' ) |