f17f9d932c
This makes it so you don't have to install gyp on your system before you can build.
33 lines
808 B
Python
Executable file
33 lines
808 B
Python
Executable file
#!/usr/bin/env python
|
|
|
|
import os
|
|
import subprocess
|
|
import sys
|
|
|
|
|
|
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
|
|
GYP = os.path.join(SOURCE_ROOT, 'vendor', 'gyp', 'gyp_main.py')
|
|
|
|
|
|
def main():
|
|
os.chdir(SOURCE_ROOT)
|
|
return (run_gyp() or build())
|
|
|
|
|
|
def run_gyp():
|
|
return subprocess.call([sys.executable, GYP, '--depth', '.', 'brightray.gyp'])
|
|
|
|
|
|
def build():
|
|
if sys.platform == 'darwin':
|
|
return subprocess.call(['xcodebuild'])
|
|
if sys.platform == 'linux2':
|
|
return subprocess.call(['make'])
|
|
|
|
assert sys.platform == 'win32', sys.platform
|
|
msbuild = os.path.join(os.environ['windir'], 'Microsoft.NET', 'Framework', 'v4.0.30319', 'MSBuild.exe')
|
|
return subprocess.call([msbuild, 'brightray.sln'])
|
|
|
|
|
|
if __name__ == '__main__':
|
|
sys.exit(main())
|