From 7225506621e7102e8c3c5b4c9f29ac20851bc25a Mon Sep 17 00:00:00 2001 From: "commit-bot@chromium.org" Date: Thu, 20 Mar 2014 19:59:09 +0000 Subject: gyp_skia: make default GYP_GENERATORS for each platform explicit BUG=skia:2317 R=bungeman@google.com Author: epoger@google.com Review URL: https://codereview.chromium.org/199873003 git-svn-id: http://skia.googlecode.com/svn/trunk@13883 2bbb7eff-a529-9590-31e7-b0007b416f81 --- gyp_skia | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/gyp_skia b/gyp_skia index b4f9e74de9..1ba6fc78e8 100755 --- a/gyp_skia +++ b/gyp_skia @@ -28,6 +28,9 @@ gyp_config_dir = os.path.join(script_dir, 'gyp') sys.path.insert(0, os.path.join(gyp_source_dir, 'pylib')) import gyp +ENVVAR_GYP_GENERATORS = 'GYP_GENERATORS' + + def additional_include_files(args=[]): # Determine the include files specified on the command line. # This doesn't cover all the different option formats you can use, @@ -62,9 +65,9 @@ def get_output_dir(): if not output_dir: return os.path.join(os.path.abspath(script_dir), 'out') - if (sys.platform.startswith('darwin') and - (not os.getenv('GYP_GENERATORS') or - 'xcode' in os.getenv('GYP_GENERATORS'))): + if (sys.platform.startswith('darwin') and + (not os.getenv(ENVVAR_GYP_GENERATORS) or + 'xcode' in os.getenv(ENVVAR_GYP_GENERATORS))): print 'ERROR: variable SKIA_OUT is not valid on Mac (using xcodebuild)' sys.exit(-1); @@ -77,6 +80,20 @@ def get_output_dir(): if __name__ == '__main__': args = sys.argv[1:] + if not os.getenv(ENVVAR_GYP_GENERATORS): + print ('%s environment variable not set, using default' % + ENVVAR_GYP_GENERATORS) + if sys.platform.startswith('darwin'): + default_gyp_generators = 'xcode' + elif sys.platform.startswith('win'): + default_gyp_generators = 'msvs' + elif sys.platform.startswith('cygwin'): + default_gyp_generators = 'msvs' + else: + default_gyp_generators = 'make' + os.environ[ENVVAR_GYP_GENERATORS] = default_gyp_generators + print '%s is "%s"' % (ENVVAR_GYP_GENERATORS, os.getenv(ENVVAR_GYP_GENERATORS)) + # Set CWD to the directory containing this script. # This allows us to launch it from other directories, in spite of gyp's # finickyness about the current working directory. -- cgit v1.2.3