;;----------------------------------------
(require 'package)
(add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/"))
(package-initialize)
(add-hook 'after-init-hook 'global-company-mode)
(eval-after-load 'company '(add-to-list 'company-backends 'company-irony))
(add-hook 'c++-mode-hook 'irony-mode)
(add-hook 'c-mode-hook 'irony-mode)
(defun my-irony-mode-hook () (define-key irony-mode-map [remap completion-at-point] 'irony-completion-at-point-async)
(define-key irony-mode-map [remap complete-symbol] 'irony-completion-at-point-async))
(add-hook 'irony-mode-hook 'my-irony-mode-hook)
(add-hook 'irony-mode-hook 'irony-cdb-autosetup-compile-options)
(when (boundp 'w32-pipe-read-delay) (setq w32-pipe-read-delay 0))
(when (boundp 'w32-pipe-buffer-size) (setq irony-server-w32-pipe-buffer-size (* 64 1024)))
;;----------------------------------------
(require 'package) (add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/")) (package-initialize) (add-hook 'after-init-hook 'global-company-mode) (eval-after-load 'company '(add-to-list 'company-backends 'company-irony)) (add-hook 'c++-mode-hook 'irony-mode) (add-hook 'c-mode-hook 'irony-mode) (defun my-irony-mode-hook () (define-key irony-mode-map [remap completion-at-point] 'irony-completion-at-point-async) (define-key irony-mode-map [remap complete-symbol] 'irony-completion-at-point-async)) (add-hook 'irony-mode-hook 'my-irony-mode-hook) (add-hook 'irony-mode-hook 'irony-cdb-autosetup-compile-options) (when (boundp 'w32-pipe-read-delay) (setq w32-pipe-read-delay 0)) (when (boundp 'w32-pipe-buffer-size) (setq irony-server-w32-pipe-buffer-size (* 64 1024))) After that, I proceed to compile the Irony-server. The followed, with these steps have been the next ones:
(1) cd to Irony’s package site. D:\hh_home.emacs.d\elpa\irony-20171002.1130\server
(2) create build directory. mkdir build && cd build
(3) compile with cmake(cmake-3.9.4-win64-x64) typing in cmd these three commands
cd to Irony’s package site.
D:\hh_home\.emacs.d\elpa\irony-20171002.1130\servercreate build directory.
mkdir build && cd buildcompile with cmake(cmake-3.9.4-win64-x64) typing in cmd these three commands
cmake -DLIBCLANG_LIBRARY=D:\tt_tools\LLVM\5_0_0\llvm\bin\libclang.dll -G "MinGW Makefiles" ..
cmake -DLIBCLANG_LIBRARY=D:\tt_tools\LLVM\5_0_0\llvm\bin\libclang.dll -G "MinGW Makefiles" ..mingw32-make
mingw32-make"cmake" "-DCMAKE_INSTALL_PREFIX=d:/hh_home/.emacs.d/irony/" "d:/hh_home/.emacs.d/elpa/irony-20171002.1130/server" && "cmake" --build . --use-stderr --config Release --target install
"cmake" "-DCMAKE_INSTALL_PREFIX=d:/hh_home/.emacs.d/irony/" "d:/hh_home/.emacs.d/elpa/irony-20171002.1130/server" && "cmake" --build . --use-stderr --config Release --target install
To specify the compilation flags and the system header locations I’m using the following .clang_format file in D:\
;;----------------------------------------
-std=c++14
-target x86_64-w64-mingw32
-Wall
-pedantic
-DDEBUG
-ID:\tt_tools\mingw\distro\15_3\bin../lib/gcc/x86_64-w64-mingw32/7.2.0/../../../../include/c++/7.2.0
-ID:\tt_tools\mingw\distro\15_3\bin../lib/gcc/x86_64-w64-mingw32/7.2.0/../../../../include/c++/7.2.0/bits
-ID:\tt_tools\mingw\distro\15_3\bin../lib/gcc/x86_64-w64-mingw32/7.2.0/../../../../include/c++/7.2.0/x86_64-w64-mingw32
-ID:\tt_tools\mingw\distro\15_3\bin../lib/gcc/x86_64-w64-mingw32/7.2.0/../../../../include/c++/7.2.0/backward
-ID:\tt_tools\mingw\distro\15_3\bin../lib/gcc/x86_64-w64-mingw32/7.2.0/include
-ID:\tt_tools\mingw\distro\15_3\bin../lib/gcc/x86_64-w64-mingw32/7.2.0/include-fixed
-ID:\tt_tools\mingw\distro\15_3\bin../lib/gcc/x86_64-w64-mingw32/7.2.0/../../../../x86_64-w64-mingw32/include
;;----------------------------------------
-std=c++14 -target x86_64-w64-mingw32 -Wall -pedantic -DDEBUG -ID:\tt_tools\mingw\distro\15_3\bin\../lib/gcc/x86_64-w64-mingw32/7.2.0/../../../../include/c++/7.2.0 -ID:\tt_tools\mingw\distro\15_3\bin\../lib/gcc/x86_64-w64-mingw32/7.2.0/../../../../include/c++/7.2.0/bits -ID:\tt_tools\mingw\distro\15_3\bin\../lib/gcc/x86_64-w64-mingw32/7.2.0/../../../../include/c++/7.2.0/x86_64-w64-mingw32 -ID:\tt_tools\mingw\distro\15_3\bin\../lib/gcc/x86_64-w64-mingw32/7.2.0/../../../../include/c++/7.2.0/backward -ID:\tt_tools\mingw\distro\15_3\bin\../lib/gcc/x86_64-w64-mingw32/7.2.0/include -ID:\tt_tools\mingw\distro\15_3\bin\../lib/gcc/x86_64-w64-mingw32/7.2.0/include-fixed -ID:\tt_tools\mingw\distro\15_3\bin\../lib/gcc/x86_64-w64-mingw32/7.2.0/../../../../x86_64-w64-mingw32/include I’ve obtained the location of my paths typing cpp -xc++ -Wp,-v < NULcpp -xc++ -Wp,-v < NUL and copying literally from …search stars here. By the way: gcc version 7.2.0 (GCC), Target: x86_64-w64-mingw32 and Thread model: posix.