Sarcasm / irony-mode

A C/C++ minor mode for Emacs powered by libclang
GNU General Public License v3.0
906 stars 99 forks source link

NMake Makefiles generator causing error: invalid file size '<<' #335

Open markisus opened 7 years ago

markisus commented 7 years ago

I'm trying to run irony on Windows 10. I have a cmake project using cmake my_source_directory -G "NMake Makefiles" -DCMAKE_EXPORT_COMPILE_COMMANDS=ON. It has created the compile_commands.json file which looks like

[ { "directory": "C:/Users/mark/Documents/sfml_experiments/build", "command": "C:\\PROGRA~2\\MICROS~1.0\\VC\\bin\\amd64\\cl.exe @<< /nologo /TP -IC:\\PROGRA~1\\SFML\\include /DWIN32 /D_WINDOWS /W3 /GR /EHsc /D_DEBUG /MDd /Zi /Ob0 /Od /RTC1 /FoCMakeFiles\\main.dir\\main.cpp.obj /FdCMakeFiles\\main.dir\\ /FS -c C:\\Users\\mark\\Documents\\sfml_experiments\\main.cpp <<", "file": "C:/Users/mark/Documents/sfml_experiments/main.cpp" } ]

I tried to run M-x irony-completion-at-point-async which causes the error: irony process stopped message in buffer. I have additionally altered the irony.el so that the debug flag is used on irony-server and the log reports:

execute: Command{action=Command::GetCompileOptions, file='c:/Users/mark/Documents/sfml_experiments/main.cpp', dir='c:/Users/mark/Documents/sfml_experiments/build/', line=0, column=0, flags=[], unsavedFiles.count=0, opt=off} execute: Command{action=Command::GetCompileOptions, file='c:/Users/mark/Documents/sfml_experiments/main.cpp', dir='c:/Users/mark/Documents/sfml_experiments/build/', line=0, column=0, flags=[], unsavedFiles.count=0, opt=off} error: invalid file size '<<'

I'm not sure what the << character means or if it is valid inside a compile_commands.json file.

Sarcasm commented 7 years ago

irony won't work with this compilation database.

cl.exe arguments are not supported.

If your project is not too complex I would recommend creating a .clang_complete file by hand.

markisus commented 7 years ago

Oh that's disappointing. Can you elaborate on what the issue is? I know there is clang-cl.exe which I think tries to understand cl.exe arguments. I can try to work on a PR if there is a simple fix here but I don't know much about compiler flags.

Sarcasm commented 7 years ago

There is a page on the wiki:

The more information section also link to an issue:

Sarcasm commented 7 years ago

See also: