From f8eaf4854e9799ba3b74fab425be4e4bfcc0969f Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Fri, 22 Mar 2013 01:30:14 +0000 Subject: [PATCH] Clean only the build dir for the selected Python git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@73706 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- build.py | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/build.py b/build.py index 1800460c..b1f011c8 100755 --- a/build.py +++ b/build.py @@ -613,6 +613,15 @@ def checkCompiler(quiet=False): os.environ['LIBPATH'] = bytes(env['libpath']) +def getWafBuildBase(): + base = posixjoin('build', 'waf', PYVER) + if isWindows: + if PYTHON_ARCH == '64bit': + base = posixjoin(base, 'x64') + else: + base = posixjoin(base, 'x86') + return base + #--------------------------------------------------------------------------- # Command functions and helpers @@ -1070,11 +1079,13 @@ def copyWxDlls(options): +# just an alias for build_py now def cmd_waf_py(options, args): cmdTimer = CommandTimer('waf_py') cmd_build_py(options, args) + def cmd_build_py(options, args): cmdTimer = CommandTimer('build_py') waf = getWafCmd() @@ -1091,15 +1102,8 @@ def cmd_build_py(options, args): else: WX_CONFIG = 'wx-config' # hope it is on the PATH - - wafBuildBase = posixjoin('build', 'waf', PYVER) - if isWindows: - if PYTHON_ARCH == '64bit': - wafBuildBase = posixjoin(wafBuildBase, 'x64') - else: - wafBuildBase = posixjoin(wafBuildBase, 'x86') - wafBuildDir = wafBuildBase + wafBuildBase = wafBuildDir = getWafBuildBase() if isWindows: wafBuildDir = posixjoin(wafBuildBase, 'release') @@ -1251,7 +1255,7 @@ def cmd_clean_py(options, args): if isWindows and options.both: options.debug = True cfg = Config() - deleteIfExists('build/waf') + deleteIfExists(getWafBuildBase()) files = list() for wc in ['*.py', '*.pyc', '*.so', '*.dylib', '*.pyd', '*.pdb', '*.pi']: files += glob.glob(opj(cfg.PKGDIR, wc))