irony-mode
irony-mode copied to clipboard
How to setup irony to use MSVC compile options?
Hi Guillaume, After building the irony-server.exe using cmake Visual Studio 14 2015 Win64 and setting up (company, yasnippet, irony and company-irony), I tested it in a very basic project and the completion using system headers is working fast and properly. In order to continue the setup of the C++ environment in emacs (windows), I would like to listen your advice/recommendation in the following points:
- How can I verify were the system headers are taken from? I don't know (even that it is working) where the headers are taken. I need to be sure that irony search msvs headers.
- I tried to setup project includes using .clang_complete but it didn't work. How can I do that? -I/inc
- I would like to have code navigation using either (ggtags, helm-gtags, rtags or company-gtags) the point is that I don't know which can be used on windows?
Bellow can you see, project structure, main.cpp and an extract of the init.el file with my currently setup of (company, yasnippet, irony and company-irony).
Thanks Levis
------project structure basic_project_root -> inc ----> std_lib_facilities.h -> main.cpp -> emacs_Shell.bat -> .clang_complete
// main.cpp
include
include
include "std_lib_facilities.h"
int main(int argc, char *argv[]) { std::string s1; s1 = "hello world"; s1.append(" desde kassel"); std::cout << "s1 = " << s1 << "\n"; //------------- keep_window_open(); return 0; }
;;; init.el (use-package company :ensure t :config (global-company-mode))
(use-package yasnippet :ensure t :init (progn (setq yas-verbosity 3) (yas-global-mode 1)) :config (yas-reload-all))
(use-package irony :commands irony-mode :init (setq w32-pipe-read-delay 0) (add-hook 'c-mode-hook 'irony-mode) (add-hook 'c++-mode-hook 'irony-mode) ;;(add-hook 'irony-mode-hook 'irony-cdb-autosetup-compile-options) :config ;(setq company-minimum-prefix-length 0) (use-package flycheck-irony :config (add-hook 'flycheck-mode-hook 'flycheck-irony-setup)))
(use-package company-irony :config (add-to-list 'company-backends 'company-irony))
;; Add yasnippet support for all company backends ;; https://github.com/syl20bnr/spacemacs/pull/179 (defvar company-mode/enable-yas t "Enable yasnippet for all backends.")
(defun company-mode/backend-with-yas (backend) "Company and yasnippet with BACKEND as argumet." (if (or (not company-mode/enable-yas) (and (listp backend) (member 'company-yasnippet backend))) backend (append (if (consp backend) backend (list backend)) '(:with company-yasnippet))))
(setq company-backends (mapcar #'company-mode/backend-with-yas company-backends))
I don't really use irony on Windows (actually I don't really use Windows), I just test the bare minimum because there is no good reason not to support it. User @3246251196 seems to use it more seriously and may give you some advices maybe.
I'm not sure but I think, libclang will pick up the MSVC headers if you have enabled the MSVC environment in your emacs, that is for example to setup vcvars.bat then launch emacs in from this terminal.
I tried to setup project includes using .clang_complete but it didn't work. How can I do that? -I/inc
I would expect a simple .clang_complete
to work like on Linux, I think I tried it on irony-server.
I would like to have code navigation using either (ggtags, helm-gtags, rtags or company-gtags) the point is that I don't know which can be used on windows?
I do not use this and I don't know either, sorry.
Hi,
Yes I do use Windows since our hands are tied to do so at work. I use GNU/Linux at home. This - in a way - is handy since I have some knowledge of the different OS for setting up Emacs IDE like environment.
Anyway, to answer your question on code navigation; I very, very often use cscope and etags to navigate around my projects at work. You can get a Windows cscope binary and ctags binary. I have an alias or a bash function (we use MinGW / msys at work )which will run something like:
function doMyTags
{
find . -type f -regex ".*\.\(cpp\|h\)" > cscope.files
cscope -bq -i cscope.file
etags - < cscope.files
}
I load up something like xcscope.el in my emacs init file and now I can just run M-x cscope-find-global-definition etc etc (map these to keys if you want). And I can run M-. on symbols to use the TAGS file.
So, for the first question about the include files and Clang. This is actually quite complex. #221 As @Sarcasm points to - the source code for Clang tries to help as much as possible (at least in the version linked to in that thread). It will try to look for the Visual Studio include files.
I must say: until recently I just assumed that the correct include files were getting picked up for me. This is actually not true in my case... I tried to use std::to_string which did not show up. It was not because I had not issued a std=c++11 flag, it was because, even though c++11 was enabled, clang has - all this time - been using the include file from MinGW. I actually need to work on this, but I think it should be fairly simple to fix; I just have not had time since we are switching machines at work. I wil test this out soon and report back.
Anyway, you can see which include files Clang looks for by issuing a -v flag to the clang compiler. For instance, create a simple hello world application. Run something like
clang++.exe -v main.c -o out
It will list the directories it looks in. Generally, for us unfortunate enough to use Windows it will not look in the MSVC include directory first. But this should be solvable.
Go back to your hello world application and run
clang++.exe -v -isystem /some/random/path -o out
This time you will notice that /some/random/path is the first directory to be searched for in the output of the clang compiler. I have not actually tried this yet but I will soon.
I think I did try this because I only had a short amount of time and I was getting other errors. But I am almost sure that was because I also need to supply the windows SDK header includes to be searched also! Again, I will report on this soon.
Putting a .clang_complete file is all I have ever done in my projects for Windows (we use MSVC also at work) - even though I avoid it and do all my IDE in emacs at all costs - except for the debugging. I have to say, MSVC is a nice debugger. So I have a F key I press which will open the current source file in the correct .sln file and it just loads MSVC ide.
It should be enough to have something like:
-I/path/to/BOOSTforexample
-I/path/to/someOtherLibraryHeaders
-D_SOMEDEF_
-std=c++11
BTW, i have never used vcvars or told emacs about the Windows environment. It would be nice to have a link to setting this up maybe. https://github.com/llvm-mirror/clang/blob/2abbec88f288baf3c2dc2c2f67a63f6cba3a41e7/lib/Driver/MSVCToolChain.cpp#L431-L493
When looking at this, again, it seems like using that batch file would help but I would need to look at the documentation. Plus, I think just inserting the includes manually (the SDK/VC dirs) would work since that is all the code seems to be doing. I will report back.
BTW, i have never used vcvars or told emacs about the Windows environment. It would be nice to have a link to setting this up maybe.
Are you asking for a how-to on this? I have some notes on my Windows which I can share (maybe on the Wiki).
When I had time at the office I ttried opening up a CMD windows. I then ran vcvarsall.bat for amd64. Sure, this sets all the environment like the INCLUDE variables. But when I tried to compile with clang the -v still shows that it took the mingw includes first. In fact nothing from INCLUDEs was even searched for in output of -v.
A link to your notes would sure be nice.
Thanks.
Hi,
Let me first tell you that the solution suggested for @3246251196 to navigate through the code using cscope and etags is working properly. Now I can jump using M-. and M-* to come back. It works for project headers but with system headers not jet (this allow me to introduce the second part)
In relation to the priority of irony to search system headers, I make some experiments today in order to reproduced was @3246251196 suggested. In fact when compiling clang++.exe -v main.cpp -o out the headers search is: #include "..." search starts here: #include <...> search starts here: C:\MinGW\lib\gcc\mingw32\4.5.2\include\c++ C:\MinGW\lib\gcc\mingw32\4.5.2\include\c++\mingw32 C:\MinGW\lib\gcc\mingw32\4.5.2\include\c++\backward C:\Program Files\LLVM-3.7.1\bin..\lib\clang\3.7.1\include C:\MinGW\lib\gcc\mingw32\4.5.2\include C:\MinGW\lib\gcc\mingw32\4.5.2\include-fixed C:\MinGW\include End of search list.
If the following option clang++.exe -v -isystem C:/home/projects/basic_project -v main.cpp -o out is used, the results are: #include "..." search starts here: #include <...> search starts here: C:/home/projects/basic_project C:\MinGW\lib\gcc\mingw32\4.5.2\include\c++ C:\MinGW\lib\gcc\mingw32\4.5.2\include\c++\mingw32 C:\MinGW\lib\gcc\mingw32\4.5.2\include\c++\backward C:\Program Files\LLVM-3.7.1\bin..\lib\clang\3.7.1\include C:\MinGW\lib\gcc\mingw32\4.5.2\include C:\MinGW\lib\gcc\mingw32\4.5.2\include-fixed C:\MinGW\include End of search list.
It confirms that MSVC headers are not listed. Additionally, I am using all the time a batch file to lunch emacs and setup the environment variables: @set project_dir=%cd% @set PATH=%PATH%;%project_dir% @set environment_dir= c:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin @cd /d %environment_dir% @call vcvars32.bat ::------------------------------------------- @cd /d %project_dir% @prompt $p$$g$s ::------------------------------------------- @call emacs --debug-init @%COMSPEC% /K_
I verify exec-path in emacs and the VC enviroment variables are visible for emacs and it means that irony are not seeing these variables.
There are two projects that should have the solution to the problem (I suppose that, it looks like) https://github.com/yaruopooner/ac-clang https://github.com/yaruopooner/msvc
Yes, the link with the notes is an excellent idea. Thank you!
Ok, so one can actually forget about calling vcvars.bat manually apparently, Clang will find the things on its own.
You are looking at the output of clang++.exe
, but a better candidate when you want MSVC-like things is to look at clang-cl.exe
.
In my case I got this:
$ clang-cl.exe -v -c test.c
clang-cl.exe -v -c ../projects/test.c
clang version 3.5.0 (217039)
Target: i686-pc-windows-msvc
Thread model: posix
"C:\Program Files (x86)\LLVM\bin\clang-cl.exe" -cc1 -triple i686-pc-windows-msvc <snip...> test.c
clang -cc1 version 3.5.0 based upon LLVM 3.5.0 default target i686-pc-windows-gnu
#include "..." search starts here:
#include <...> search starts here:
C:\Program Files (x86)\LLVM\bin\..\lib\clang\3.5.0\include
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include
C:\Program Files (x86)\Windows Kits\8.1\include
End of search list.
...
Compared with clang++.exe
:
clang++.exe -v -c ../projects/test.c
clang++.exe -v -c ../projects/test.c
clang version 3.5.0 (217039)
Target: i686-pc-windows-gnu
Thread model: posix
clang++.exe: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated
"C:\Program Files (x86)\LLVM\bin\clang++.exe" -cc1 -triple i686-pc-windows-gnu <snip...> test.c
clang -cc1 version 3.5.0 based upon LLVM 3.5.0 default target i686-pc-windows-gnu
....
ignoring nonexistent directory "c:/MinGW/lib/gcc/mingw32/4.7.1/include/c++"
...
#include "..." search starts here:
#include <...> search starts here:
C:\Program Files (x86)\LLVM\bin\..\lib\clang\3.5.0\include
C:\Program Files (x86)\LLVM\bin\..\lib\clang\3.5.0\../../../include
End of search list.
You can see that clang-cl
uses a different triple, you can get the msvc stuff by doing this:
clang++.exe -v -target i686-pc-windows-msvc -c test.c
Then you may want to add the following flags too for better MSVC compatibility:
-fms-extensions -fms-compatibility -fms-compatibility-version=17.00 -fdelayed-template-parsing
Also taken from the clang-cl.exe -v
output.
@Sarcasm
That looks very useful. I can only try at work next week.
How does the invocation of clang-cl work in relation to completions in a buffer with irony-mode minor? I know that irony-mode will trigger clang to provide completions. I know that clang must compile the file/project for this to happen - but, will it use clang or clang-cl ?
Cheers.
Also, -fms-extensions (yes, I was having unknown __w64 issues with Clang at work today when I quickly tried this before going home and this flag has came up as a solution.
I think if we find a suitable solution in this thread then we can add the information to the main page in the Windows section. For example, the minimum flags that should be in .clang_complete when using MSVC (not necessarily minimum, but "suggested starting point").
How does the invocation of clang-cl work in relation to completions in a buffer with irony-mode minor?
The two aren't really related.
know that irony-mode will trigger clang to provide completions. I know that clang must compile the file/project for this to happen - but, will it use clang or clang-cl ?
Not exactly:
- irony-server does not really compile, it just parses (
-fsyntax-only
), it does not generate output files (.o, .S or such) - irony-server is not using clang, it is more like this (I'm simplifying things here but that should not matter):
- there exists a libclang which is a compiler as a library, it provides compiler informations through a library
- there exists clang, an executable that uses libclang to produce objects/binaries
- there exists irony-server which is an executable using libclang to produce completions
- there exists clang-cl which uses libclang and is mostly like clang but uses special command lines arguments by default to support msvc-style arguments (e.g
/DFOO=1
) and has msvc-compatible option enable by default (e.g:-fms-compatibility
)
So for irony-server
on Windows we may want to reproduce some parts of the special arguments that clang-cl
uses.
Also as another information that could be useful, if you want irony-mode to support cl
-style compile options, that is /nologo /EHsc h-DFOO=1
, for example compile options you generated automatically based on clang-cl
output, you can tell libclang to understand them by using the following flag as an early argument --driver-mode=cl
.
E.g (not tested!):
clang++.exe -Imydir -DFOO=1 --driver-mode=cl /nologo /DWIN32 /D_WINDOWS /W3 /GR /EHsc /EHs-c- /D_HAS_EXCEPTIONS=0 foo.cpp
@Sarcasm
I modify my emacs_Shell.bat to call environment variables msvc x64, then, I run clang-cl.exe -v -o out main.cpp -o main.exe
and the result is:
clang-cl.exe -v -o out main.cpp -o main.exe
clang version 3.7.1 (tags/RELEASE_371/final)
Target: x86_64-w64-windows-msvc
Thread model: posix
....
#include "..." search starts here:
#include <...> search starts here:
C:\Program Files\LLVM-3.7.1\bin\..\lib\clang\3.7.1\include
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE
C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt
C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6\include\um
C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\shared
C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\um
C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\winrt
End of search list.
In file included from main.cpp:1:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\string:6:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\istream:6:
Now, I am playing with the includes and compiler flags in the .clang_complete
file. I added of course the suggested flag:
-target i686-pc-windows-msvc
-I/inc
Irony works as always but I still don't know were the headers are taken.
I try the following:
The root of my project is now the disc, c:. Then, I create a the TAGS file to search all headers in my disc. I added this #include <math.h>
in my project and then use M-. to go to the definition. In the minibuffer appeared the following question: Find tag (default math):
I pressed enter and the jump was to the file:
C:\cygwin64\lib\gcc\i686-pc-cygwin\4.9.2\include\c++\i686-pc-cygwin\bits\c++config.h
.
The tags files and irony mode are totally unrelated, neither of them uses the intelligence of the other. What I gave you, is a mean to get irony-server/libclang to use the msvc headers, that is all.
Thanks. I setup .clang_complete flags as follows:
-target i686-pc-windows-msvc
-fms-extensions
-fms-compatibility
-fms-compatibility-version=17.00
-fdelayed-template-parsing
-I/inc
To be sure that .clan_compile file is loaded, I use(add-hook 'irony-mode-hook 'irony-cdb-autosetup-compile-options)
, I reinforced the call of the environment variables and the tests with the clan_cl.exe and clang++.exe are also considering msvc headers (like in your tests). Nonetheless, the completion (in my case) is not seeing msvc headers, for instance, std::unique_ptr
is not working. Please let me know if you obtained completion of std::unique_ptr
in your tests.
For unique pointer you have included <memory>
. I think you need to set -std=c++11 in clang complete also.
Included 《memory》 **
It is one flag, command line argument per line.
You should put -target
and i686-pc-windows-msvc
on their own line.
Bad:
-target i686-pc-windows-msvc
-fms-extensions
-fms-compatibility
-fms-compatibility-version=17.00
-fdelayed-template-parsing
-I/inc
Good:
-target
i686-pc-windows-msvc
-fms-extensions
-fms-compatibility
-fms-compatibility-version=17.00
-fdelayed-template-parsing
-I/inc
To be sure that .clan_compile file is loaded
it is .clang_complete
, make sure you get the file right.
You can check the compile options with M-x irony-cdb-menu RET
.
Hi, now it is working, thanks!! Important:
- It was not necessary to add -std=c++11, it works just with the last suggestion from @Sarcasm. Now, I get completion from
std::unique_ptr
andstd::to_string
cool. - It is necessary to call environment variables for msvc (either x86 or x64).
- I tested without calling environment variables, and the following error appeared:
- It is necessary to call environment variables for msvc (either x86 or x64).
are you talking about vcvars here?
- I tested without calling environment variables, and the following error appeared:
This happens even in simple setup, e.g: when not using any external headers?
[Interesting. I am getting the same assertion failure regardless.
clang++.exe -v
clang version 3.7.1 (tags/RELEASE_371/final)
Target: i686-pc-windows-gnu
Thread model: posix
Here are my steps to test this (Windows 7 64):
Run cmd prompt,
then:
echo %INCLUDE%
--> %INCLUDE%
then:
call C:\Users\dix9yok>call "c:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\amd64\vcvars64.bat"
then:
echo %INCLUDE%
--> C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE;C:\Program Files(x86)\Microsoft Visual Studio 12.0\VC\ATLMFC\INCLUDE;C:\Program Files (x86)\Windows Kits\8.1\include\shared;C:\Program Files (x86)\Windows Kits\8.1\include\um;C:\Program Files (x86)\Windows Kits\8.1\include\winrt;
then:
c:\emacs-24.5\bin\runemacs.exe
then (when in Emacs - which automatically open up to a bash session for me; I cd into root of a project)
echo $INCLUDE
--> C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE;C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\ATLMFC\INCLUDE;C:\Program Files (x86)\Windows Kits\8.1\include\shared;C:\Program Files (x86)\Windows Kits\8.1\include\um;C:\Program Files (x86)\Windows Kits\8.1\include\winrt;
then
cat .clang_complete
```
--> -target i686-pc-windows-msvc -fms-extensions -fms-compatibility -fms-compatibility-version=17.00 -fdelayed-template-parsing -I/inc -D_MSC_VER -DWITH_UNIT_TESTS -D_DEBUG -std=c++11 -IMULTIPLEINCLUDESHERETO_BOOST_AND_OTHER_THINGS
then
Open a file which triggers my autoparse function - then the assertion seen above comes
====
after trying with a simple project I can confirm that it does work. Unfortunately it does not for the project at work which is really where I need it.
@Sarcasm
are you talking about vcvars here?
yes, either (x86 or x64)
This happens even in simple setup, e.g: when not using any external headers?
yes, it happens with the simple setup which in my case is:
-target
i686-pc-windows-msvc
@3246251196 the -std=c++11 compiler flag doesn't exist in msvc, probably you can suprime it.
@mambolevis
Hi, this is without -std=c++11 I still get the same issue. I have not played around with it for very long so I will see what happens tomorrow. It would be nice if there was more information in the error message from clang - I will search
It's possible that my research stopped at a similar issue when I tried these kind of experiments a few months ago.
It may be interesting to check if clang-cl
outputs more useful flags or to start debugging libclang, build it, debug it...
I have the feeling that the code causing the assert is something about the precompiled preamble maybe you can try to change irony-server to disable this feature and see if it works better. In server/src/TUManager.cpp:
@@ -48,7 +48,7 @@ TUManager::TUManager()
// significantly slower.
//
// -- https://github.com/Sarcasm/irony-mode/issues/4
- if (CINDEX_VERSION < 6) {
+ if (true) {
parseTUOptions_ &= ~CXTranslationUnit_PrecompiledPreamble;
}
}
Something else if that does not change anything is to do the same with another CXTranslationUnit_DetailedPreprocessingRecord
:
@@ -48,8 +48,9 @@ TUManager::TUManager()
// significantly slower.
//
// -- https://github.com/Sarcasm/irony-mode/issues/4
- if (CINDEX_VERSION < 6) {
+ if (true) {
parseTUOptions_ &= ~CXTranslationUnit_PrecompiledPreamble;
+ parseTUOptions_ &= ~CXTranslationUnit_DetailedPreprocessingRecord;
}
}
Also I would be curious to test with CXTranslationUnit_Incomplete
enabled.
Okay the problem has been solved.
@Sarcasm
Firstly, the source of the issue is due to our method of building at work. Basically, the source code includes a header file that is generated. To cut a long story short, when I develop I am including a header file that is not yet built.
The solution: Yes, I can use your suggested patches (I tried each permutation; i.e. I firstly tried just true-ing the condition, etc until I essentially had):
@@ -48,8 +48,9 @@ TUManager::TUManager()
// significantly slower.
//
// -- https://github.com/Sarcasm/irony-mode/issues/4
- if (CINDEX_VERSION < 6) {
+ if (true) {
parseTUOptions_ &= ~CXTranslationUnit_PrecompiledPreamble;
+ parseTUOptions_ &= ~CXTranslationUnit_DetailedPreprocessingRecord;
+ //I assume this is how to enable your last mentioned augmentation:
+ parseTUOptions_ |= CXTranslationUnit_Incomplete;
}
}
However, the ultimate solution is to really fix the issue. So, now I generate the header file (which is a separate project) and include it into the .clang_complete file, now I can revert the patch above (i.e. go back to an unchanged irony-server TUManager.cpp source) and when I open a random file in the project it parses the project/file without the assertion.
The good thing, here, is that by not applying those augmentations in the patch clang/irony is a lot quicker! (as indicated in the comments in TUManager.cpp)
Lastly, I did not need to run the vcvars*.bat - from what I have seen, the Clang source code guesses the right directories anyway! It is perhaps better to establish the environment properly though.
@Sarcasm I think we should include the bare minimum .clang_complete flags in the Documentation page IF using MSVC. It would also be good to link this ticket to other Windows tickets but more importantly rename the title of the thread to Irony And Visual Studio or something like that.
Donc, c'est bien et merci!
@3246251196 Hi, very good news. Thanks. What are the minimum .clang_complete flags according to your last tests?
@Sarcasm I modify my emacs_Shell.bat to call environment variables msvc x64, then, I run clang-cl.exe -v -o out main.cpp -o main.exe and the result is:
clang-cl.exe -v -o out main.cpp -o main.exe clang version 3.7.1 (tags/RELEASE_371/final) Target: x86_64-w64-windows-msvc
@mambolevis @Sarcasm I am actually curious how your setup works at all. The output suggests that you are using 64 bit version of Clang. Irony needs to either be manually told to build in a 64 bit context or... ? I am a little confused and would like to find out. How did you link to 64 bit clang?
Thank you.
Is there a question for me in there?
FYI I created a wiki page for now: https://github.com/Sarcasm/irony-mode/wiki/Setting-up-irony-mode-on-Windows-using-MSVC
Would be nice to sum up cleanly the findings so far.
@3246251196:
- could you confirm that the
--driver-mode=cl
bit works? If that works it means we could generate the compilation database automatically more easily on Windows - as you suggested I changed the title
@Sarcasm How can I change the parameters to clang-cl.exe ? It seems to be hardcoded to use -fsm-extention=18. But, I need to change it to 19.
More testing is necessary for 2015 MSVC because I am having problems with this one
Cheers.
@3246251196
I am actually curious how your setup works at all. The output suggests that you are using 64 bit version of Clang. Irony needs to either be manually told to build in a 64 bit context or... ? I am a little confused and would like to find out. How did you link to 64 bit clang?
I made just the following steps:
- Download
LLVM-3.7.1-win64.exe
binaries - Build
irony-server.exe
with cmakeVisual Studio 14 2015 Win64
- If you build irony-server outside (like in my case) don't forget to setup
irony-server-install-prefix
That's all, nothing especial.
I'm not sure but I think it will depend on the MSVC version it detected. Is your version of Clang recent enough for MSVC 2015 ? If yes, maybe the autodetection is not 100% correct and you may have to setup MSVC vars to the version you are interested in. -fsm-extention=18
How can I change the parameters to clang-cl.exe ? It seems to be hardcoded to use -fsm-extention=18. But, I need to change it to 19.
I'm not sure. I think
Seem to happen in lib/Driver/MSVCToolChain.cpp / lib/Driver/Tools.cpp
Of interest might be visualstudio::getMSVCVersion(), it seems to default to 18
if the guessing logic does not work. Would be nice to know what is the proper way. Maybe you have to set -fms-compatibility-version=<value>
or -fmsc-version
(http://clang.llvm.org/docs/UsersManual.html#id7).
@mambolevis
Hi,
I have no access interactive or not to irony-server-install-prefix.
I made just the following steps:
Download LLVM-3.7.1-win64.exe binaries Build irony-server.exe with cmake Visual Studio 14 2015 Win64 If you build irony-server outside (like in my case) don't forget to setup irony-server-install-prefix That's all, nothing especial.
I have never yet been able to build 64 bit version.
`irony-install-server
It defauls to:
cmake -DCMAKE_INSTALL_PREFIX\=c\:/Users/dix9yok/.emacs.d/irony/ c\:/Users/dix9yok/.emacs.d/irony-mode/server && cmake --build . --use-stderr --config Release --target install
I change to
cmake -DCMAKE_INSTALL_PREFIX\=c\:/Users/dix9yok/.emacs.d/irony/ c\:/Users/dix9yok/.emacs.d/irony-mode/server && cmake -G "Visual Studio 14 2015 Win64" --build . --use-stderr --config Release --target install
And get
CMake Error: The source directory "C:/Users/dix9yok/AppData/Local/Temp/install" does not exist.
Specify --help for usage, or press the help button on the CMake GUI.
@3246251196 I only use the CMake GUI.
@mambolevis I just love the simplicity of Unix-like and good old Makefiles.
Can you tell me step-by-step how to build irony mode 64 bit using MSVC2015 using the GUI please?
Thank you : )