Commit 37accc2c authored by dzhioev's avatar dzhioev Committed by Commit bot

YCM works correctly when 'out' directory is a symlink.

BUG=NONE
TEST=manually
NOTRY=true

Review URL: https://codereview.chromium.org/519903002

Cr-Commit-Position: refs/heads/master@{#292709}
parent e95c9e29
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
import os import os
import os.path
import subprocess import subprocess
...@@ -165,13 +166,13 @@ def GetClangCommandFromNinjaForFilename(chrome_root, filename): ...@@ -165,13 +166,13 @@ def GetClangCommandFromNinjaForFilename(chrome_root, filename):
# try to use the default flags. # try to use the default flags.
return chrome_flags return chrome_flags
# Ninja needs the path to the source file from the output build directory.
# Cut off the common part and /.
subdir_filename = filename[len(chrome_root)+1:]
rel_filename = os.path.join('..', '..', subdir_filename)
out_dir = GetNinjaOutputDirectory(chrome_root) out_dir = GetNinjaOutputDirectory(chrome_root)
# Ninja needs the path to the source file relative to the output build
# directory.
rel_filename = os.path.relpath(os.path.realpath(filename),
os.path.realpath(out_dir))
# Ask ninja how it would build our source file. # Ask ninja how it would build our source file.
p = subprocess.Popen(['ninja', '-v', '-C', out_dir, '-t', p = subprocess.Popen(['ninja', '-v', '-C', out_dir, '-t',
'commands', rel_filename + '^'], 'commands', rel_filename + '^'],
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment