Changeset 167667 in webkit


Ignore:
Timestamp:
Apr 22, 2014 10:38:15 AM (10 years ago)
Author:
ChangSeok Oh
Message:

[GTK] YCM choose a newer compile_commands.json in between Release or Debug
https://bugs.webkit.org/show_bug.cgi?id=131911

Reviewed by Martin Robinson.

common.get_build_path returns release path even though Debug configuration
is newer than Release. So YouCompleteMe is used to refer old build setup inadvertently.

  • gtk/ycm_extra_conf.py:

(get_build_path): Compare modified time of Release and Debug. And return a recent modified path.
(FlagsForFile):

Location:
trunk/Tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r167650 r167667  
     12014-04-22  ChangSeok Oh  <changseok.oh@collabora.com>
     2
     3        [GTK] YCM choose a newer compile_commands.json in between Release or Debug
     4        https://bugs.webkit.org/show_bug.cgi?id=131911
     5
     6        Reviewed by Martin Robinson.
     7
     8        common.get_build_path returns release path even though Debug configuration
     9        is newer than Release. So YouCompleteMe is used to refer old build setup inadvertently.
     10
     11        * gtk/ycm_extra_conf.py:
     12        (get_build_path): Compare modified time of Release and Debug. And return a recent modified path.
     13        (FlagsForFile):
     14
    1152014-04-21  Brent Fulgham  <bfulgham@apple.com>
    216
  • trunk/Tools/gtk/ycm_extra_conf.py

    r167482 r167667  
    6262
    6363
     64def get_build_path():
     65    webkitbuild_path = os.path.join(common.get_build_path(fatal=False), '..')
     66    if not os.path.exists(webkitbuild_path):
     67        return None
     68
     69    release_build_path = os.path.join(webkitbuild_path, 'Release')
     70    debug_build_path = os.path.join(webkitbuild_path, 'Debug')
     71
     72    try:
     73        release_mtime = os.path.getmtime(os.path.join(release_build_path, 'compile_commands.json'))
     74    except os.error:
     75        release_mtime = 0
     76    try:
     77        debug_mtime = os.path.getmtime(os.path.join(debug_build_path, 'compile_commands.json'))
     78    except os.error:
     79        debug_mtime = 0
     80
     81    return release_build_path if release_mtime >= debug_mtime else debug_build_path
     82
     83
    6484def FlagsForFile(filename, **kwargs):
    6585    """This is the main entry point for YCM. Its interface is fixed.
     
    89109        result['flags'].append("-includeconfig.h")
    90110
    91     build_path = os.path.normpath(common.get_build_path(fatal=False))
     111    build_path = os.path.normpath(get_build_path())
    92112    if not build_path:
    93113        print "Could not find WebKit build path."
Note: See TracChangeset for help on using the changeset viewer.