|
|
Created:
7 years, 10 months ago by James Simonsen Modified:
7 years, 10 months ago CC:
chromium-reviews, Nico Base URL:
svn://svn.chromium.org/chrome/trunk/src Visibility:
Public. |
DescriptionAdd a YouCompleteMe config for Chromium.
BUG=None
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=180827
Patch Set 1 #
Total comments: 3
Patch Set 2 : Query ninja directly about the source file #
Total comments: 1
Messages
Total messages: 12 (0 generated)
Try this out and let me know if it works for you.
https://codereview.chromium.org/12231005/diff/1/tools/vim/chromium.ycm_extra_... File tools/vim/chromium.ycm_extra_conf.py (right): https://codereview.chromium.org/12231005/diff/1/tools/vim/chromium.ycm_extra_... tools/vim/chromium.ycm_extra_conf.py:107: for name in os.listdir(out_dir): This won't work for files that haven't been compiled yet, will it? ninja has to know the mapping of source files -> output files in a way that doesn't involve going through the output dir so that it can know what to rebuild when files change
On 2013/02/05 21:15:53, jamesr wrote: > https://codereview.chromium.org/12231005/diff/1/tools/vim/chromium.ycm_extra_... > File tools/vim/chromium.ycm_extra_conf.py (right): > > https://codereview.chromium.org/12231005/diff/1/tools/vim/chromium.ycm_extra_... > tools/vim/chromium.ycm_extra_conf.py:107: for name in os.listdir(out_dir): > This won't work for files that haven't been compiled yet, will it? ninja has to > know the mapping of source files -> output files in a way that doesn't involve > going through the output dir so that it can know what to rebuild when files > change I'm sure you can. This is just a first cut. I fully expect everyone to improve it.
https://codereview.chromium.org/12231005/diff/1/tools/vim/chromium.ycm_extra_... File tools/vim/chromium.ycm_extra_conf.py (right): https://codereview.chromium.org/12231005/diff/1/tools/vim/chromium.ycm_extra_... tools/vim/chromium.ycm_extra_conf.py:107: for name in os.listdir(out_dir): On 2013/02/05 21:15:53, jamesr wrote: > This won't work for files that haven't been compiled yet, will it? ninja has to > know the mapping of source files -> output files in a way that doesn't involve > going through the output dir so that it can know what to rebuild when files > change FWIW wrapping this in a try:/except: is needed, but this seems to work OK-ish even if there isn't a build with this
Neat! You probably need at least the -W flags too. And -isysroot on mac. Longer term, there was talk of having clang understand ninja files directly for its compilation db format and since YCM supports that, the need for this script might eventually go away. https://codereview.chromium.org/12231005/diff/1/tools/vim/chromium.ycm_extra_... File tools/vim/chromium.ycm_extra_conf.py (right): https://codereview.chromium.org/12231005/diff/1/tools/vim/chromium.ycm_extra_... tools/vim/chromium.ycm_extra_conf.py:110: # But really we want to build the .o, so trim off the .d. Urgh. Could you do something like `ninja -C out/Release -t commands | grep filename` and have a whitelist filter for the ones you need instead? (-IDFfmOW, -isysroot, -arch are probably all?) …oh, I see you're doing this below. Just pass `../../path/to/file.cc^` to ninja below, that'll build the first dependent of file.cc and you don't need to do this dance to get an .o name.
lgtm for this as a start. I have some other fixes in mind, but we can iterate a bit in tree before sending this out for wider dogfooding
(please address my file.cc^ comment above before landing.) On Tue, Feb 5, 2013 at 3:08 PM, <jamesr@chromium.org> wrote: > lgtm for this as a start. I have some other fixes in mind, but we can > iterate a > bit in tree before sending this out for wider dogfooding > > https://codereview.chromium.org/12231005/
On 2013/02/05 23:11:25, Nico wrote: > (please address my file.cc^ comment above before landing.) I'm not getting any output when I run that: $ ninja -v -C out/Release -t commands ../../content/common/resource_dispatcher.cc $ Do I need a different command?
On Tue, Feb 5, 2013 at 3:33 PM, <simonjam@chromium.org> wrote: > On 2013/02/05 23:11:25, Nico wrote: > >> (please address my file.cc^ comment above before landing.) >> > > I'm not getting any output when I run that: > > $ ninja -v -C out/Release -t commands > ../../content/common/resource_**dispatcher.cc > $ > > Do I need a different command? > The trailing "^" is important: src$ ninja -v -C out/Release/ -t commands ../../cc/layer_tree_host.cc^ cd ../../ui/gl; python generate_bindings.py "--header-paths=../../third_party/mesa/MesaLib/include:../../third_party/khronos" ../../out/Release/gen/ui/gl touch obj/ui/gl/gl.actions_rules_copies.stamp clang++ -MMD -MF obj/cc/cc.layer_tree_host.o.d -D_FILE_OFFSET_BITS=64 -DUSE_LINUX_BREAKPAD -DDISABLE_NACL -DCHROMIUM_BUILD -DUSE_DEFAULT_RENDER_THEME=1 -DUSE_LIBJPEG_TURBO=1 -DUSE_NSS=1 -DENABLE_ONE_CLICK_SIGNIN -DGTK_DISABLE_SINGLE_INCLUDES=1 -DENABLE_REMOTING=1 -DENABLE_WEBRTC=1 -DENABLE_PEPPER_THREADING -DENABLE_CONFIGURATION_POLICY -DENABLE_INPUT_SPEECH -DENABLE_NOTIFICATIONS -DENABLE_GPU=1 -DENABLE_EGLIMAGE=1 -DUSE_SKIA=1 -DENABLE_TASK_MANAGER=1 -DENABLE_EXTENSIONS=1 -DENABLE_PLUGIN_INSTALLATION=1 -DENABLE_PLUGINS=1 -DENABLE_SESSION_SERVICE=1 -DENABLE_THEMES=1 -DENABLE_BACKGROUND=1 -DENABLE_AUTOMATION=1 -DENABLE_GOOGLE_NOW=1 -DENABLE_LANGUAGE_DETECTION=1 -DENABLE_PRINTING=1 -DENABLE_CAPTIVE_PORTAL_DETECTION=1 -DENABLE_MANAGED_USERS=1 -DCC_IMPLEMENTATION=1 -DGL_GLEXT_PROTOTYPES -DSK_BUILD_NO_IMAGE_ENCODE -DSK_DEFERRED_CANVAS_USES_GPIPE=1 '-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' -DGR_AGGRESSIVE_SHADER_OPTS=1 -DSK_ENABLE_INST_COUNT=0 -DSK_USE_POSIX_THREADS -DU_USING_ICU_NAMESPACE=0 -DU_STATIC_IMPLEMENTATION -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -I../../third_party/icu/public/common -I../../third_party/icu/public/i18n -I../../third_party/khronos -I../../gpu -I../.. -I../../skia/config -I../../third_party/skia/src/core -I../../third_party/skia/include/config -I../../third_party/skia/include/core -I../../third_party/skia/include/effects -I../../third_party/skia/include/pdf -I../../third_party/skia/include/gpu -I../../third_party/skia/include/gpu/gl -I../../third_party/skia/include/pipe -I../../third_party/skia/include/ports -I../../third_party/skia/include/utils -I../../skia/ext -Igen/ui/gl -I../../third_party/mesa/MesaLib/include -I../../third_party/WebKit/Source/Platform/chromium -I../../third_party/WebKit/Source/Platform/chromium -Igen/webcore_headers -I../../third_party/npapi -I../../third_party/npapi/bindings -I../../v8/include -fstack-protector --param=ssp-buffer-size=4 -Werror -pthread -fno-exceptions -fno-strict-aliasing -Wno-unused-parameter -Wno-missing-field-initializers -fvisibility=hidden -pipe -fPIC -Wheader-hygiene -Wno-unused-function -Wno-char-subscripts -Wno-unnamed-type-template-args -Wno-c++11-extensions -Wno-covered-switch-default -Xclang -load -Xclang /hd2/chrome/src/tools/clang/scripts/../../../third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs.so -Xclang -add-plugin -Xclang find-bad-constructs -Xclang -plugin-arg-find-bad-constructs -Xclang skip-virtuals-in-implementations -fcolor-diagnostics -pthread -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -pthread -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/gtk-2.0 -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -Wno-format -Wno-unused-result -O2 -fdata-sections -ffunction-sections -fno-rtti -fno-threadsafe-statics -fvisibility-inlines-hidden -Wno-deprecated -c ../../cc/layer_tree_host.cc -o obj/cc/cc.layer_tree_host.o > https://codereview.chromium.**org/12231005/<https://codereview.chromium.org/1... >
Message was sent while issue was closed.
Thanks that was it. Fixed and landed. Please send out your fixes. I'll incorporate the rest of Nico's feedback later tonight.
Message was sent while issue was closed.
Thanks that was it. Fixed and landed. Please send out your fixes. I'll incorporate the rest of Nico's feedback later tonight.
Message was sent while issue was closed.
https://codereview.chromium.org/12231005/diff/9001/tools/vim/chromium.ycm_ext... File tools/vim/chromium.ycm_extra_conf.py (right): https://codereview.chromium.org/12231005/diff/9001/tools/vim/chromium.ycm_ext... tools/vim/chromium.ycm_extra_conf.py:74: return os.path.join(curdir, 'src') Something like this is in ninja_build.vim too. Maybe we can share that somehow? |