diff options
author | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-19 22:04:19 +0000 |
---|---|---|
committer | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-19 22:04:19 +0000 |
commit | 5956782071eb323f726315e166f2d84a5d135cc7 (patch) | |
tree | 2460750c0d5ff71b88974de928055c2a07cad4bb | |
parent | ba36188ddc58e19940da2cddcf0c59691b5f7803 (diff) | |
download | chromium_src-5956782071eb323f726315e166f2d84a5d135cc7.zip chromium_src-5956782071eb323f726315e166f2d84a5d135cc7.tar.gz chromium_src-5956782071eb323f726315e166f2d84a5d135cc7.tar.bz2 |
vim: Let ninja-build.vim detect Release correctly if out/Debug/protoc doesn't exist at all.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/9265016
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@118368 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | tools/vim/ninja-build.vim | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/tools/vim/ninja-build.vim b/tools/vim/ninja-build.vim index a882223..d47b0e7 100644 --- a/tools/vim/ninja-build.vim +++ b/tools/vim/ninja-build.vim @@ -1,4 +1,4 @@ -" Copyright (c) 2011 The Chromium Authors. All rights reserved. +" Copyright (c) 2012 The Chromium Authors. All rights reserved. " Use of this source code is governed by a BSD-style license that can be " found in the LICENSE file. " @@ -43,10 +43,13 @@ def guess_configuration(): def is_release_15s_newer(test_path): try: debug_mtime = os.path.getmtime(os.path.join(root, 'Debug', test_path)) + except os.error: + debug_mtime = 0 + try: rel_mtime = os.path.getmtime(os.path.join(root, 'Release', test_path)) - return rel_mtime - debug_mtime >= 15 except os.error: - return False + rel_mtime = 0 + return rel_mtime - debug_mtime >= 15 configuration = 'Debug' if is_release_15s_newer('build.ninja') or is_release_15s_newer('protoc'): configuration = 'Release' |