aboutsummaryrefslogtreecommitdiff
path: root/make.py
diff options
context:
space:
mode:
authorepoger@google.com <epoger@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-07-13 21:30:14 +0000
committerepoger@google.com <epoger@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-07-13 21:30:14 +0000
commit0fb212581440a63edcc695a34302e96605989a11 (patch)
tree68753818d07bb52d194426b14fd43fbf6304506a /make.py
parentba7983e55ce15ddcd5534011935178760164fb9d (diff)
downloadskia-0fb212581440a63edcc695a34302e96605989a11.tar.gz
enable "make XXX" command-line builds on Windows
http://codereview.appspot.com/4717044/ git-svn-id: http://skia.googlecode.com/svn/trunk@1853 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'make.py')
-rw-r--r--make.py37
1 files changed, 30 insertions, 7 deletions
diff --git a/make.py b/make.py
index b1deaab933..346dd6c92a 100644
--- a/make.py
+++ b/make.py
@@ -19,6 +19,9 @@ import os
import shutil
import sys
+# TODO(epoger): allow caller to override BUILDTYPE
+BUILDTYPE = 'Debug'
+
# TODO(epoger): add special 'all' target
TARGET_CLEAN = 'clean'
@@ -30,8 +33,8 @@ GYP_SUBDIR = 'gyp'
# Simple functions that report what they are doing, and exit(1) on failure.
def cd(path):
print '> cd %s' % path
- if not os.path.exists(path):
- print 'path %s does not exist' % path
+ if not os.path.isdir(path):
+ print 'directory %s does not exist' % path
sys.exit(1)
os.chdir(path)
@@ -39,6 +42,11 @@ def rmtree(path):
print '> rmtree %s' % path
shutil.rmtree(path, ignore_errors=True)
+def mkdirs(path):
+ print '> mkdirs %s' % path
+ if not os.path.isdir(path):
+ os.makedirs(path)
+
def runcommand(command):
print '> %s' % command
if os.system(command):
@@ -92,21 +100,32 @@ def MakeWindows(args):
args: command line arguments as a list of strings
"""
CheckWindowsEnvironment()
- # TODO(epoger): what about parameters? (fixed vs float, debug vs release)
+
+ # TODO(epoger): what about fixed vs float?
# TODO(epoger): what about "make" flags (like -j) that Windows doesn't support?
# Run gyp_skia to prepare Visual Studio projects.
cd(SCRIPT_DIR)
runcommand('python gyp_skia')
-
+
+ # Prepare final output dir into which we will copy all binaries.
+ msbuild_working_dir = os.path.join(SCRIPT_DIR, OUT_SUBDIR, GYP_SUBDIR)
+ msbuild_output_dir = os.path.join(msbuild_working_dir, BUILDTYPE)
+ final_output_dir = os.path.join(SCRIPT_DIR, OUT_SUBDIR, BUILDTYPE)
+ mkdirs(final_output_dir)
+
for target in args:
# Check for special-case targets
if target == TARGET_CLEAN:
MakeClean()
else:
- cd(os.path.join(SCRIPT_DIR, OUT_SUBDIR, GYP_SUBDIR))
- runcommand('msbuild /target:%s %s.sln' % (target, target))
-
+ cd(msbuild_working_dir)
+ runcommand(
+ ('msbuild /nologo /property:Configuration=%s'
+ ' /target:%s /verbosity:minimal %s.sln') % (
+ BUILDTYPE, target, target))
+ runcommand('xcopy /y %s\* %s' % (
+ msbuild_output_dir, final_output_dir))
# main:
# dispatch to appropriate Make<Platform>() variant.
@@ -118,6 +137,10 @@ elif os.name == 'posix':
print 'Mac developers should not run this script; see ' \
'http://code.google.com/p/skia/wiki/GettingStartedOnMac'
sys.exit(1)
+ elif sys.platform == 'cygwin':
+ print 'Windows development on Cygwin is not currently supported; see ' \
+ 'http://code.google.com/p/skia/wiki/GettingStartedOnWindows'
+ sys.exit(1)
else:
print 'Unix developers should not run this script; see ' \
'http://code.google.com/p/skia/wiki/GettingStartedOnLinux'