add features module to detect availability of build time features at runtime
This commit is contained in:
parent
4b39d17e5f
commit
e24c0dda5d
11 changed files with 62 additions and 44 deletions
|
@ -189,13 +189,9 @@ def execute_stdout(argv, env=os.environ, cwd=None):
|
|||
def electron_gyp():
|
||||
SOURCE_ROOT = os.path.abspath(os.path.join(__file__, '..', '..', '..'))
|
||||
gyp = os.path.join(SOURCE_ROOT, 'electron.gyp')
|
||||
features_gyp = os.path.join(SOURCE_ROOT, 'features.gypi')
|
||||
obj = {}
|
||||
with open(gyp) as f:
|
||||
obj = eval(f.read())['variables']
|
||||
with open(features_gyp) as g:
|
||||
obj.update(eval(g.read())['variables']['variables'])
|
||||
return obj
|
||||
obj = eval(f.read());
|
||||
return obj['variables']
|
||||
|
||||
|
||||
def get_electron_version():
|
||||
|
|
|
@ -28,7 +28,6 @@ SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
|
|||
|
||||
PROJECT_NAME = electron_gyp()['project_name%']
|
||||
PRODUCT_NAME = electron_gyp()['product_name%']
|
||||
PDF_VIEWER_ENABLED = electron_gyp()['enable_pdf_viewer%']
|
||||
|
||||
|
||||
def main():
|
||||
|
@ -36,7 +35,6 @@ def main():
|
|||
|
||||
args = parse_args()
|
||||
config = args.configuration
|
||||
os.environ['PDF_VIEWER_ENABLED'] = str(PDF_VIEWER_ENABLED)
|
||||
|
||||
if args.verbose:
|
||||
enable_verbose_mode()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue