Skip to content

Instantly share code, notes, and snippets.

@kosh04
Last active August 2, 2016 07:41
Show Gist options
  • Save kosh04/37bb86efd8d5f7046a480f96684df4a9 to your computer and use it in GitHub Desktop.
Save kosh04/37bb86efd8d5f7046a480f96684df4a9 to your computer and use it in GitHub Desktop.
Windows用irony-serverをビルドする

必要なもの

ビルド用ソースは irony-mode パッケージをインストールすると同梱してくる (~/.emacs/elpa/irony-/server)

また、生成した irony-server.exe は libclang.dll に依存するため LLVM にパスを通しておく必要がある。

(add-to-list 'exec-path "C:/path/to/LLVM/bin")

参考リンク

@echo off
setlocal
set LLVM_ROOT=C:\opt\LLVM
set PATH=%PATH%;C:\MinGW64\bin
set PATH=%PATH%;%LLVM_ROOT%\bin
set PATH=%PATH%;C:\opt\cmake\bin
set PATH=%PATH%;%HOME%\.emacs.d\bin
set OPTS=^
-DLIBCLANG_LIBRARY="%LLVM_ROOT%/bin/libclang.dll" ^
-DLIBCLANG_INCLUDE_DIR="%LLVM_ROOT%/include" ^
-DCMAKE_INSTALL_PREFIX="%HOME%/.emacs.d/irony/"
set emacs_dir=%HOME%/opt/emacs-24.5-IME-patched-generic-cpu
cmake %OPTS% -G "MinGW Makefiles" .. && cmake --build . --use-stderr --config Release --target install
C:\Users\kosh04\.emacs.d\elpa\irony-0.2.0\server\>mkdir build && cd build
C:\Users\kosh04\.emacs.d\elpa\irony-0.2.0\server\build>build.bat
-- The C compiler identification is GNU 5.1.0
-- The CXX compiler identification is GNU 5.1.0
-- Check for working C compiler: C:/MinGW64/bin/gcc.exe
-- Check for working C compiler: C:/MinGW64/bin/gcc.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: C:/MinGW64/bin/g++.exe
-- Check for working CXX compiler: C:/MinGW64/bin/g++.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Setting build type to 'Release' as none was specified
-- Performing Test HAS_STDCXX11
-- Performing Test HAS_STDCXX11 - Success
-- Performing Test HAS_CXX11_STDLIB
-- Performing Test HAS_CXX11_STDLIB - Success
-- C++11 compiler option(s): -std=c++11
-- Found LibClang: C:/opt/LLVM/bin/libclang.dll
-- Detecting libclang builtin headers directory
-- Detecting libclang builtin headers directory -- success
-- Irony package version is '0.2.0'
-- Found emacs: C:/Users/kosh04/opt/emacs-24.5-IME-patched-generic-cpu/bin/emacs.exe
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/kosh04/.emacs.d/elpa/irony-0.2.0/server/build
Scanning dependencies of target irony-server
[ 16%] Building CXX object src/CMakeFiles/irony-server.dir/support/CommandLineParser.cpp.obj
[ 33%] Building CXX object src/CMakeFiles/irony-server.dir/support/TemporaryFile.cpp.obj
[ 50%] Building CXX object src/CMakeFiles/irony-server.dir/Command.cpp.obj
[ 66%] Building CXX object src/CMakeFiles/irony-server.dir/Irony.cpp.obj
[ 83%] Building CXX object src/CMakeFiles/irony-server.dir/TUManager.cpp.obj
[100%] Building CXX object src/CMakeFiles/irony-server.dir/main.cpp.obj
Linking CXX executable ..\bin\irony-server.exe
[100%] Built target irony-server
Install the project...
-- Install configuration: "Release"
-- Installing: C:/Users/kosh04/.emacs.d/irony/bin/irony-server.exe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment