Fix crash on Windows with out_of_range exception & update docs

remotes/origin/HEAD
Konstantinos Sideris 6 years ago
parent 5b5d35fd1f
commit 765ff5dcb5
  1. 14
      CMakeSettings.json
  2. 27
      README.md
  3. 6
      include/Cache.h

@ -11,9 +11,13 @@
"name": "CMAKE_TOOLCHAIN_FILE", "name": "CMAKE_TOOLCHAIN_FILE",
"value": "${workspaceRoot}\\vcpkg\\scripts\\buildsystems\\vcpkg.cmake" // <-- change vcpkg location here "value": "${workspaceRoot}\\vcpkg\\scripts\\buildsystems\\vcpkg.cmake" // <-- change vcpkg location here
}, },
{
"name": "CMAKE_INSTALL_PREFIX",
"value": "${workspaceRoot}/.deps"
},
{ {
"name": "Qt5_DIR", "name": "Qt5_DIR",
"value": "C:\\Qt\\5.10.1\\msvc2017_64\\lib\\cmake\\Qt5" // <-- change qt location here "value": "C:\\Qt\\5.11.1\\msvc2017_64\\lib\\cmake\\Qt5" // <-- change qt location here
} }
] ]
}, },
@ -28,11 +32,15 @@
"name": "CMAKE_TOOLCHAIN_FILE", "name": "CMAKE_TOOLCHAIN_FILE",
"value": "${workspaceRoot}\\vcpkg\\scripts\\buildsystems\\vcpkg.cmake" // <-- change vcpkg location here "value": "${workspaceRoot}\\vcpkg\\scripts\\buildsystems\\vcpkg.cmake" // <-- change vcpkg location here
}, },
{
"name": "CMAKE_INSTALL_PREFIX",
"value": "${workspaceRoot}/.deps"
},
{ {
"name": "Qt5_DIR", "name": "Qt5_DIR",
"value": "C:\\Qt\\5.10.1\\msvc2017_64\\lib\\cmake\\Qt5" // <-- change qt location here "value": "C:\\Qt\\5.11.1\\msvc2017_64\\lib\\cmake\\Qt5" // <-- change qt location here
} }
] ]
}, },
] ]
} }

@ -133,14 +133,37 @@ brew install qt5 lmdb cmake llvm libsodium spdlog boost
Make sure to install the `MSVC 2017 64-bit` toolset for at least Qt 5.9 Make sure to install the `MSVC 2017 64-bit` toolset for at least Qt 5.9
(lower versions does not support VS2017). (lower versions does not support VS2017).
3. Install lmdb and openssl with `vcpkg`. You can simply clone it into a subfolder 3. Install dependencies with `vcpkg`. You can simply clone it into a subfolder
of the root nheko source directory. of the root nheko source directory.
```powershell ```powershell
git clone http:\\github.com\Microsoft\vcpkg git clone http:\\github.com\Microsoft\vcpkg
cd vcpkg cd vcpkg
.\bootstrap-vcpkg.bat .\bootstrap-vcpkg.bat
.\vcpkg install --triplet x64-windows lmdb openssl .\vcpkg install --triplet x64-windows \
boost-asio \
boost-beast \
boost-iostreams \
boost-random \
boost-signals2 \
boost-system \
boost-thread \
libsodium \
lmdb \
openssl \
zlib
```
4. Install dependencies not managed by vcpkg. (libolm, libmtxclient, libmatrix_structs)
Inside the project root run the following (replacing the path to vcpkg as necessary).
```bash
cmake -G "Visual Studio 15 2017 Win64" -Hdeps -B.deps
-DCMAKE_TOOLCHAIN_FILE=C:/Users/<your-path>/vcpkg/scripts/buildsystems/vcpkg.cmake
-DUSE_BUNDLED_BOOST=OFF
cmake --build .deps --config Release
cmake --build .deps --config Debug
``` ```
### Building ### Building

@ -48,11 +48,11 @@ struct SearchResult
QString display_name; QString display_name;
}; };
inline int static int
numeric_key_comparison(const MDB_val *a, const MDB_val *b) numeric_key_comparison(const MDB_val *a, const MDB_val *b)
{ {
auto lhs = std::stoul(std::string((char *)a->mv_data, a->mv_size)); auto lhs = std::stoull(std::string((char *)a->mv_data, a->mv_size));
auto rhs = std::stoul(std::string((char *)b->mv_data, b->mv_size)); auto rhs = std::stoull(std::string((char *)b->mv_data, b->mv_size));
if (lhs < rhs) if (lhs < rhs)
return 1; return 1;

Loading…
Cancel
Save