Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .vsconfig
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"Microsoft.VisualStudio.Component.VC.Redist.14.Latest",
"Microsoft.VisualStudio.ComponentGroup.NativeDesktop.Core",
"Microsoft.VisualStudio.Component.VC.CLI.Support",
"Microsoft.VisualStudio.Component.Windows10SDK.17763",
"Microsoft.VisualStudio.Component.Windows10SDK.18362",
"Microsoft.VisualStudio.Workload.NativeDesktop"
]
}
4 changes: 2 additions & 2 deletions CefSharp.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
<VisualStudioProductVersion>2013</VisualStudioProductVersion>
<VisualStudioProductVersion Condition="'$(VisualStudioVersion)'=='14.0'">2015</VisualStudioProductVersion>
<VisualStudioProductVersion Condition="'$(VisualStudioVersion)'=='15.0'">2017</VisualStudioProductVersion>
<VisualStudioProductVersion Condition="'$(VisualStudioVersion)'=='16.0'">2017</VisualStudioProductVersion>
<VisualStudioProductVersion Condition="'$(VisualStudioVersion)'=='16.0'">2019</VisualStudioProductVersion>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is where things get complicated, the default cef.sdk package only has VS2015 and VS2017 versions of the wrapper by default. With this change anyone using the packages from Nuget.org would be unable to build using VS2019

The VisualStudioProductVersion variable is used to determine which directory to load the .lib file from.

<AdditionalLibraryDirectories>$(SolutionDir)packages\$(CefSdkVer)\CEF\$(Platform)\$(Configuration);$(SolutionDir)packages\$(CefSdkVer)\CEF\$(Platform)\$(Configuration)\VS$(VisualStudioProductVersion)</AdditionalLibraryDirectories>

Maybe it's possible to have AppVeyor build VS2015, VS2017 and VS2019 versions of the wrapper. See https://www.appveyor.com/docs/windows-images-software/ for list of software installed by image.

Current image is https://github.com/cefsharp/cef-binary/blob/master/appveyor.yml#L1

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I could add the v142 to the default for cef-binary building but yeah we would have to change the appveyor default to vs2019 version. Now it makes sense why you had the newer vs versions targeting the older option.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VS2019 appears perfectly capable of compiling with a v141 lib file (as was promised by Microsoft that they'd be compatible).

I understand from your Docker build scripts you'd be looking to build everything with VS2019.

Open to suggestions here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Targeting v141 is no problem. With docker could even install V2017 and V2019 side by side without issue. In addition can easily patch in any changes to the code instead to manually change to v142. Keeping in on V141 for now would seem the best solution.


<PlatformToolset>v120</PlatformToolset>
<PlatformToolset Condition="'$(VisualStudioVersion)'=='14.0'">v140</PlatformToolset>
<PlatformToolset Condition="'$(VisualStudioVersion)'=='15.0'">v141</PlatformToolset>
<PlatformToolset Condition="'$(VisualStudioVersion)'=='16.0'">v142</PlatformToolset>

<WindowsTargetPlatformVersion Condition="'$(VisualStudioVersion)'=='16.0'">10.0.17763.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformVersion Condition="'$(VisualStudioVersion)'=='16.0'">10.0.18362.0</WindowsTargetPlatformVersion>

<CefSharpBrowserSubprocessPostBuildEvent>
<![CDATA[
Expand Down
28 changes: 19 additions & 9 deletions build.ps1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
param(
[ValidateSet("vs2015", "vs2017", "nupkg-only", "gitlink")]
[ValidateSet("vs2015", "vs2017", "vs2019", "nupkg-only", "gitlink")]
[Parameter(Position = 0)]
[string] $Target = "vs2015",
[Parameter(Position = 1)]
Expand Down Expand Up @@ -115,7 +115,7 @@ function TernaryReturn
function Msvs
{
param(
[ValidateSet('v140', 'v141')]
[ValidateSet('v140', 'v141', 'v142')]
[Parameter(Position = 0, ValueFromPipeline = $true)]
[string] $Toolchain,

Expand Down Expand Up @@ -144,11 +144,14 @@ function Msvs
$VisualStudioVersion = '14.0'
$VXXCommonTools = Join-Path $env:VS140COMNTOOLS '..\..\vc'
}
'v141' {
{($_ -eq 'v141') -or ($_ -eq 'v142')} {
$VS_VER = 15;
$VS_OFFICIAL_VER = 2017;
if ($_ -eq 'v142'){$VS_VER=16;$VS_OFFICIAL_VER=2019;}
$programFilesDir = (${env:ProgramFiles(x86)}, ${env:ProgramFiles} -ne $null)[0]

$vswherePath = Join-Path $programFilesDir 'Microsoft Visual Studio\Installer\vswhere.exe'
#Check if we already have vswhere which is included in newer versions of VS2017
#Check if we already have vswhere which is included in newer versions of VS2017/VS2019
if(-not (Test-Path $vswherePath))
{
Write-Diagnostic "Downloading VSWhere as no install found at $vswherePath"
Expand All @@ -166,17 +169,18 @@ function Msvs

Write-Diagnostic "VSWhere path $vswherePath"

$VS2017InstallPath = & $vswherePath -version 15 -property installationPath
$versionSearchStr = "[$VS_VER.0," + ($VS_VER+1) + ".0)"
$VS2017InstallPath = & $vswherePath -version $versionSearchStr -property installationPath

Write-Diagnostic "VS2017InstallPath: $VS2017InstallPath"
Write-Diagnostic "$($VS_OFFICIAL_VER)InstallPath: $VS2017InstallPath"

if(-not (Test-Path $VS2017InstallPath))
{
Die "Visual Studio 2017 is not installed on your development machine, unable to continue."
Die "Visual Studio $VS_OFFICIAL_VER is not installed on your development machine, unable to continue."
}

$MSBuildExe = "msbuild.exe"
$VisualStudioVersion = '15.0'
$VisualStudioVersion = "$VS_VER.0"
$VXXCommonTools = Join-Path $VS2017InstallPath VC\Auxiliary\Build
}
}
Expand Down Expand Up @@ -242,7 +246,7 @@ function Msvs
function VSX
{
param(
[ValidateSet('v140', 'v141')]
[ValidateSet('v140', 'v141', 'v142')]
[Parameter(Position = 0, ValueFromPipeline = $true)]
[string] $Toolchain
)
Expand Down Expand Up @@ -451,4 +455,10 @@ switch -Exact ($Target)
UpdateSymbolsWithGitLink
Nupkg
}
"vs2019"
{
VSX v142
UpdateSymbolsWithGitLink
Nupkg
}
}