Tried forcing x64 arch

This commit is contained in:
Kylart 2019-11-04 12:33:57 +01:00
parent 72ecfcca2b
commit bd82ec75ec
7 changed files with 33 additions and 10 deletions

View File

@ -36,7 +36,7 @@ install:
- set BOOST_BUILD_PATH=%BOOST_ROOT%\tools\build
- echo %BOOST_ROOT%
- echo %BOOST_BUILD_PATH%
- set PATH=%PATH%;%BOOST_BUILD_PATH%\src\engine\bin.ntx86
- set PATH=%PATH%;%BOOST_BUILD_PATH%\src\engine\bin.ntx64
- ps: '"using msvc : 14.0 ;`nusing gcc : : : <cxxflags>-std=c++14 ;`n" | Set-Content $env:HOMEDRIVE\$env:HOMEPATH\user-config.jam'
- type %HOMEDRIVE%%HOMEPATH%\user-config.jam
- cd %ROOT_DIRECTORY%
@ -48,8 +48,6 @@ install:
- cd %BOOST_ROOT%
- bjam cxxstd=14 release --with-system --layout=system address-model=64 link=shared stage
- choco install ninja
- cd %APPVEYOR_BUILD_FOLDER%\bindings\lib\libtorrent
- mkdir build && cd build
- set BOOST_LIBRARYDIR=%BOOST_ROOT%\stage\lib

View File

@ -9,6 +9,8 @@ set(CMAKE_BUILD_TYPE Release)
# Windows things...
if (MSVC_VERSION GREATER_EQUAL "1900")
set(CMAKE_GENERATOR_PLATFORM x64)
include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("/std:c++14" _cpp_14_flag_supported)
if (_cpp_14_flag_supported)

View File

@ -42,6 +42,8 @@ std::wstring Wrapper::ToWideString(Napi::String input, Napi::Env env) {
std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>> converter;
return converter.from_bytes(_input);
} catch(std::range_error& e) {
(void)e;
size_t length = _input.length();
std::wstring result;

View File

@ -187,7 +187,7 @@ Napi::Value Client::GetClientInfo(const Napi::CallbackInfo& info) {
double download_rate = 0.0;
double upload_rate = 0.0;
float progress = 0;
int nb_torrents = torrents.size();
size_t nb_torrents = torrents.size();
for (auto const& torrent : torrents) {
lt::torrent_status status = torrent.status();

View File

@ -15,12 +15,6 @@
#ifndef BINDINGS_SRC_TORRENT_CLIENT_SESSION_H_
#define BINDINGS_SRC_TORRENT_CLIENT_SESSION_H_
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__)
// Windows 10, Needed by Boost
#define WINVER 0x0A00
#define _WIN32_WINNT 0x0A00
#endif
#include <napi.h>
#include <cstdlib>
@ -39,6 +33,7 @@
#include <libtorrent/torrent_flags.hpp>
#include <libtorrent/magnet_uri.hpp>
#include "windows.h"
#include "utils.h"
namespace LtSession {

View File

@ -23,6 +23,8 @@
#include <libtorrent/torrent_handle.hpp>
#include <libtorrent/torrent_status.hpp>
#include "windows.h"
namespace LtUtils {
Napi::Object formatTorrentInfo(Napi::Env env, lt::torrent_handle torrent);

View File

@ -0,0 +1,24 @@
/**
* Copyright (c) 2019 Kylart <kylart.dev@gmail.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*/
#ifndef BINDINGS_SRC_TORRENT_WINDOWS_H_
#define BINDINGS_SRC_TORRENT_WINDOWS_H_
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__)
// Windows 10, Needed by Boost
#define WINVER 0x0A00
#define _WIN32_WINNT 0x0A00
#endif
#endif // BINDINGS_SRC_TORRENT_WINDOWS_H_