Support running Meson as a Python zip application

This commit is contained in:
Franz Zapata 2016-09-25 18:23:45 -06:00 committed by Jussi Pakkanen
parent 8ab62a27b4
commit ac41a45669
2 changed files with 11 additions and 4 deletions

View File

@ -45,3 +45,4 @@ Elliott Sales de Andrade
Patrick Griffis
Iain Lane
Daniel Brendle
Franz Zapata

View File

@ -17,8 +17,14 @@
from mesonbuild import mesonmain
import sys, os
thisfile = __file__
if not os.path.isabs(thisfile):
thisfile = os.path.normpath(os.path.join(os.getcwd(), thisfile))
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)
sys.exit(mesonmain.run(thisfile, sys.argv[1:]))
sys.exit(mesonmain.run(thisfile, sys.argv[1:]))
if __name__ == '__main__':
main()