Skip to content

Commit

Permalink
Merge pull request picotorrent#1263 from make-42/fixed-building-with-…
Browse files Browse the repository at this point in the history
…msvc-2022

Fixed building with MSVC 2022 and with new vcpkg versions
  • Loading branch information
vktr authored May 7, 2023
2 parents 4d808a5 + bc76b1d commit a669674
Show file tree
Hide file tree
Showing 18 changed files with 20 additions and 182 deletions.
2 changes: 1 addition & 1 deletion .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"isRoot": true,
"tools": {
"cake.tool": {
"version": "0.38.5",
"version": "3.0.0",
"commands": [
"dotnet-cake"
]
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
cmake_policy(SET CMP0092 NEW) # don't add /W3 as default
cmake_policy(SET CMP0115 OLD) # Source file extensions must be explicit.

set(VCPKG_OVERLAY_PORTS ${CMAKE_CURRENT_SOURCE_DIR}/vendor/vcpkg-overlays/ports)
# set(VCPKG_OVERLAY_PORTS ${CMAKE_CURRENT_SOURCE_DIR}/vendor/vcpkg-overlays/ports)
set(VCPKG_OVERLAY_TRIPLETS ${CMAKE_CURRENT_SOURCE_DIR}/vendor/vcpkg-overlays/triplets)
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_CURRENT_SOURCE_DIR}/vendor/vcpkg/scripts/buildsystems/vcpkg.cmake CACHE STRING "Vcpkg toolchain file")

Expand Down
15 changes: 7 additions & 8 deletions build.cake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#addin "nuget:?package=Cake.CMake&version=1.2.0"
#tool "nuget:?package=GitVersion.CommandLine&version=5.3.7"
#addin "nuget:?package=Cake.CMake&version=1.3.1"
#tool "nuget:?package=GitVersion.CommandLine&version=5.12.0"
#tool "nuget:?package=WiX&version=3.11.2"

//////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -44,9 +44,9 @@ Task("Generate-Project")
{
SourcePath = ".",
OutputPath = OutputDirectory,
Generator = "Visual Studio 16 2019",
Generator = "Visual Studio 17 2022",
Platform = platform == "x86" ? "Win32" : "x64",
Toolset = "v142",
Toolset = "v143",
Options = new []
{
$"-DGITVERSION_VAR_BRANCHNAME={Version.BranchName}",
Expand All @@ -68,8 +68,7 @@ Task("Build")
var settings = new MSBuildSettings()
.SetConfiguration(configuration)
.SetMaxCpuCount(0)
.UseToolVersion(MSBuildToolVersion.VS2019);

.UseToolVersion(MSBuildToolVersion.VS2022);
if(platform == "x86")
{
settings.WithProperty("Platform", "Win32")
Expand Down Expand Up @@ -164,7 +163,7 @@ Task("Build-Installer-Bootstrapper")
var settings = new MSBuildSettings()
.SetConfiguration(configuration)
.SetMaxCpuCount(0)
.UseToolVersion(MSBuildToolVersion.VS2019);
.UseToolVersion(MSBuildToolVersion.VS2022);

MSBuild("./src/installer/PicoTorrentBootstrapper.sln", settings);
});
Expand Down Expand Up @@ -194,7 +193,7 @@ Task("Build-Installer-Bundle")
OutputDirectory = BuildDirectory
});

WiXLight(BuildDirectory + File("PicoTorrentBundle.wixobj"), new LightSettings
WiXLight((BuildDirectory + File("PicoTorrentBundle.wixobj")).ToString(), new LightSettings
{
Extensions = new [] { "WixBalExtension", "WixNetFxExtension", "WixUtilExtension" },
OutputFile = PackagesDirectory + File(InstallerBundle)
Expand Down
2 changes: 1 addition & 1 deletion src/installer/BootstrapperCore.config
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</sectionGroup>
</configSections>
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/>
</startup>
<wix.bootstrapper>
<host assemblyName="PicoTorrentBootstrapper" />
Expand Down
2 changes: 1 addition & 1 deletion src/installer/PicoTorrentBootstrapper.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<OutputType>library</OutputType>
<RootNamespace>PicoTorrentBootstrapper</RootNamespace>
<AssemblyName>PicoTorrentBootstrapper</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WarningLevel>4</WarningLevel>
Expand Down
2 changes: 1 addition & 1 deletion src/installer/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/installer/Properties/Settings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/picotorrent/ui/dialogs/createtorrentdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

#include <boost/log/trivial.hpp>
#include <fmt/format.h>
#include <fmt/xchar.h>
#include <libtorrent/add_torrent_params.hpp>
#include <libtorrent/create_torrent.hpp>
#include <libtorrent/torrent_info.hpp>
Expand Down
1 change: 1 addition & 0 deletions src/picotorrent/ui/models/peerlistmodel.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "peerlistmodel.hpp"

#include <fmt/format.h>
#include <fmt/xchar.h>
#include <libtorrent/peer_info.hpp>

#include "../../core/utils.hpp"
Expand Down
1 change: 1 addition & 0 deletions src/picotorrent/ui/models/torrentlistmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#include <boost/log/trivial.hpp>
#include <fmt/format.h>
#include <fmt/xchar.h>

#include "../../bittorrent/torrenthandle.hpp"
#include "../../bittorrent/torrentstatus.hpp"
Expand Down
1 change: 1 addition & 0 deletions src/picotorrent/ui/models/trackerlistmodel.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "trackerlistmodel.hpp"

#include <fmt/format.h>
#include <fmt/xchar.h>
#include <libtorrent/announce_entry.hpp>
#include <libtorrent/peer_info.hpp>

Expand Down
1 change: 1 addition & 0 deletions src/picotorrent/ui/statusbar.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "statusbar.hpp"

#include <fmt/format.h>
#include <fmt/xchar.h>

#include "translator.hpp"
#include "../core/utils.hpp"
Expand Down
1 change: 1 addition & 0 deletions src/picotorrent/ui/torrentdetailsoverviewpanel.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "torrentdetailsoverviewpanel.hpp"

#include <fmt/format.h>
#include <fmt/xchar.h>
#include <wx/clipbrd.h>
#include <wx/dcbuffer.h>
#include <wx/sizer.h>
Expand Down
2 changes: 1 addition & 1 deletion vendor/vcpkg
Submodule vcpkg updated 11017 files
26 changes: 0 additions & 26 deletions vendor/vcpkg-overlays/ports/libtorrent/CONTROL

This file was deleted.

25 changes: 0 additions & 25 deletions vendor/vcpkg-overlays/ports/libtorrent/fix-AppleClang-test.patch

This file was deleted.

31 changes: 0 additions & 31 deletions vendor/vcpkg-overlays/ports/libtorrent/no_use_iconv.patch

This file was deleted.

85 changes: 0 additions & 85 deletions vendor/vcpkg-overlays/ports/libtorrent/portfile.cmake

This file was deleted.

0 comments on commit a669674

Please sign in to comment.