print("ninja executable not found. Building ...") subprocess.run(['python3', 'configure.py', '--bootstrap'], cwd=ninjapath) shutil.copy(ninjapath + os.path.sep + 'ninja', '.') if __name__ == '__main__': if sys.version_info[0] < 3: raise Exception("Script must be run using Python 3") # Set up the build environment, i.e. clone or download all submodules init_submodules('auto') # Build ninja if it cannot be found build_ninja() # Add paths for meson and ninja to environment os.environ["NINJA"] = sys.path[0] + os.path.sep + "ninja" if os.name == 'nt': os.environ["NINJA"] = os.environ["NINJA"] + '.exe' if os.path.exists(sys.path[0] + os.path.sep + 'externals' + os.path.sep + 'meson' + os.path.sep + 'mesonbuild'): sys.path.insert( 0, str(sys.path[0] + os.path.sep + 'externals' + os.path.sep + 'meson')) from mesonbuild import mesonmain sys.exit(mesonmain.main())
#!/usr/bin/env python3 # Copyright 2016 The Meson development team # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. from mesonbuild import mesonmain import sys sys.exit(mesonmain.main())