Closed Bug 1281968 Opened 8 years ago Closed 8 years ago

YouCompleteMe not seeing language version flags

Categories

(Firefox Build System :: Mach Core, enhancement)

enhancement
Not set
normal

Tracking

(firefox50 fixed)

RESOLVED FIXED
mozilla50
Tracking Status
firefox50 --- fixed

People

(Reporter: rillian, Assigned: ehsan.akhgari)

Details

Attachments

(1 file, 1 obsolete file)

Today I noticed Ycm was marking up C++11-only features in my source files, like the `auto` keyword and `F foo = {a, b, c}` struct initializers.

We generally build with `-std=gnu++11` but it looks like .ycm_extra_conf.py isn't getting this flag from mach.
Attached patch Workaround (obsolete) — Splinter Review
Here's a work-around patch, just forcing the flag unconditionally. Presumedly this breaks Ycm on non-C++ source files.

Ehsan, and idea what's going on here?
Attachment #8764789 - Flags: feedback?(ehsan)
So sorry for the long delay here, I was on vacation/sick...

So the way that this works is .ycm_extra_conf.py calls |./mach compileflags path/to/file.cpp| which in turn runs |make -C objdir/path/to showbuild|.  Running the showbuild target manually, I get:

                  CC =  /Users/ehsan/Downloads/clang+llvm-3.7.0-x86_64-apple-darwin/bin/clang -std=gnu99
                 CXX =  /Users/ehsan/Downloads/clang+llvm-3.7.0-x86_64-apple-darwin/bin/clang++ -std=gnu++11
                 CCC =  /Users/ehsan/Downloads/clang+llvm-3.7.0-x86_64-apple-darwin/bin/clang++ -std=gnu++11
                 CPP = /Users/ehsan/Downloads/clang+llvm-3.7.0-x86_64-apple-darwin/bin/clang -std=gnu99 -E
...

Note how the -std flags are specified in CXX and not CXXFLAGS!
Assignee: nobody → ehsan
Comment on attachment 8764789 [details] [diff] [review]
Workaround

My patch fixes this more properly.
Attachment #8764789 - Attachment is obsolete: true
Attachment #8764789 - Flags: feedback?(ehsan)
Attachment #8774812 - Flags: review?(gps) → review+
Pushed by eakhgari@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/0a1c5b06f3da
Include the flags passed through CC/CXX in ./mach compileflags; r=gps
https://hg.mozilla.org/mozilla-central/rev/0a1c5b06f3da
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla50
Thanks ehsan!
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: