mingw64 + nvim + coc.nvim + nvim-dap : C++ windows - 03
3.1 ccls
https://github.com/MaskRay/ccls/wiki/Build
在msys中:
pacman -S --noconfirm mingw-w64-x86_64-clang mingw-w64-x86_64-clang-tools-extra mingw64/mingw-w64-x86_64-polly mingw-w64-x86_64-cmake mingw-w64-x86_64-jq mingw-w64-x86_64-ninja mingw-w64-x86_64-ncurses mingw-w64-x86_64-rapidjson mingw-w64-x86_64-clang-analyzer mingw-w64-x86_64-mlir
pacman -S --noconfirm cmake ninja clang
cd ccls
cmake -H. -BRelease -G Ninja -DCMAKE_CXX_FLAGS=-D__STDC_FORMAT_MACROS
ninja -C Release
3.1.1 依赖
pacman -S --noconfirm mingw-w64-x86_64-clang mingw-w64-x86_64-clang-tools-extra mingw64/mingw-w64-x86_64-polly mingw-w64-x86_64-cmake mingw-w64-x86_64-jq mingw-w64-x86_64-ninja mingw-w64-x86_64-ncurses mingw-w64-x86_64-rapidjson mingw-w64-x86_64-clang-analyzer mingw-w64-x86_64-mlir
$ pacman -S --noconfirm mingw-w64-x86_64-clang mingw-w64-x86_64-clang-tools-extra mingw64/mingw-w64-x86_64-polly mingw-w64-x86_64-cmake mingw-w64-x86_64-jq mingw-w64-x86_64-ninja mingw-w64-x86_64-ncurses mingw-w64-x86_64-rapidjson mingw-w64-x86_64-clang-analyzer mingw-w64-x86_64-mlir
warning: mingw-w64-x86_64-cmake-3.26.2-1 is up to date -- reinstalling
warning: mingw-w64-x86_64-ninja-1.11.1-3 is up to date -- reinstalling
warning: mingw-w64-x86_64-ncurses-6.4.20230211-1 is up to date -- reinstalling
resolving dependencies...
looking for conflicting packages...
Packages (13) mingw-w64-x86_64-libxml2-2.10.3-1 mingw-w64-x86_64-llvm-16.0.0-1
mingw-w64-x86_64-oniguruma-6.9.8-1 mingw-w64-x86_64-clang-16.0.0-1
mingw-w64-x86_64-clang-analyzer-16.0.0-1 mingw-w64-x86_64-clang-tools-extra-16.0.0-1
mingw-w64-x86_64-cmake-3.26.2-1 mingw-w64-x86_64-jq-1.6-5
mingw-w64-x86_64-mlir-16.0.0-1 mingw-w64-x86_64-ncurses-6.4.20230211-1
mingw-w64-x86_64-ninja-1.11.1-3 mingw-w64-x86_64-polly-16.0.0-1
mingw-w64-x86_64-rapidjson-1.1.0-5
Total Download Size: 248.58 MiB
Total Installed Size: 1912.06 MiB
Net Upgrade Size: 1807.61 MiB
:: Proceed with installation? [Y/n]
:: Retrieving packages...
mingw-w64-x86_64-polly-16.... 2.3 MiB 866 KiB/s 00:03 [###############################] 100%
mingw-w64-x86_64-clang-too... 13.7 MiB 3.64 MiB/s 00:04 [###############################] 100%
mingw-w64-x86_64-rapidjson... 1237.0 KiB 233 KiB/s 00:05 [###############################] 100%
mingw-w64-x86_64-libxml2-2... 1030.8 KiB 193 KiB/s 00:05 [###############################] 100%
mingw-w64-x86_64-jq-1.6-5-any 275.4 KiB 93.3 KiB/s 00:03 [###############################] 100%
mingw-w64-x86_64-clang-16.... 50.0 MiB 3.84 MiB/s 00:13 [###############################] 100%
mingw-w64-x86_64-oniguruma... 223.2 KiB 88.7 KiB/s 00:03 [###############################] 100%
mingw-w64-x86_64-llvm-16.0... 88.6 MiB 6.42 MiB/s 00:14 [###############################] 100%
mingw-w64-x86_64-clang-ana... 104.3 KiB 81.4 KiB/s 00:01 [###############################] 100%
mingw-w64-x86_64-mlir-16.0... 91.3 MiB 4.81 MiB/s 00:19 [###############################] 100%
Total (10/10) 248.6 MiB 13.1 MiB/s 00:19 [###############################] 100%
(13/13) checking keys in keyring [###############################] 100%
(13/13) checking package integrity [###############################] 100%
(13/13) loading package files [###############################] 100%
(13/13) checking for file conflicts [###############################] 100%
(13/13) checking available disk space [###############################] 100%
:: Processing package changes...
( 1/13) installing mingw-w64-x86_64-libxml2 [###############################] 100%
Optional dependencies for mingw-w64-x86_64-libxml2
mingw-w64-x86_64-python: Python bindings [installed]
( 2/13) installing mingw-w64-x86_64-llvm [###############################] 100%
( 3/13) installing mingw-w64-x86_64-clang [###############################] 100%
( 4/13) installing mingw-w64-x86_64-clang-tools-extra [###############################] 100%
( 5/13) installing mingw-w64-x86_64-polly [###############################] 100%
( 6/13) reinstalling mingw-w64-x86_64-ninja [###############################] 100%
( 7/13) reinstalling mingw-w64-x86_64-cmake [###############################] 100%
( 8/13) installing mingw-w64-x86_64-oniguruma [###############################] 100%
( 9/13) installing mingw-w64-x86_64-jq [###############################] 100%
(10/13) reinstalling mingw-w64-x86_64-ncurses [###############################] 100%
(11/13) installing mingw-w64-x86_64-rapidjson [###############################] 100%
(12/13) installing mingw-w64-x86_64-clang-analyzer [###############################] 100%
(13/13) installing mingw-w64-x86_64-mlir [###############################] 100%
3.1.2 build
在msys中:
cd /c/gnu/tool/ccls
cmake -H. -BRelease -G Ninja -DCMAKE_CXX_FLAGS=-D__STDC_FORMAT_MACROS
ninja -C Release
$ cmake -H. -BRelease -G Ninja -DCMAKE_CXX_FLAGS=-D__STDC_FORMAT_MACROS
-- The CXX compiler identification is GNU 12.2.0
-- The C compiler identification is GNU 12.2.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/gnu/msys64/mingw64/bin/c++.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/gnu/msys64/mingw64/bin/cc.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Setting build type to 'Release' as none was specified.
-- Performing Test HAVE_FFI_CALL
-- Performing Test HAVE_FFI_CALL - Success
-- Found FFI: C:/gnu/msys64/mingw64/lib/libffi.dll.a
-- Found ZLIB: C:/gnu/msys64/mingw64/lib/libz.dll.a (found version "1.2.13")
-- Found zstd: C:/gnu/msys64/mingw64/lib/libzstd.dll.a
-- Found LibXml2: C:/gnu/msys64/mingw64/lib/libxml2.dll.a (found version "2.10.3")
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- RapidJSON found. Headers: /mingw64/include
-- Configuring done (1.6s)
-- Generating done (0.0s)
-- Build files have been written to: C:/gnu/tool/ccls/Release
$ ninja -C Release
ninja: Entering directory `Release'
[14/43] Building CXX object CMakeFiles/ccls.dir/src/query.cc.obj
In file included from C:/gnu/tool/ccls/src/indexer.hh:6,
from C:/gnu/tool/ccls/src/query.hh:6,
from C:/gnu/tool/ccls/src/query.cc:4:
In constructor 'ccls::SymbolInformation::SymbolInformation(ccls::SymbolInformation&&)',
inlined from 'constexpr std::_Optional_payload_base<_Tp>::_Storage<_Up, false>::_Storage(std::in
_place_t, _Args&& ...) [with _Args = {ccls::SymbolInformation}; _Up = ccls::SymbolInformation; _Tp =
ccls::SymbolInformation]' at C:/gnu/msys64/mingw64/include/c++/12.2.0/optional:244:8,
inlined from 'constexpr std::_Optional_payload_base<_Tp>::_Optional_payload_base(std::in_place_t
, _Args&& ...) [with _Args = {ccls::SymbolInformation}; _Tp = ccls::SymbolInformation]' at C:/gnu/ms
ys64/mingw64/include/c++/12.2.0/optional:126:4,
inlined from 'constexpr std::_Optional_payload<ccls::SymbolInformation, true, false, false>::_Op
tional_payload(std::in_place_t, _Args&& ...) [with _Args = {ccls::SymbolInformation}][inherited from
std::_Optional_payload_base<ccls::SymbolInformation>]' at C:/gnu/msys64/mingw64/include/c++/12.2.0/
optional:397:42,
inlined from 'constexpr std::_Optional_payload<ccls::SymbolInformation, false, false, false>::_O
ptional_payload(std::in_place_t, _Args&& ...) [with _Args = {ccls::SymbolInformation}][inherited fro
m std::_Optional_payload_base<ccls::SymbolInformation>]' at C:/gnu/msys64/mingw64/include/c++/12.2.0
/optional:431:57,
inlined from 'constexpr std::_Optional_base<_Tp, <anonymous>, <anonymous> >::_Optional_base(std:
:in_place_t, _Args&& ...) [with _Args = {ccls::SymbolInformation}; typename std::enable_if<is_constr
uctible_v<_Tp, _Args ...>, bool>::type <anonymous> = false; _Tp = ccls::SymbolInformation; bool <ano
nymous> = false; bool <anonymous> = false]' at C:/gnu/msys64/mingw64/include/c++/12.2.0/optional:521
:4,
inlined from 'constexpr std::optional<_Tp>::optional(_Up&&) [with _Up = ccls::SymbolInformation;
typename std::enable_if<__and_v<std::__not_<std::is_same<std::optional<_Tp>, typename std::remove_c
v<typename std::remove_reference<_Up>::type>::type> >, std::__not_<std::is_same<std::in_place_t, typ
ename std::remove_cv<typename std::remove_reference<_Up>::type>::type> >, std::is_constructible<_Tp,
_Up>, std::is_convertible<_Up, _Tp> >, bool>::type <anonymous> = true; _Tp = ccls::SymbolInformatio
n]' at C:/gnu/msys64/mingw64/include/c++/12.2.0/optional:749:47,
inlined from 'std::optional<ccls::SymbolInformation> ccls::getSymbolInfo(DB*, SymbolIdx, bool)'
at C:/gnu/tool/ccls/src/query.cc:779:12:
C:/gnu/tool/ccls/src/lsp.hh:179:8: warning: 'info.ccls::SymbolInformation::kind' may be used uniniti
alized [-Wmaybe-uninitialized]
179 | struct SymbolInformation {
| ^~~~~~~~~~~~~~~~~
C:/gnu/tool/ccls/src/query.cc: In function 'std::optional<ccls::SymbolInformation> ccls::getSymbolIn
fo(DB*, SymbolIdx, bool)':
C:/gnu/tool/ccls/src/query.cc:770:23: note: 'info' declared here
770 | SymbolInformation info;
| ^~~~
[17/43] Building CXX object CMakeFiles/ccls.dir/src/project.cc.obj
In file included from C:/gnu/msys64/mingw64/include/clang/Basic/FileManager.h:21,
from C:/gnu/tool/ccls/src/clang_tu.hh:8,
from C:/gnu/tool/ccls/src/project.cc:6:
In member function 'unsigned int llvm::SmallDenseMap<KeyT, ValueT, InlineBuckets, KeyInfoT, BucketT>
::getNumBuckets() const [with KeyT = unsigned int; ValueT = int; unsigned int InlineBuckets = 4; Key
InfoT = llvm::DenseMapInfo<unsigned int>; BucketT = llvm::detail::DenseMapPair<unsigned int, int>]',
inlined from 'unsigned int llvm::DenseMapBase<DerivedT, KeyT, ValueT, KeyInfoT, BucketT>::getNum
Buckets() const [with DerivedT = llvm::SmallDenseMap<unsigned int, int>; KeyT = unsigned int; ValueT
= int; KeyInfoT = llvm::DenseMapInfo<unsigned int>; BucketT = llvm::detail::DenseMapPair<unsigned i
nt, int>]' at C:/gnu/msys64/mingw64/include/llvm/ADT/DenseMap.h:525:62,
inlined from 'BucketT* llvm::DenseMapBase<DerivedT, KeyT, ValueT, KeyInfoT, BucketT>::getBuckets
End() [with DerivedT = llvm::SmallDenseMap<unsigned int, int>; KeyT = unsigned int; ValueT = int; Ke
yInfoT = llvm::DenseMapInfo<unsigned int>; BucketT = llvm::detail::DenseMapPair<unsigned int, int>]'
at C:/gnu/msys64/mingw64/include/llvm/ADT/DenseMap.h:529:40,
inlined from 'void llvm::DenseMapBase<DerivedT, KeyT, ValueT, KeyInfoT, BucketT>::initEmpty() [w
ith DerivedT = llvm::SmallDenseMap<unsigned int, int>; KeyT = unsigned int; ValueT = int; KeyInfoT =
llvm::DenseMapInfo<unsigned int>; BucketT = llvm::detail::DenseMapPair<unsigned int, int>]' at C:/g
nu/msys64/mingw64/include/llvm/ADT/DenseMap.h:380:55,
inlined from 'void llvm::DenseMapBase<DerivedT, KeyT, ValueT, KeyInfoT, BucketT>::moveFromOldBuc
kets(BucketT*, BucketT*) [with DerivedT = llvm::SmallDenseMap<unsigned int, int>; KeyT = unsigned in
t; ValueT = int; KeyInfoT = llvm::DenseMapInfo<unsigned int>; BucketT = llvm::detail::DenseMapPair<u
nsigned int, int>]' at C:/gnu/msys64/mingw64/include/llvm/ADT/DenseMap.h:396:14,
inlined from 'void llvm::SmallDenseMap<KeyT, ValueT, InlineBuckets, KeyInfoT, BucketT>::grow(uns
igned int) [with KeyT = unsigned int; ValueT = int; unsigned int InlineBuckets = 4; KeyInfoT = llvm:
:DenseMapInfo<unsigned int>; BucketT = llvm::detail::DenseMapPair<unsigned int, int>]' at C:/gnu/msy
s64/mingw64/include/llvm/ADT/DenseMap.h:1077:31,
inlined from 'void llvm::DenseMapBase<DerivedT, KeyT, ValueT, KeyInfoT, BucketT>::grow(unsigned
int) [with DerivedT = llvm::SmallDenseMap<unsigned int, int>; KeyT = unsigned int; ValueT = int; Key
InfoT = llvm::DenseMapInfo<unsigned int>; BucketT = llvm::detail::DenseMapPair<unsigned int, int>]'
at C:/gnu/msys64/mingw64/include/llvm/ADT/DenseMap.h:537:40,
inlined from 'BucketT* llvm::DenseMapBase<DerivedT, KeyT, ValueT, KeyInfoT, BucketT>::InsertInto
BucketImpl(const KeyT&, const LookupKeyT&, BucketT*) [with LookupKeyT = unsigned int; DerivedT = llv
m::SmallDenseMap<unsigned int, int>; KeyT = unsigned int; ValueT = int; KeyInfoT = llvm::DenseMapInf
o<unsigned int>; BucketT = llvm::detail::DenseMapPair<unsigned int, int>]' at C:/gnu/msys64/mingw64/
include/llvm/ADT/DenseMap.h:586:17,
inlined from 'BucketT* llvm::DenseMapBase<DerivedT, KeyT, ValueT, KeyInfoT, BucketT>::InsertInto
Bucket(BucketT*, KeyArg&&, ValueArgs&& ...) [with KeyArg = const unsigned int&; ValueArgs = {}; Deri
vedT = llvm::SmallDenseMap<unsigned int, int>; KeyT = unsigned int; ValueT = int; KeyInfoT = llvm::D
enseMapInfo<unsigned int>; BucketT = llvm::detail::DenseMapPair<unsigned int, int>]' at C:/gnu/msys6
4/mingw64/include/llvm/ADT/DenseMap.h:547:37,
inlined from 'llvm::DenseMapBase<DerivedT, KeyT, ValueT, KeyInfoT, BucketT>::value_type& llvm::D
enseMapBase<DerivedT, KeyT, ValueT, KeyInfoT, BucketT>::FindAndConstruct(const KeyT&) [with DerivedT
= llvm::SmallDenseMap<unsigned int, int>; KeyT = unsigned int; ValueT = int; KeyInfoT = llvm::Dense
MapInfo<unsigned int>; BucketT = llvm::detail::DenseMapPair<unsigned int, int>]' at C:/gnu/msys64/mi
ngw64/include/llvm/ADT/DenseMap.h:326:29,
inlined from 'ValueT& llvm::DenseMapBase<DerivedT, KeyT, ValueT, KeyInfoT, BucketT>::operator[](
const KeyT&) [with DerivedT = llvm::SmallDenseMap<unsigned int, int>; KeyT = unsigned int; ValueT =
int; KeyInfoT = llvm::DenseMapInfo<unsigned int>; BucketT = llvm::detail::DenseMapPair<unsigned int,
int>]' at C:/gnu/msys64/mingw64/include/llvm/ADT/DenseMap.h:330:28,
inlined from 'int ccls::{anonymous}::computeGuessScore(std::string_view, std::string_view)' at C
:/gnu/tool/ccls/src/project.cc:322:12,
inlined from 'ccls::Project::Entry ccls::Project::findEntry(const std::string&, bool, bool)' at
C:/gnu/tool/ccls/src/project.cc:553:44:
C:/gnu/msys64/mingw64/include/llvm/ADT/DenseMap.h:1170:18: warning: '*(const llvm::SmallDenseMap<uns
igned int, int, 4, llvm::DenseMapInfo<unsigned int, void>, llvm::detail::DenseMapPair<unsigned int,
int> >::LargeRep*)((char*)&m + offsetof(llvm::SmallDenseMap<unsigned int, int, 4, llvm::DenseMapInfo
<unsigned int, void>, llvm::detail::DenseMapPair<unsigned int, int> >,llvm::SmallDenseMap<unsigned i
nt, int, 4, llvm::DenseMapInfo<unsigned int, void>, llvm::detail::DenseMapPair<unsigned int, int> >:
:storage.llvm::AlignedCharArrayUnion<llvm::detail::DenseMapPair<unsigned int, int>[4], llvm::SmallDe
nseMap<unsigned int, int, 4, llvm::DenseMapInfo<unsigned int, void>, llvm::detail::DenseMapPair<unsi
gned int, int> >::LargeRep>::buffer[0])).llvm::SmallDenseMap<unsigned int, int>::LargeRep::NumBucket
s' may be used uninitialized [-Wmaybe-uninitialized]
1170 | return Small ? InlineBuckets : getLargeRep()->NumBuckets;
| ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/gnu/tool/ccls/src/project.cc: In member function 'ccls::Project::Entry ccls::Project::findEntry(c
onst std::string&, bool, bool)':
C:/gnu/tool/ccls/src/project.cc:317:38: note: 'm' declared here
317 | llvm::SmallDenseMap<unsigned, int> m;
| ^
[29/43] Building CXX object CMakeFiles/ccls.dir/src/messages/textDocument_code.cc.obj
In file included from C:/gnu/msys64/mingw64/include/llvm/Support/FormatVariadic.h:34,
from C:/gnu/tool/ccls/src/messages/textDocument_code.cc:8:
In static member function 'static size_t llvm::detail::HelperFunctions::consumeNumHexDigits(llvm::St
ringRef&, llvm::HexPrintStyle, size_t)',
inlined from 'static void llvm::format_provider<T, typename std::enable_if<llvm::detail::use_int
egral_formatter<T>::value, void>::type>::format(const T&, llvm::raw_ostream&, llvm::StringRef) [with
T = int]' at C:/gnu/msys64/mingw64/include/llvm/Support/FormatProviders.h:135:35,
inlined from 'void llvm::detail::provider_format_adapter<T>::format(llvm::raw_ostream&, llvm::St
ringRef) [with T = int&]' at C:/gnu/msys64/mingw64/include/llvm/Support/FormatVariadicDetails.h:40:4
5:
C:/gnu/msys64/mingw64/include/llvm/Support/FormatProviders.h:95:27: warning: 'HS' may be used uninit
ialized [-Wmaybe-uninitialized]
95 | if (isPrefixedHexStyle(Style))
| ~~~~~~~~~~~~~~~~~~^~~~~~~
C:/gnu/msys64/mingw64/include/llvm/Support/FormatProviders.h: In member function 'void llvm::detail:
:provider_format_adapter<T>::format(llvm::raw_ostream&, llvm::StringRef) [with T = int&]':
C:/gnu/msys64/mingw64/include/llvm/Support/FormatProviders.h:132:19: note: 'HS' was declared here
132 | HexPrintStyle HS;
| ^~
[43/43] Linking CXX executable ccls.exe
3.1.3
将编译得来的 ccls.exe
放到 C:\gnu\cli
3.2 nvim
https://github.com/neovim/neovim/releases/download/stable/nvim-win64.zip
添加到 windows
系统环境变量 path
C:\gnu\tool\nvim\bin