diff options
Diffstat (limited to 'src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts')
206 files changed, 19078 insertions, 0 deletions
diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/addPoshVcpkgToPowershellProfile.ps1 b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/addPoshVcpkgToPowershellProfile.ps1 new file mode 100644 index 000000000..185f658c9 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/addPoshVcpkgToPowershellProfile.ps1 @@ -0,0 +1,56 @@ +[CmdletBinding()] +param() + +function findExistingImportModuleDirectives([Parameter(Mandatory=$true)][string]$path) +{ + if (!(Test-Path $path)) + { + return + } + + $fileContents = Get-Content $path + $fileContents -match 'Import-Module.+?(?=posh-vcpkg)' + return +} + +$scriptsDir = split-path -parent $script:MyInvocation.MyCommand.Definition + +$profileEntry = "Import-Module '$scriptsDir\posh-vcpkg'" +$profilePath = $PROFILE # Implicit PowerShell variable +$profileDir = Split-Path $profilePath -Parent +if (!(Test-Path $profileDir)) +{ + New-Item -ItemType Directory -Path $profileDir | Out-Null +} + +Write-Host "`nAdding the following line to ${profilePath}:" +Write-Host " $profileEntry" + +# @() Needed to force Array in PowerShell 2.0 +[Array]$existingImports = @(findExistingImportModuleDirectives $profilePath) +if ($existingImports.Count -gt 0) +{ + $existingImportsOut = $existingImports -join "`n " + Write-Host "`nposh-vcpkg is already imported to your PowerShell profile. The following entries were found:" + Write-Host " $existingImportsOut" + Write-Host "`nPlease make sure you have started a new PowerShell window for the changes to take effect." + return +} + +# Modifying the profile will invalidate any signatures. +# Posh-git does the following check, so we should too. +# https://github.com/dahlbyk/posh-git/blob/master/src/Utils.ps1 +# If the profile script exists and is signed, then we should not modify it +if (Test-Path $profilePath) +{ + $sig = Get-AuthenticodeSignature $profilePath + if ($null -ne $sig.SignerCertificate) + { + Write-Warning "Skipping add of posh-vcpkg import to profile; '$profilePath' appears to be signed." + Write-Warning "Please manually add the line '$profileEntry' to your profile and resign it." + return + } +} + +Add-Content $profilePath -Value "`n$profileEntry" -Encoding UTF8 +Write-Host "`nSuccessfully added posh-vcpkg to your PowerShell profile. Please start a new PowerShell window for the changes to take effect." diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/Create-PRDiff.ps1 b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/Create-PRDiff.ps1 new file mode 100644 index 000000000..599118089 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/Create-PRDiff.ps1 @@ -0,0 +1,20 @@ +[CmdletBinding(PositionalBinding=$False)] +Param( + [Parameter(Mandatory=$True)] + [String]$DiffFile +) + +Start-Process -FilePath 'git' -ArgumentList 'diff' ` + -NoNewWindow -Wait ` + -RedirectStandardOutput $DiffFile +if (0 -ne (Get-Item -LiteralPath $DiffFile).Length) +{ + $msg = @( + 'The formatting of the files in the repo were not what we expected,', + 'or the documentation was not regenerated.', + 'Please access the diff from format.diff in the build artifacts,' + 'and apply the patch with `git apply`' + ) + Write-Error ($msg -join "`n") + throw +}
\ No newline at end of file diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/analyze-test-results.ps1 b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/analyze-test-results.ps1 new file mode 100755 index 000000000..d96069abe --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/analyze-test-results.ps1 @@ -0,0 +1,444 @@ +# Copyright (c) Microsoft Corporation. +# SPDX-License-Identifier: MIT +# + +<# +.SYNOPSIS +Analyze the test results as output by the CI system. + +.DESCRIPTION +Takes the set of port test results from $logDir, +and the baseline from $baselineFile, and makes certain that the set +of failures we expected are exactly the set of failures we got. +Then, uploads the logs from any unexpected failures. + +.PARAMETER logDir +Directory of xml test logs to analyze. + +.PARAMETER allResults +Include tests that have no change from the baseline in the output. + +.PARAMETER triplet +The triplet to analyze. + +.PARAMETER baselineFile +The path to the ci.baseline.txt file in the vcpkg repository. +#> +[CmdletBinding()] +Param( + [Parameter(Mandatory = $true)] + [string]$logDir, + [switch]$allResults, + [Parameter(Mandatory = $true)] + [string]$triplet, + [Parameter(Mandatory = $true)] + [string]$baselineFile +) + +$ErrorActionPreference = 'Stop' + +if ( -not (Test-Path $logDir) ) { + [System.Console]::Error.WriteLine("Log directory does not exist: $logDir") + exit +} + +<# +.SYNOPSIS +Creates an object the represents the test run. + +.DESCRIPTION +build_test_results takes an XML file of results from the CI run, +and constructs an object based on that XML file for further +processing. + +.OUTPUTS +An object with the following elements: + assemblyName: + assemblyStartDate: + assemblyStartTime: + assemblyTime: + collectionName: + collectionTime: + allTests: A hashtable with an entry for each port tested + The key is the name of the port + The value is an object with the following elements: + name: Name of the port (Does not include the triplet name) + result: Pass/Fail/Skip result from xunit + time: Test time in seconds + originalResult: Result as defined by Build.h in vcpkg source code + abi_tag: The port hash + features: The features installed + +.PARAMETER xmlFilename +The path to the XML file to parse. +#> +function build_test_results { + [CmdletBinding()] + Param + ( + [string]$xmlFilename + ) + if ( ($xmlFilename.Length -eq 0) -or ( -not( Test-Path $xmlFilename))) { + #write-error "Missing file: $xmlFilename" + return $null + } + + Write-Verbose "building test hash for $xmlFilename" + + [xml]$xmlContents = Get-Content $xmlFilename + + # This currently only supports one collection per assembly, which is the way + # the vcpkg tests are designed to run in the pipeline. + $xmlAssembly = $xmlContents.assemblies.assembly + $assemblyName = $xmlAssembly.name + $assemblyStartDate = $xmlAssembly."run-date" + $assemblyStartTime = $xmlAssembly."run-time" + $assemblyTime = $xmlAssembly.time + $xmlCollection = $xmlAssembly.collection + $collectionName = $xmlCollection.name + $collectionTime = $xmlCollection.time + + $allTestResults = @{ } + foreach ( $test in $xmlCollection.test) { + if (!$test.name.endswith(":$triplet")) + { + continue + } + $name = ($test.name -replace ":.*$") + + # Reconstruct the original BuildResult enumeration (defined in Build.h) + # failure.message - why the test failed (valid only on test failure) + # reason - why the test was skipped (valid only when the test is skipped) + # case BuildResult::POST_BUILD_CHECKS_FAILED: + # case BuildResult::FILE_CONFLICTS: + # case BuildResult::BUILD_FAILED: + # case BuildResult::EXCLUDED: + # case BuildResult::CASCADED_DUE_TO_MISSING_DEPENDENCIES: + $originalResult = "NULLVALUE" + switch ($test.result) { + "Skip" { + $originalResult = $test.reason.InnerText + } + "Fail" { + $originalResult = $test.failure.message.InnerText + } + "Pass" { + $originalResult = "SUCCEEDED" + } + } + + $abi_tag = "" + $features = "" + foreach ( $trait in $test.traits.trait) { + switch ( $trait.name ) { + "abi_tag" { $abi_tag = $trait.value } + "features" { $features = $trait.value } + } + } + + # If additional fields get saved in the XML, then they should be added to this hash + # also consider using a PSCustomObject here instead of a hash + $testHash = @{ name = $name; result = $test.result; time = $test.time; originalResult = $originalResult; abi_tag = $abi_tag; features = $features } + $allTestResults[$name] = $testHash + } + + return @{ + assemblyName = $assemblyName; + assemblyStartDate = $assemblyStartDate; + assemblyStartTime = $assemblyStartTime; + assemblyTime = $assemblyTime; + collectionName = $collectionName; + collectionTime = $collectionTime; + allTests = $allTestResults + } +} + +<# +.SYNOPSIS +Creates an object that represents the baseline expectations. + +.DESCRIPTION +build_baseline_results converts the baseline file to an object representing +the expectations set up by the baseline file. It records four states: + 1) fail + 2) skip + 3) ignore + 4) pass -- this is represented by not being recorded +In other words, if a port is not contained in the object returned by this +cmdlet, expect it to pass. + +.OUTPUTS +An object containing the following fields: + collectionName: the triplet + fail: ports marked as fail + skip: ports marked as skipped + ignore: ports marked as ignore + +.PARAMETER baselineFile +The path to vcpkg's ci.baseline.txt. + +.PARAMETER triplet +The triplet to create the result object for. +#> +function build_baseline_results { + [CmdletBinding()] + Param( + $baselineFile, + $triplet + ) + #read in the file, strip out comments and blank lines and spaces, leave only the current triplet + #remove comments, remove empty lines, remove whitespace, then keep only those lines for $triplet + $baseline_list_raw = Get-Content -Path $baselineFile ` + | Where-Object { -not ($_ -match "\s*#") } ` + | Where-Object { -not ( $_ -match "^\s*$") } ` + | ForEach-Object { $_ -replace "\s" } ` + | Where-Object { $_ -match ":$triplet=" } + + #filter to skipped and trim the triplet + $skip_hash = @{ } + foreach ( $port in $baseline_list_raw | ? { $_ -match "=skip$" } | % { $_ -replace ":.*$" }) { + if ($skip_hash[$port] -ne $null) { + [System.Console]::Error.WriteLine("$($port):$($triplet) has multiple definitions in $baselineFile") + } + $skip_hash[$port] = $true + } + $fail_hash = @{ } + $baseline_list_raw | ? { $_ -match "=fail$" } | % { $_ -replace ":.*$" } | ? { $fail_hash[$_] = $true } | Out-Null + $ignore_hash = @{ } + $baseline_list_raw | ? { $_ -match "=ignore$" } | % { $_ -replace ":.*$" } | ? { $ignore_hash[$_] = $true } | Out-Null + + return @{ + collectionName = $triplet; + skip = $skip_hash; + fail = $fail_hash; + ignore = $ignore_hash + } +} + +<# +.SYNOPSIS +Analyzes the results of the current run against the baseline. + +.DESCRIPTION +combine_results compares the results to the baselie, and generates the results +for the CI -- whether it should pass or fail. + +.OUTPUTS +An object containing the following: +(Note that this is not the same data structure as build_test_results) + assemblyName: + assemblyStartDate: + assemblyStartTime: + assemblyTime: + collectionName: + collectionTime: + allTests: A hashtable of each port with a different status from the baseline + The key is the name of the port + The value is an object with the following data members: + name: The name of the port + result: xunit test result Pass/Fail/Skip + message: Human readable message describing the test result + time: time the current test results took to run. + baselineResult: + currentResult: + features: + ignored: list of ignored tests + +.PARAMETER baseline +The baseline object to use from build_baseline_results. + +.PARAMETER current +The results object to use from build_test_results. +#> +function combine_results { + [CmdletBinding()] + Param + ( + $baseline, + $current + ) + + if ($baseline.collectionName -ne $current.collectionName) { + Write-Warning "Comparing mismatched collections $($baseline.collectionName) and $($current.collectionName)" + } + + $currentTests = $current.allTests + + # lookup table with the results of all of the tests + $allTestResults = @{ } + + $ignoredList = @() + + Write-Verbose "analyzing $($currentTests.count) tests" + + foreach ($key in $currentTests.keys) { + Write-Verbose "analyzing $key" + + $message = $null + $result = $null + $time = $null + $currentResult = $null + $features = $currentTest.features + + $baselineResult = "Pass" + if ($baseline.fail[$key] -ne $null) { + Write-Verbose "$key is failing" + $baselineResult = "Fail" + } + elseif ( $baseline.skip[$key] -ne $null) { + Write-Verbose "$key is skipped" + $baselineResult = "Skip" + } + elseif ( $baseline.ignore[$key] -ne $null) { + $baselineResult = "ignore" + } + + $currentTest = $currentTests[$key] + + if ( $currentTest.result -eq $baselineResult) { + Write-Verbose "$key has no change from baseline" + $currentResult = $currentTest.result + if ($allResults) { + # Only marking regressions as failures but keep the skipped status + if ($currentResult -eq "Skip") { + $result = "Skip" + } + else { + $result = "Pass" + } + $message = "No change from baseline" + $time = $currentTest.time + } + } + elseif ( $baselineResult -eq "ignore") { + if ( $currentTest.result -eq "Fail" ) { + Write-Verbose "ignoring failure on $key" + $ignoredList += $key + } + } + else { + Write-Verbose "$key had a change from the baseline" + + $currentResult = $currentTest.result + # Test exists in both test runs but does not match. Determine if this is a regression + # Pass -> Fail = Fail (Regression) + # Pass -> Skip = Skip + # Fail -> Pass = Fail (need to update baseline) + # Fail -> Skip = Skip + # Skip -> Fail = Fail (Should not happen) + # Skip -> Pass = Fail (should not happen) + + $lookupTable = @{ + 'Pass' = @{ + 'Fail' = @('Fail', "Test passes in baseline but fails in current run. If expected update ci.baseline.txt with '$($key):$($current.collectionName)=fail'"); + 'Skip' = @($null, 'Test was skipped due to missing dependencies') + }; + 'Fail' = @{ + 'Pass' = @('Fail', "Test fails in baseline but now passes. Update ci.baseline.txt with '$($key):$($current.collectionName)=pass'"); + 'Skip' = @($null, 'Test fails in baseline but is skipped in current run') + }; + 'Skip' = @{ + 'Fail' = @('Skip', "Test is skipped in baseline but fails in current run. Results are ignored") + 'Pass' = @('Skip', "Test is skipped in baseline but passes in current run. Results are ignored") + } + } + $resultList = $lookupTable[$baselineResult][$currentResult] + $result = $resultList[0] + $message = $resultList[1] + $time = $currentTest.time + Write-Verbose ">$key $message" + } + + if ($result -ne $null) { + Write-Verbose "Adding $key to result list" + $allTestResults[$key] = @{ name = $key; result = $result; message = $message; time = $time; abi_tag = $currentTest.abi_tag; baselineResult = $baselineResult; currentResult = $currentResult; features = $features } + } + } + + return @{ + assemblyName = $current.assemblyName; + assemblyStartDate = $current.assemblyStartDate; + assemblyStartTime = $current.assemblyStartTime; + assemblyTime = $current.assemblyTime; + collectionName = $current.collectionName; + collectionTime = $current.collectionTime; + allTests = $allTestResults; + ignored = $ignoredList + } +} + +<# +.SYNOPSIS +Writes short errors to the CI logs. + +.DESCRIPTION +write_errors_for_summary takes a hashtable from triplets to combine_results +objects, and writes short errors to the CI logs. + +.PARAMETER complete_results +A hashtable from triplets to combine_results objects. +#> +function write_errors_for_summary { + [CmdletBinding()] + Param( + $complete_results + ) + + $failure_found = $false + + Write-Verbose "preparing error output for Azure Devops" + + foreach ($triplet in $complete_results.Keys) { + $triplet_results = $complete_results[$triplet] + + Write-Verbose "searching $triplet triplet" + + # add each port results + foreach ($testName in $triplet_results.allTests.Keys) { + $test = $triplet_results.allTests[$testName] + + Write-Verbose "checking $($testName):$triplet $($test.result)" + + if ($test.result -eq 'Fail') { + $failure_found = $true + if ($test.currentResult -eq "pass") { + [System.Console]::Error.WriteLine( ` + "PASSING, REMOVE FROM FAIL LIST: $($test.name):$triplet ($baselineFile)" ` + ) + } + else { + [System.Console]::Error.WriteLine( ` + "REGRESSION: $($test.name):$triplet. If expected, add $($test.name):$triplet=fail to $baselineFile." ` + ) + } + } + } + } +} + + +$complete_results = @{ } +Write-Verbose "looking for $triplet logs" + +# The standard name for logs is: +# <triplet>.xml +# for example: +# x64-linux.xml + +$current_test_hash = build_test_results( Convert-Path "$logDir\$($triplet).xml" ) +$baseline_results = build_baseline_results -baselineFile $baselineFile -triplet $triplet + +if ($current_test_hash -eq $null) { + [System.Console]::Error.WriteLine("Missing $triplet test results in current test run") + $missing_triplets[$triplet] = "test" +} +else { + Write-Verbose "combining results..." + $complete_results[$triplet] = combine_results -baseline $baseline_results -current $current_test_hash +} + +Write-Verbose "done analyzing results" + +# emit error last. Unlike the table output this is going to be seen in the "status" section of the pipeline +# and needs to be formatted for a single line. +write_errors_for_summary -complete_results $complete_results diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/azure-pipelines.yml b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/azure-pipelines.yml new file mode 100644 index 000000000..5e667b272 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/azure-pipelines.yml @@ -0,0 +1,97 @@ +# Copyright (c) Microsoft Corporation.
+# SPDX-License-Identifier: MIT
+#
+variables:
+ windows-pool: 'PrWin-2021-04-23'
+ linux-pool: 'PrLin-2021-04-25'
+ osx-pool: 'PrOsx-2021-04-16'
+
+stages:
+- stage: FormatChecks
+ displayName: 'Formatting and Documentation Checks'
+ pool: $(windows-pool)
+ jobs:
+ - job:
+ workspace:
+ clean: resources
+ variables:
+ - name: VCPKG_DOWNLOADS
+ value: D:\downloads
+ - name: DiffFile
+ value: $(Build.ArtifactStagingDirectory)\format.diff
+ steps:
+ - task: Powershell@2
+ displayName: 'Generate Documentation'
+ inputs:
+ filePath: 'docs/regenerate.ps1'
+ arguments: '-VcpkgRoot . -WarningAction Stop'
+ pwsh: true
+ - script: .\bootstrap-vcpkg.bat
+ displayName: 'Bootstrap vcpkg'
+ - script: '.\vcpkg.exe format-manifest --all'
+ displayName: 'Format Manifests'
+ - task: Powershell@2
+ displayName: 'Create Diff'
+ inputs:
+ filePath: scripts/azure-pipelines/Create-PRDiff.ps1
+ arguments: '-DiffFile $(DiffFile)'
+ pwsh: true
+ - task: PublishBuildArtifacts@1
+ condition: failed()
+ displayName: 'Publish Format and Documentation Diff'
+ inputs:
+ PathtoPublish: '$(DiffFile)'
+ ArtifactName: 'format.diff'
+- stage: RunPrTests
+ displayName: 'Run PR Tests:'
+ dependsOn: FormatChecks
+ jobs:
+ - template: windows/azure-pipelines.yml
+ parameters:
+ triplet: x86-windows
+ jobName: x86_windows
+ poolName: $(windows-pool)
+
+ - template: windows/azure-pipelines.yml
+ parameters:
+ triplet: x64-windows
+ jobName: x64_windows
+ poolName: $(windows-pool)
+
+ - template: windows/azure-pipelines.yml
+ parameters:
+ triplet: x64-windows-static
+ jobName: x64_windows_static
+ poolName: $(windows-pool)
+
+ - template: windows/azure-pipelines.yml
+ parameters:
+ triplet: x64-windows-static-md
+ jobName: x64_windows_static_md
+ poolName: $(windows-pool)
+
+ - template: windows/azure-pipelines.yml
+ parameters:
+ triplet: x64-uwp
+ jobName: x64_uwp
+ poolName: $(windows-pool)
+
+ - template: windows/azure-pipelines.yml
+ parameters:
+ triplet: arm64-windows
+ jobName: arm64_windows
+ poolName: $(windows-pool)
+
+ - template: windows/azure-pipelines.yml
+ parameters:
+ triplet: arm-uwp
+ jobName: arm_uwp
+ poolName: $(windows-pool)
+
+ - template: osx/azure-pipelines.yml
+ parameters:
+ poolName: $(osx-pool)
+
+ - template: linux/azure-pipelines.yml
+ parameters:
+ poolName: $(linux-pool)
diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/create-vmss-helpers.psm1 b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/create-vmss-helpers.psm1 new file mode 100755 index 000000000..1e8310036 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/create-vmss-helpers.psm1 @@ -0,0 +1,166 @@ +# Copyright (c) Microsoft Corporation.
+# SPDX-License-Identifier: MIT
+
+<#
+.SYNOPSIS
+Returns whether there's a name collision in the resource group.
+
+.DESCRIPTION
+Find-ResourceGroupNameCollision takes a list of resources, and checks if $Test
+collides names with any of the resources.
+
+.PARAMETER Test
+The name to test.
+
+.PARAMETER Resources
+The list of resources.
+#>
+function Find-ResourceGroupNameCollision {
+ [CmdletBinding()]
+ Param([string]$Test, $Resources)
+
+ foreach ($resource in $Resources) {
+ if ($resource.ResourceGroupName -eq $Test) {
+ return $true
+ }
+ }
+
+ return $false
+}
+
+<#
+.SYNOPSIS
+Attempts to find a name that does not collide with any resources in the resource group.
+
+.DESCRIPTION
+Find-ResourceGroupName takes a set of resources from Get-AzResourceGroup, and finds the
+first name in {$Prefix, $Prefix-1, $Prefix-2, ...} such that the name doesn't collide with
+any of the resources in the resource group.
+
+.PARAMETER Prefix
+The prefix of the final name; the returned name will be of the form "$Prefix(-[1-9][0-9]*)?"
+#>
+function Find-ResourceGroupName {
+ [CmdletBinding()]
+ Param([string] $Prefix)
+
+ $resources = Get-AzResourceGroup
+ $result = $Prefix
+ $suffix = 0
+ while (Find-ResourceGroupNameCollision -Test $result -Resources $resources) {
+ $suffix++
+ $result = "$Prefix-$suffix"
+ }
+
+ return $result
+}
+
+<#
+.SYNOPSIS
+Generates a random password.
+
+.DESCRIPTION
+New-Password generates a password, randomly, of length $Length, containing
+only alphanumeric characters, underscore, and dash.
+
+.PARAMETER Length
+The length of the returned password.
+#>
+function New-Password {
+ Param ([int] $Length = 32)
+
+ # This 64-character alphabet generates 6 bits of entropy per character.
+ # The power-of-2 alphabet size allows us to select a character by masking a random Byte with bitwise-AND.
+ $alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_-"
+ $mask = 63
+ if ($alphabet.Length -ne 64) {
+ throw 'Bad alphabet length'
+ }
+
+ [Byte[]]$randomData = [Byte[]]::new($Length)
+ $rng = $null
+ try {
+ $rng = [System.Security.Cryptography.RandomNumberGenerator]::Create()
+ $rng.GetBytes($randomData)
+ }
+ finally {
+ if ($null -ne $rng) {
+ $rng.Dispose()
+ }
+ }
+
+ $result = ''
+ for ($idx = 0; $idx -lt $Length; $idx++) {
+ $result += $alphabet[$randomData[$idx] -band $mask]
+ }
+
+ return $result
+}
+
+<#
+.SYNOPSIS
+Waits for the shutdown of the specified resource.
+
+.DESCRIPTION
+Wait-Shutdown takes a VM, and checks if there's a 'PowerState/stopped'
+code; if there is, it returns. If there isn't, it waits ten seconds and
+tries again.
+
+.PARAMETER ResourceGroupName
+The name of the resource group to look up the VM in.
+
+.PARAMETER Name
+The name of the virtual machine to wait on.
+#>
+function Wait-Shutdown {
+ [CmdletBinding()]
+ Param([string]$ResourceGroupName, [string]$Name)
+
+ Write-Host "Waiting for $Name to stop..."
+ while ($true) {
+ $Vm = Get-AzVM -ResourceGroupName $ResourceGroupName -Name $Name -Status
+ $highestStatus = $Vm.Statuses.Count
+ for ($idx = 0; $idx -lt $highestStatus; $idx++) {
+ if ($Vm.Statuses[$idx].Code -eq 'PowerState/stopped') {
+ return
+ }
+ }
+
+ Write-Host "... not stopped yet, sleeping for 10 seconds"
+ Start-Sleep -Seconds 10
+ }
+}
+
+<#
+.SYNOPSIS
+Sanitizes a name to be used in a storage account.
+
+.DESCRIPTION
+Sanitize-Name takes a string, and removes all of the '-'s and
+lowercases the string, since storage account names must have no
+'-'s and must be completely lowercase alphanumeric. It then makes
+certain that the length of the string is not greater than 24,
+since that is invalid.
+
+.PARAMETER RawName
+The name to sanitize.
+#>
+function Sanitize-Name {
+ [CmdletBinding()]
+ Param(
+ [string]$RawName
+ )
+
+ $result = $RawName.Replace('-', '').ToLowerInvariant()
+ if ($result.Length -gt 24) {
+ Write-Error 'Sanitized name for storage account $result was too long.'
+ throw
+ }
+
+ return $result
+}
+
+Export-ModuleMember -Function Find-ResourceGroupName
+Export-ModuleMember -Function New-Password
+Export-ModuleMember -Function Wait-Shutdown
+Export-ModuleMember -Function Sanitize-Name
diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/generate-skip-list.ps1 b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/generate-skip-list.ps1 new file mode 100755 index 000000000..84b78b338 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/generate-skip-list.ps1 @@ -0,0 +1,83 @@ +# Copyright (c) Microsoft Corporation. +# SPDX-License-Identifier: MIT +# + +<# +.SYNOPSIS +Generates a list of ports to skip in the CI. + +.DESCRIPTION +generate-skip-list takes a triplet, and the path to the ci.baseline.txt +file, and generates a skip list string to pass to vcpkg. + +.PARAMETER Triplet +The triplet to find skipped ports for. + +.PARAMETER BaselineFile +The path to the ci.baseline.txt file. +#> +[CmdletBinding()] +Param( + [string]$Triplet, + [string]$BaselineFile, + [switch]$SkipFailures = $false +) + +$ErrorActionPreference = 'Stop' + +if (-not (Test-Path -Path $BaselineFile)) { + Write-Error "Unable to find baseline file $BaselineFile" + throw +} + +#read in the file, strip out comments and blank lines and spaces +$baselineListRaw = Get-Content -Path $BaselineFile ` + | Where-Object { -not ($_ -match "\s*#") } ` + | Where-Object { -not ( $_ -match "^\s*$") } ` + | ForEach-Object { $_ -replace "\s" } + +############################################################### +# This script is running at the beginning of the CI test, so do a little extra +# checking so things can fail early. + +#verify everything has a valid value +$missingValues = $baselineListRaw | Where-Object { -not ($_ -match "=\w") } + +if ($missingValues) { + Write-Error "The following are missing values: $missingValues" + throw +} + +$invalidValues = $baselineListRaw ` + | Where-Object { -not ($_ -match "=(skip|pass|fail|ignore)$") } + +if ($invalidValues) { + Write-Error "The following have invalid values: $invalidValues" + throw +} + +$baselineForTriplet = $baselineListRaw ` + | Where-Object { $_ -match ":$Triplet=" } + +# Verify there are no duplicates (redefinitions are not allowed) +$file_map = @{ } +foreach ($port in $baselineForTriplet | ForEach-Object { $_ -replace ":.*$" }) { + if ($null -ne $file_map[$port]) { + Write-Error ` + "$($port):$($Triplet) has multiple definitions in $baselineFile" + throw + } + $file_map[$port] = $true +} + +# Format the skip list for the command line +if ($SkipFailures) { + $targetRegex = "=(?:skip|fail)$" +} else { + $targetRegex = "=skip$" +} + +$skip_list = $baselineForTriplet ` + | Where-Object { $_ -match $targetRegex } ` + | ForEach-Object { $_ -replace ":.*$" } +[string]::Join(",", $skip_list) diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/linux/azure-pipelines.yml b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/linux/azure-pipelines.yml new file mode 100644 index 000000000..df5cceda6 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/linux/azure-pipelines.yml @@ -0,0 +1,62 @@ +# Copyright (c) Microsoft Corporation.
+# SPDX-License-Identifier: MIT
+#
+
+jobs:
+- job: x64_linux
+ pool:
+ name: ${{ parameters.poolName }}
+ workspace:
+ clean: resources
+ timeoutInMinutes: 1440 # 1 day
+ variables:
+ - name: WORKING_ROOT
+ value: /mnt/vcpkg-ci
+ - name: VCPKG_DOWNLOADS
+ value: /mnt/vcpkg-ci/downloads
+
+ steps:
+ - bash: df -h
+ displayName: 'Report on Disk Space'
+ - bash: |
+ sudo mkdir /home/agent -m=777
+ sudo chown `id -u` /home/agent
+ exit 0
+ displayName: 'Create /home/agent'
+ # Note: /mnt is the Azure machines' temporary disk.
+ - bash: |
+ sudo mkdir ${{ variables.WORKING_ROOT }} -m=777
+ sudo mkdir ${{ variables.VCPKG_DOWNLOADS }} -m=777
+ exit 0
+ displayName: 'Create ${{ variables.VCPKG_DOWNLOADS }}'
+ - task: Bash@3
+ displayName: 'Bootstrap vcpkg'
+ inputs:
+ filePath: bootstrap-vcpkg.sh
+ - task: PowerShell@2
+ displayName: '*** Test Modified Ports and Prepare Test Logs ***'
+ inputs:
+ failOnStderr: true
+ filePath: 'scripts/azure-pipelines/test-modified-ports.ps1'
+ arguments: '-Triplet x64-linux -BuildReason $(Build.Reason) -UseEnvironmentSasToken -WorkingRoot ${{ variables.WORKING_ROOT }} -ArtifactStagingDirectory $(Build.ArtifactStagingDirectory)'
+ pwsh: true
+ - bash: |
+ df -h
+ displayName: 'Report on Disk Space After Build'
+ condition: always()
+ - task: PublishBuildArtifacts@1
+ displayName: 'Publish Artifact: failure logs for x64-linux'
+ inputs:
+ PathtoPublish: '$(Build.ArtifactStagingDirectory)/failure-logs'
+ ArtifactName: 'failure logs for x64-linux'
+ condition: always()
+ - bash: |
+ python3 scripts/file_script.py /mnt/vcpkg-ci/installed/vcpkg/info/
+ displayName: 'Build a file list for all packages'
+ condition: always()
+ - task: PublishBuildArtifacts@1
+ displayName: 'Publish Artifact: file lists for x64-linux'
+ condition: always()
+ inputs:
+ PathtoPublish: scripts/list_files
+ ArtifactName: 'file lists for x64-linux'
diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/linux/create-vmss.ps1 b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/linux/create-vmss.ps1 new file mode 100755 index 000000000..55484f29b --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/linux/create-vmss.ps1 @@ -0,0 +1,360 @@ +# Copyright (c) Microsoft Corporation.
+# SPDX-License-Identifier: MIT
+#
+
+<#
+.SYNOPSIS
+Creates a Linux virtual machine scale set, set up for vcpkg's CI.
+
+.DESCRIPTION
+create-vmss.ps1 creates an Azure Linux VM scale set, set up for vcpkg's CI
+system. See https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/overview
+for more information.
+
+This script assumes you have installed Azure tools into PowerShell by following the instructions
+at https://docs.microsoft.com/en-us/powershell/azure/install-az-ps?view=azps-3.6.1
+or are running from Azure Cloud Shell.
+
+This script assumes you have installed the OpenSSH Client optional Windows component.
+#>
+
+$Location = 'westus2'
+$Prefix = 'PrLin-' + (Get-Date -Format 'yyyy-MM-dd')
+$VMSize = 'Standard_D16a_v4'
+$ProtoVMName = 'PROTOTYPE'
+$LiveVMPrefix = 'BUILD'
+$ErrorActionPreference = 'Stop'
+
+$ProgressActivity = 'Creating Scale Set'
+$TotalProgress = 11
+$CurrentProgress = 1
+
+Import-Module "$PSScriptRoot/../create-vmss-helpers.psm1" -DisableNameChecking
+
+####################################################################################################
+Write-Progress `
+ -Activity $ProgressActivity `
+ -Status 'Creating SSH key' `
+ -PercentComplete (100 / $TotalProgress * $CurrentProgress++)
+
+$sshDir = [System.IO.Path]::GetTempPath() + [System.IO.Path]::GetRandomFileName()
+mkdir $sshDir
+try {
+ ssh-keygen.exe -q -b 2048 -t rsa -f "$sshDir/key" -P [string]::Empty
+ $sshPublicKey = Get-Content "$sshDir/key.pub"
+} finally {
+ Remove-Item $sshDir -Recurse -Force
+}
+
+####################################################################################################
+Write-Progress `
+ -Activity $ProgressActivity `
+ -Status 'Creating resource group' `
+ -PercentComplete (100 / $TotalProgress * $CurrentProgress++)
+
+$ResourceGroupName = Find-ResourceGroupName $Prefix
+$AdminPW = New-Password
+New-AzResourceGroup -Name $ResourceGroupName -Location $Location
+$AdminPWSecure = ConvertTo-SecureString $AdminPW -AsPlainText -Force
+$Credential = New-Object System.Management.Automation.PSCredential ("AdminUser", $AdminPWSecure)
+
+####################################################################################################
+Write-Progress `
+ -Activity $ProgressActivity `
+ -Status 'Creating virtual network' `
+ -PercentComplete (100 / $TotalProgress * $CurrentProgress++)
+
+$allFirewallRules = @()
+
+$allFirewallRules += New-AzNetworkSecurityRuleConfig `
+ -Name AllowHTTP `
+ -Description 'Allow HTTP(S)' `
+ -Access Allow `
+ -Protocol Tcp `
+ -Direction Outbound `
+ -Priority 1008 `
+ -SourceAddressPrefix * `
+ -SourcePortRange * `
+ -DestinationAddressPrefix * `
+ -DestinationPortRange @(80, 443)
+
+$allFirewallRules += New-AzNetworkSecurityRuleConfig `
+ -Name AllowSFTP `
+ -Description 'Allow (S)FTP' `
+ -Access Allow `
+ -Protocol Tcp `
+ -Direction Outbound `
+ -Priority 1009 `
+ -SourceAddressPrefix * `
+ -SourcePortRange * `
+ -DestinationAddressPrefix * `
+ -DestinationPortRange @(21, 22)
+
+$allFirewallRules += New-AzNetworkSecurityRuleConfig `
+ -Name AllowDNS `
+ -Description 'Allow DNS' `
+ -Access Allow `
+ -Protocol * `
+ -Direction Outbound `
+ -Priority 1010 `
+ -SourceAddressPrefix * `
+ -SourcePortRange * `
+ -DestinationAddressPrefix * `
+ -DestinationPortRange 53
+
+$allFirewallRules += New-AzNetworkSecurityRuleConfig `
+ -Name AllowGit `
+ -Description 'Allow git' `
+ -Access Allow `
+ -Protocol Tcp `
+ -Direction Outbound `
+ -Priority 1011 `
+ -SourceAddressPrefix * `
+ -SourcePortRange * `
+ -DestinationAddressPrefix * `
+ -DestinationPortRange 9418
+
+$allFirewallRules += New-AzNetworkSecurityRuleConfig `
+ -Name DenyElse `
+ -Description 'Deny everything else' `
+ -Access Deny `
+ -Protocol * `
+ -Direction Outbound `
+ -Priority 1013 `
+ -SourceAddressPrefix * `
+ -SourcePortRange * `
+ -DestinationAddressPrefix * `
+ -DestinationPortRange *
+
+$NetworkSecurityGroupName = $ResourceGroupName + 'NetworkSecurity'
+$NetworkSecurityGroup = New-AzNetworkSecurityGroup `
+ -Name $NetworkSecurityGroupName `
+ -ResourceGroupName $ResourceGroupName `
+ -Location $Location `
+ -SecurityRules $allFirewallRules
+
+$SubnetName = $ResourceGroupName + 'Subnet'
+$Subnet = New-AzVirtualNetworkSubnetConfig `
+ -Name $SubnetName `
+ -AddressPrefix "10.0.0.0/16" `
+ -NetworkSecurityGroup $NetworkSecurityGroup `
+ -ServiceEndpoint "Microsoft.Storage"
+
+$VirtualNetworkName = $ResourceGroupName + 'Network'
+$VirtualNetwork = New-AzVirtualNetwork `
+ -Name $VirtualNetworkName `
+ -ResourceGroupName $ResourceGroupName `
+ -Location $Location `
+ -AddressPrefix "10.0.0.0/16" `
+ -Subnet $Subnet
+
+####################################################################################################
+Write-Progress `
+ -Activity $ProgressActivity `
+ -Status 'Creating archives storage account' `
+ -PercentComplete (100 / $TotalProgress * $CurrentProgress++)
+
+$StorageAccountName = Sanitize-Name $ResourceGroupName
+
+New-AzStorageAccount `
+ -ResourceGroupName $ResourceGroupName `
+ -Location $Location `
+ -Name $StorageAccountName `
+ -SkuName 'Standard_LRS' `
+ -Kind StorageV2
+
+$StorageAccountKeys = Get-AzStorageAccountKey `
+ -ResourceGroupName $ResourceGroupName `
+ -Name $StorageAccountName
+
+$StorageAccountKey = $StorageAccountKeys[0].Value
+
+$StorageContext = New-AzStorageContext `
+ -StorageAccountName $StorageAccountName `
+ -StorageAccountKey $StorageAccountKey
+
+New-AzStorageContainer -Name archives -Context $StorageContext -Permission Off
+$StartTime = [DateTime]::Now
+$ExpiryTime = $StartTime.AddMonths(6)
+
+$SasToken = New-AzStorageAccountSASToken `
+ -Service Blob `
+ -Permission "racwdlup" `
+ -Context $StorageContext `
+ -StartTime $StartTime `
+ -ExpiryTime $ExpiryTime `
+ -ResourceType Service,Container,Object `
+ -Protocol HttpsOnly
+
+$SasToken = $SasToken.Substring(1) # strip leading ?
+
+# Note that we put the storage account into the firewall after creating the above SAS token or we
+# would be denied since the person running this script isn't one of the VMs we're creating here.
+Set-AzStorageAccount `
+ -ResourceGroupName $ResourceGroupName `
+ -AccountName $StorageAccountName `
+ -NetworkRuleSet ( `
+ @{bypass="AzureServices"; `
+ virtualNetworkRules=( `
+ @{VirtualNetworkResourceId=$VirtualNetwork.Subnets[0].Id;Action="allow"}); `
+ defaultAction="Deny"})
+
+####################################################################################################
+Write-Progress `
+ -Activity $ProgressActivity `
+ -Status 'Creating prototype VM' `
+ -PercentComplete (100 / $TotalProgress * $CurrentProgress++)
+
+$NicName = $ResourceGroupName + 'NIC'
+$Nic = New-AzNetworkInterface `
+ -Name $NicName `
+ -ResourceGroupName $ResourceGroupName `
+ -Location $Location `
+ -Subnet $VirtualNetwork.Subnets[0]
+
+$VM = New-AzVMConfig -Name $ProtoVMName -VMSize $VMSize -Priority 'Spot' -MaxPrice -1
+$VM = Set-AzVMOperatingSystem `
+ -VM $VM `
+ -Linux `
+ -ComputerName $ProtoVMName `
+ -Credential $Credential `
+ -DisablePasswordAuthentication
+
+$VM = Add-AzVMNetworkInterface -VM $VM -Id $Nic.Id
+$VM = Set-AzVMSourceImage `
+ -VM $VM `
+ -PublisherName 'Canonical' `
+ -Offer 'UbuntuServer' `
+ -Skus '18.04-LTS' `
+ -Version latest
+
+$VM = Set-AzVMBootDiagnostic -VM $VM -Disable
+
+$VM = Add-AzVMSshPublicKey `
+ -VM $VM `
+ -KeyData $sshPublicKey `
+ -Path "/home/AdminUser/.ssh/authorized_keys"
+
+New-AzVm `
+ -ResourceGroupName $ResourceGroupName `
+ -Location $Location `
+ -VM $VM
+
+####################################################################################################
+Write-Progress `
+ -Activity $ProgressActivity `
+ -Status 'Running provisioning script provision-image.sh in VM' `
+ -PercentComplete (100 / $TotalProgress * $CurrentProgress++)
+
+$tempScript = [System.IO.Path]::GetTempPath() + [System.IO.Path]::GetRandomFileName() + ".sh"
+try {
+ $script = Get-Content "$PSScriptRoot\provision-image.sh" -Encoding utf8NoBOM
+ $script += "echo `"PROVISIONED_AZURE_STORAGE_NAME=\`"$StorageAccountName\`"`" | sudo tee -a /etc/environment"
+ $script += "echo `"PROVISIONED_AZURE_STORAGE_SAS_TOKEN=\`"$SasToken\`"`" | sudo tee -a /etc/environment"
+ Set-Content -Path $tempScript -Value $script -Encoding utf8NoBOM
+
+ $ProvisionImageResult = Invoke-AzVMRunCommand `
+ -ResourceGroupName $ResourceGroupName `
+ -VMName $ProtoVMName `
+ -CommandId 'RunShellScript' `
+ -ScriptPath $tempScript
+
+ Write-Host "provision-image.sh output: $($ProvisionImageResult.value.Message)"
+} finally {
+ Remove-Item $tempScript -Recurse -Force
+}
+
+####################################################################################################
+Write-Progress `
+ -Activity $ProgressActivity `
+ -Status 'Restarting VM' `
+ -PercentComplete (100 / $TotalProgress * $CurrentProgress++)
+
+Restart-AzVM -ResourceGroupName $ResourceGroupName -Name $ProtoVMName
+
+####################################################################################################
+Write-Progress `
+ -Activity $ProgressActivity `
+ -Status 'Converting VM to Image' `
+ -PercentComplete (100 / $TotalProgress * $CurrentProgress++)
+
+Stop-AzVM `
+ -ResourceGroupName $ResourceGroupName `
+ -Name $ProtoVMName `
+ -Force
+
+Set-AzVM `
+ -ResourceGroupName $ResourceGroupName `
+ -Name $ProtoVMName `
+ -Generalized
+
+$VM = Get-AzVM -ResourceGroupName $ResourceGroupName -Name $ProtoVMName
+$PrototypeOSDiskName = $VM.StorageProfile.OsDisk.Name
+$ImageConfig = New-AzImageConfig -Location $Location -SourceVirtualMachineId $VM.ID
+$Image = New-AzImage -Image $ImageConfig -ImageName $ProtoVMName -ResourceGroupName $ResourceGroupName
+
+####################################################################################################
+Write-Progress `
+ -Activity $ProgressActivity `
+ -Status 'Deleting unused VM and disk' `
+ -PercentComplete (100 / $TotalProgress * $CurrentProgress++)
+
+Remove-AzVM -Id $VM.ID -Force
+Remove-AzDisk -ResourceGroupName $ResourceGroupName -DiskName $PrototypeOSDiskName -Force
+
+####################################################################################################
+Write-Progress `
+ -Activity $ProgressActivity `
+ -Status 'Creating scale set' `
+ -PercentComplete (100 / $TotalProgress * $CurrentProgress++)
+
+$VmssIpConfigName = $ResourceGroupName + 'VmssIpConfig'
+$VmssIpConfig = New-AzVmssIpConfig -SubnetId $Nic.IpConfigurations[0].Subnet.Id -Primary -Name $VmssIpConfigName
+$VmssName = $ResourceGroupName + 'Vmss'
+$Vmss = New-AzVmssConfig `
+ -Location $Location `
+ -SkuCapacity 0 `
+ -SkuName $VMSize `
+ -SkuTier 'Standard' `
+ -Overprovision $false `
+ -UpgradePolicyMode Manual `
+ -EvictionPolicy Delete `
+ -Priority Spot `
+ -MaxPrice -1
+
+$Vmss = Add-AzVmssNetworkInterfaceConfiguration `
+ -VirtualMachineScaleSet $Vmss `
+ -Primary $true `
+ -IpConfiguration $VmssIpConfig `
+ -NetworkSecurityGroupId $NetworkSecurityGroup.Id `
+ -Name $NicName
+
+$VmssPublicKey = New-Object -TypeName 'Microsoft.Azure.Management.Compute.Models.SshPublicKey' `
+ -ArgumentList @('/home/AdminUser/.ssh/authorized_keys', $sshPublicKey)
+
+$Vmss = Set-AzVmssOsProfile `
+ -VirtualMachineScaleSet $Vmss `
+ -ComputerNamePrefix $LiveVMPrefix `
+ -AdminUsername AdminUser `
+ -AdminPassword $AdminPW `
+ -LinuxConfigurationDisablePasswordAuthentication $true `
+ -PublicKey @($VmssPublicKey)
+
+$Vmss = Set-AzVmssStorageProfile `
+ -VirtualMachineScaleSet $Vmss `
+ -OsDiskCreateOption 'FromImage' `
+ -OsDiskCaching ReadWrite `
+ -ImageReferenceId $Image.Id
+
+New-AzVmss `
+ -ResourceGroupName $ResourceGroupName `
+ -Name $VmssName `
+ -VirtualMachineScaleSet $Vmss
+
+####################################################################################################
+Write-Progress -Activity $ProgressActivity -Completed
+Write-Host "Location: $Location"
+Write-Host "Resource group name: $ResourceGroupName"
+Write-Host "User name: AdminUser"
+Write-Host "Using generated password: $AdminPW"
+Write-Host 'Finished!'
diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/linux/provision-image.sh b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/linux/provision-image.sh new file mode 100755 index 000000000..6663baed8 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/linux/provision-image.sh @@ -0,0 +1,76 @@ +#!/bin/bash +# Copyright (c) Microsoft Corporation. +# SPDX-License-Identifier: MIT +# + +sudo apt -y update +sudo apt -y dist-upgrade +# Install common build dependencies +APT_PACKAGES="at curl unzip tar libxt-dev gperf libxaw7-dev cifs-utils \ + build-essential g++ gfortran zip libx11-dev libxkbcommon-x11-dev libxi-dev \ + libgl1-mesa-dev libglu1-mesa-dev mesa-common-dev libxinerama-dev \ + libxcursor-dev yasm libnuma1 libnuma-dev python-six python3-six python-yaml \ + flex libbison-dev autoconf libudev-dev libncurses5-dev libtool libxrandr-dev \ + xutils-dev dh-autoreconf autoconf-archive libgles2-mesa-dev ruby-full \ + pkg-config meson" + +# Additionally required by qt5-base +APT_PACKAGES="$APT_PACKAGES libxext-dev libxfixes-dev libxrender-dev \ + libxcb1-dev libx11-xcb-dev libxcb-glx0-dev libxcb-util0-dev" + +# Additionally required by qt5-base for qt5-x11extras +APT_PACKAGES="$APT_PACKAGES libxkbcommon-dev libxcb-keysyms1-dev \ + libxcb-image0-dev libxcb-shm0-dev libxcb-icccm4-dev libxcb-sync0-dev \ + libxcb-xfixes0-dev libxcb-shape0-dev libxcb-randr0-dev \ + libxcb-render-util0-dev libxcb-xinerama0-dev libxcb-xkb-dev libxcb-xinput-dev" + +# Additionally required by libhdfs3 +APT_PACKAGES="$APT_PACKAGES libkrb5-dev" + +# Additionally required by kf5windowsystem +APT_PACKAGES="$APT_PACKAGES libxcb-res0-dev" + +# Additionally required by mesa +APT_PACKAGES="$APT_PACKAGES python3-setuptools python3-mako" + +# Additionally required by some packages to install additional python packages +APT_PACKAGES="$APT_PACKAGES python3-pip" + +# Additionally required by rtaudio +APT_PACKAGES="$APT_PACKAGES libasound2-dev" + +# Additionally required/installed by Azure DevOps Scale Set Agents +APT_PACKAGES="$APT_PACKAGES liblttng-ust0 libkrb5-3 zlib1g libicu60" + +sudo apt -y install $APT_PACKAGES + +# Install newer version of nasm than the apt package, required by intel-ipsec +mkdir /tmp/nasm +cd /tmp/nasm +curl -O https://www.nasm.us/pub/nasm/releasebuilds/2.15.05/nasm-2.15.05.tar.gz +tar -xf nasm-2.15.05.tar.gz +cd nasm-2.15.05/ +./configure --prefix=/usr && make -j +sudo make install +cd ~ + +# Install the latest Haskell stack +curl -sSL https://get.haskellstack.org/ | sudo sh + +# Install CUDA +wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-ubuntu1804.pin +sudo mv cuda-ubuntu1804.pin /etc/apt/preferences.d/cuda-repository-pin-600 +sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub +sudo add-apt-repository "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/ /" +sudo apt -y update +sudo apt install -y --no-install-recommends cuda-compiler-11-3 cuda-libraries-dev-11-3 cuda-driver-dev-11-3 \ + cuda-cudart-dev-11-3 libcublas-11-3 libcurand-dev-11-3 libcudnn8-dev libnccl2 libnccl-dev + +# Install PowerShell +wget -q https://packages.microsoft.com/config/ubuntu/18.04/packages-microsoft-prod.deb +sudo dpkg -i packages-microsoft-prod.deb +sudo apt update +sudo add-apt-repository universe +sudo apt install -y powershell + +# provision-image.ps1 will append installation of the SAS token here diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/osx/Get-InternalBaseBox.ps1 b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/osx/Get-InternalBaseBox.ps1 new file mode 100755 index 000000000..5264d2ecb --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/osx/Get-InternalBaseBox.ps1 @@ -0,0 +1,68 @@ +#!pwsh +#Requires -Version 6.0 + +<# +.SYNOPSIS +Installs the base box at the specified version from the share. + +.PARAMETER FileshareMachine +The machine which is acting as a fileshare + +.PARAMETER BoxVersion +The version of the box to add. Defaults to latest if nothing is passed. +#> +[CmdletBinding()] +Param( + [Parameter(Mandatory=$True)] + [String]$FileshareMachine, + + [Parameter()] + [String]$BoxVersion +) + +Set-StrictMode -Version 2 + +if (-not $IsMacOS) { + throw 'This script should only be run on a macOS host' +} + +$mountPoint = '/Users/vcpkg/vagrant/share' + +if (mount | grep "on $mountPoint (") { + umount $mountPoint + if (-not $?) { + Write-Error "umount $mountPoint failed with return code $LASTEXITCODE." + throw + } +} + +sshfs "fileshare@${FileshareMachine}:/Users/fileshare/share" $mountPoint +if ($LASTEXITCODE -eq 1) { + Write-Error 'sshfs returned 1. +This means that the osxfuse kernel extension was not allowed to load. +You may need to force un/reinstall osxfuse and/or sshfs with + brew uninstall osxfuse + brew uninstall sshfs + brew install osxfuse + brew install sshfs +Then, rerun this script. + +If you''ve already done that, Please open +System Preferences > Security & Privacy > General, +and allow the kernel extension to load. +Then, rerun this script. + +If you''ve already done this, you probably need to add your ssh keys to the fileshare machine.' + throw +} elseif (-not $?) { + Write-Error "sshfs failed with return code $LASTEXITCODE." + throw +} + +if (-not [String]::IsNullOrEmpty($BoxVersion)) { + $versionArgs = @("--box-version", $BoxVersion) +} else { + $versionArgs = @() +} + +vagrant box add "$mountPoint/vcpkg-boxes/macos-ci.json" @versionArgs diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/osx/Install-Prerequisites.ps1 b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/osx/Install-Prerequisites.ps1 new file mode 100755 index 000000000..120202583 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/osx/Install-Prerequisites.ps1 @@ -0,0 +1,132 @@ +#!pwsh +#Requires -Version 6.0 + +<# +.SYNOPSIS +Installs the set of prerequisites for the macOS CI hosts. + +.DESCRIPTION +Install-Prerequisites.ps1 installs all of the necessary prerequisites +to run the vcpkg macOS CI in a vagrant virtual machine, +skipping all prerequisites that are already installed and of the right version. + +.INPUTS +None + +.OUTPUTS +None +#> +[CmdletBinding()] +Param() + +Set-StrictMode -Version 2 + +if (-not $IsMacOS) { + Write-Error 'This script should only be run on a macOS host' + throw +} + +Import-Module "$PSScriptRoot/Utilities.psm1" + +$Installables = Get-Content "$PSScriptRoot/configuration/installables.json" | ConvertFrom-Json + +$Installables.Applications | ForEach-Object { + $VersionCommand = $_.VersionCommand + $InstalledVersion = (& $VersionCommand[0] $VersionCommand[1..$VersionCommand.Length]) + if (-not $?) { + Write-Host "$($_.Name) not installed; installing now" + } else { + $InstalledVersion = $InstalledVersion -join "`n" + if ($InstalledVersion -match $_.VersionRegex) { + if ($Matches.Count -ne 2) { + Write-Error "$($_.Name) has a malformed version regex ($($_.VersionRegex)); it should have a single capture group + (it has $($Matches.Count - 1))" + throw + } + if ($Matches[1] -eq $_.Version) { + Write-Host "$($_.Name) already installed and at the correct version ($($Matches[1]))" + return + } else { + Write-Host "$($_.Name) already installed but with the incorrect version + installed version: '$($Matches[1])' + required version : '$($_.Version)' +upgrading now." + } + } else { + Write-Warning "$($_.Name)'s version command ($($VersionCommand -join ' ')) returned a value we did not expect: + $InstalledVersion + expected a version matching the regex: $($_.VersionRegex) +Installing anyways." + } + } + + if ($null -ne (Get-Member -InputObject $_ -Name 'DmgUrl')) { + $pathToDmg = "~/Downloads/$($_.Name).dmg" + Get-RemoteFile -OutFile $pathToDmg -Uri $_.DmgUrl -Sha256 $_.Sha256 + + hdiutil attach $pathToDmg -mountpoint /Volumes/setup-installer + sudo installer -pkg "/Volumes/setup-installer/$($_.InstallerPath)" -target / + hdiutil detach /Volumes/setup-installer + } elseif ($null -ne (Get-Member -InputObject $_ -Name 'PkgUrl')) { + $pathToPkg = "~/Downloads/$($_.Name).pkg" + Get-RemoteFile -OutFile $pathToPkg -Uri $_.PkgUrl -Sha256 $_.Sha256 + + sudo installer -pkg $pathToPkg -target / + } else { + Write-Error "$($_.Name) does not have an installer in the configuration file." + throw + } +} + +$Installables.Brew | ForEach-Object { + $installable = $_ + if ($null -eq (Get-Member -InputObject $installable -Name 'Kind')) { + brew install $installable.Name + } else { + switch ($installable.Kind) { + 'cask' { brew install --cask $installable.Name } + default { + Write-Error "Invalid kind: $_. Expected either empty, or 'cask'." + } + } + } +} +brew upgrade + +$installedVagrantPlugins = @{} +vagrant plugin list --machine-readable | ForEach-Object { + $timestamp, $target, $type, $data = $_ -split ',' + switch ($type) { + # these are not important + 'ui' { } + 'plugin-version-constraint' { } + 'plugin-name' { + $installedVagrantPlugins[$data] = $Null + } + 'plugin-version' { + $version = $data -replace '%!\(VAGRANT_COMMA\)',',' + if ($version -notmatch '^(.*), global') { + Write-Error "Invalid version string for plugin ${target}: $version" + throw + } + $installedVagrantPlugins[$target] = $Matches[1] + } + default { + Write-Warning "Unknown plugin list member type $type for plugin $target" + } + } +} +$Installables.VagrantPlugins | ForEach-Object { + if (-not $installedVagrantPlugins.Contains($_.Name)) { + Write-Host "$($_.Name) not installed; installing now" + } elseif ($installedVagrantPlugins[$_.Name] -ne $_.Version) { + Write-Host "$($_.Name) already installed but with the incorrect version + installed version: '$($installedVagrantPlugins[$_.Name])' + required version: '$($_.Version)'" + } else { + Write-Host "$($_.Name) already installed and at the correct version ($($_.Version))" + return + } + + vagrant plugin install $_.Name --plugin-version $_.Version +} diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/osx/README.md b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/osx/README.md new file mode 100644 index 000000000..9f253a06c --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/osx/README.md @@ -0,0 +1,226 @@ +# `vcpkg-eg-mac` VMs + +## Table of Contents + +- [`vcpkg-eg-mac` VMs](#vcpkg-eg-mac-vms) + - [Table of Contents](#table-of-contents) + - [Basic Usage](#basic-usage) + - [Setting up a new macOS machine](#setting-up-a-new-macos-machine) + - [Troubleshooting](#troubleshooting) + - [Creating a new Vagrant box](#creating-a-new-vagrant-box) + - [VM Software Versions](#vm-software-versions) + - [(Internal) Accessing the macOS fileshare](#internal-accessing-the-macos-fileshare) + +## Basic Usage + +The simplest usage, and one which should be used for when spinning up +new VMs, and when restarting old ones, is a simple: + +``` +$ cd ~/vagrant/vcpkg-eg-mac +$ vagrant up +``` + +Any modifications to the machines should be made in `configuration/Vagrantfile` +and `Setup-VagrantMachines.ps1`, and make sure to push any changes! + +## Setting up a new macOS machine + +Before anything else, one must download `brew` and `powershell`. + +```sh +$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" +$ brew cask install powershell +``` + +Then, we need to download the `vcpkg` repository: + +```sh +$ git clone https://github.com/microsoft/vcpkg +``` + +Then, we need to mint an SSH key: + +```sh +$ ssh-keygen +$ cat .ssh/id_rsa.pub +``` + +Add that SSH key to `authorized_keys` on the file share machine with the base box. + +Next, install prerequisites and grab the current base box with: +```sh +$ cd vcpkg/scripts/azure-pipelines/osx +$ ./Install-Prerequisites.ps1 -Force +$ ./Get-InternalBaseBox.ps1 -FileshareMachine vcpkgmm-01.guest.corp.microsoft.com -BoxVersion 2020-09-28 +``` + +... where -BoxVersion is the version you want to use. + +Getting the base box will fail due to missing kernel modules for osxfuse, sshfs, and/or VirtualBox. +Log in to the machine, open System Preferences > Security & Privacy > General, and allow the kernel +extensions for VirtualBox and sshfs to load. Then, again: + +```sh +$ ./Get-InternalBaseBox.ps1 -FileshareMachine vcpkgmm-01.guest.corp.microsoft.com -BoxVersion 2020-09-28 +``` + +Replace `XX` with the number of +the virtual machine. Generally, that should be the same as the number +for the physical machine; i.e., vcpkgmm-04 would use 04. + +```sh + # NOTE: you may get an error about CoreCLR; see the following paragraph if you do +$ ./Setup-VagrantMachines.ps1 \ + -MachineId XX \ + -DevopsPat '<get this from azure devops; it needs agent pool read and manage access>' \ + -Date <this is the date of the pool; 2021-04-16 at time of writing> +$ cd ~/vagrant/vcpkg-eg-mac +$ vagrant up +``` + +If you see the following error: + +``` +Failed to initialize CoreCLR, HRESULT: 0x8007001F +``` + +You have to reboot the machine; run + +```sh +$ sudo shutdown -r now +``` + +and wait for the machine to start back up. Then, start again from where the error was emitted. + +### Troubleshooting + +The following are issues that we've run into: + +- (with a Parallels box) `vagrant up` doesn't work, and vagrant gives the error that the VM is `'stopped'`. + - Try logging into the GUI with the KVM, and retrying `vagrant up`. + +## Creating a new Vagrant box + +Whenever we want to install updated versions of the command line tools, +or of macOS, we need to create a new vagrant box. +This is pretty easy, but the results of the creation are not public, +since we're concerned about licensing. +However, if you're sure you're following Apple's licensing, +you can set up your own vagrant boxes that are the same as ours by doing the following: + +You'll need some prerequisites: + +- vagrant - found at <https://www.vagrantup.com/> + - The vagrant-parallels plugin - `vagrant plugin install vagrant-parallels` +- Parallels - found at <https://parallels.com> +- An Xcode installer - you can get this from Apple's developer website, + although you'll need to sign in first: <https://developer.apple.com/downloads> + +First, you'll need to create a base VM; +this is where you determine what version of macOS is installed. +Just follow the Parallels process for creating a macOS VM. + +Once you've done this, you can run through the installation of macOS onto a new VM. +You should set the username to `vagrant`. + +Once it's finished installing, make sure to turn on the SSH server. +Open System Preferences, then go to Sharing > Remote Login, +and turn it on. +You'll then want to add the vagrant SSH keys to the VM's vagrant user. +Open the terminal application and run the following: + +```sh +$ # basic stuff +$ date | sudo tee '/etc/vagrant_box_build_time' +$ printf 'vagrant\tALL=(ALL)\tNOPASSWD:\tALL\n' | sudo tee -a '/etc/sudoers.d/vagrant' +$ sudo chmod 0440 '/etc/sudoers.d/vagrant' +$ # then install vagrant keys +$ mkdir -p ~/.ssh +$ curl -fsSL 'https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub' >~/.ssh/authorized_keys +$ chmod 0600 ~/.ssh/authorized_keys +``` + +Finally, you'll need to install the Parallel Tools. +From your host, in the top bar, +go to Actions > Install Parallels Tools..., +and then follow the instructions. + +Now, let's package the VM into a base box. +(The following instructions are adapted from +[these official instructions][base-box-instructions]). + +Run the following commands: + +```sh +$ cd ~/Parallels +$ echo '{ "provider": "parallels" }' >metadata.json +$ tar zgvf <current date>.box ./metadata.json ./<name of VM>.pvm +``` + +This will create a box file which contains all the necessary data. +You can delete the `metadata.json` file after. + +Once you've done that, you can upload it to the fileshare, +under `share/boxes/vcpkg-ci-base`, add it to `share/boxes/vcpkg-ci-base.json`, +and finally add it to vagrant: + +```sh +$ vagrant box add ~/vagrant/share/boxes/vcpkg-ci-base.json +``` + +Then, we'll create the final box, +which contains all the necessary programs for doing CI work. +Copy `configuration/Vagrantfile-box.rb` as `Vagrantfile`, and +`configuration/vagrant-box-configuration.json` +into a new directory; into that same directory, +download the Xcode command line tools dmg, and name it `clt.dmg`. +Then, run the following in that directory: + +```sh +$ vagrant up +$ vagrant package +``` + +This will create a `package.box`, which is the box file for the base VM. +Once you've created this box, if you're making it the new box for the CI, +upload it to the fileshare, under `share/boxes/vcpkg-ci`. +Then, add the metadata about the box (the name and version) to +`share/boxes/vcpkg-ci.json`. +Once you've done that, add the software versions under [VM Software Versions](#vm-software-versions). + +[base-box-instructions]: https://parallels.github.io/vagrant-parallels/docs/boxes/base.html + +### VM Software Versions + +* 2020-09-28: + * macOS: 10.15.6 + * Xcode CLTs: 12 +* 2021-04-16: + * macOS: 11.2.3 + * Xcode CLTs: 12.4 + +### (Internal) Accessing the macOS fileshare + +The fileshare is located on `vcpkgmm-01`, under the `fileshare` user, in the `share` directory. +In order to get `sshfs` working on the physical machine, +You can run `Install-Prerequisites.ps1` to grab the right software, then either: + +```sh +$ mkdir vagrant/share +$ sshfs fileshare@<vcpkgmm-01 URN>:/Users/fileshare/share vagrant/share +``` + +or you can just run + +```sh +$ ./Get-InternalBaseBox.ps1 +``` + +which will do the thing automatically. + +If you get an error, that means that gatekeeper has prevented the kernel extension from loading, +so you'll need to access the GUI of the machine, go to System Preferences, +Security & Privacy, General, unlock the settings, +and allow system extensions from the osxfuse developer to run. +Then, you'll be able to add the fileshare as an sshfs. diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/osx/Setup-VagrantMachines.ps1 b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/osx/Setup-VagrantMachines.ps1 new file mode 100755 index 000000000..88b64594a --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/osx/Setup-VagrantMachines.ps1 @@ -0,0 +1,124 @@ +#!pwsh +#Requires -Version 6.0 + +<# +.SYNOPSIS +Sets up the configuration for the vagrant virtual machines. + +.DESCRIPTION +Setup-VagrantMachines.ps1 sets up the virtual machines for +vcpkg's macOS CI. It puts the VagrantFile and necessary +configuration JSON file into ~/vagrant/vcpkg-eg-mac. + +.PARAMETER MachineId +The number to give the machine; should match [0-9]{2}. +Defaults to the numbers at the end of the machine name, +assuming that that machine name matches `VCPKGMM-[0-9]{2}`. + +.PARAMETER DevopsPat +The personal access token which has Read & Manage permissions on the ADO pool. + +.PARAMETER Date +The date on which this pool is being created. Sets the default values for BoxVersion and AgentPool. + +.PARAMETER BoxVersion +The version of the box to use. If -Date is passed, uses that as the version. + +.PARAMETER AgentPool +The agent pool to add the machine to. If -Date is passed, uses "PrOsx-$Date" as the pool. + +.PARAMETER DevopsUrl +The URL of the ADO instance; defaults to vcpkg's, which is https://dev.azure.com/vcpkg. + +.PARAMETER BaseName +The base name for the vagrant VM; the machine name is $BaseName-$MachineId. +Defaults to 'vcpkg-eg-mac'. + +.PARAMETER BoxName +The name of the box to use. Defaults to 'vcpkg/macos-ci', +which is only available internally. + +.INPUTS +None + +.OUTPUTS +None +#> +[CmdletBinding(PositionalBinding=$False, DefaultParameterSetName='DefineDate')] +Param( + [Parameter(Mandatory=$False)] + [String]$MachineId, + + [Parameter(Mandatory=$True)] + [String]$DevopsPat, + + [Parameter(Mandatory=$True, ParameterSetName='DefineDate')] + [String]$Date, + + [Parameter(Mandatory=$True, ParameterSetName='DefineVersionAndAgentPool')] + [String]$BoxVersion, + + [Parameter(Mandatory=$True, ParameterSetName='DefineVersionAndAgentPool')] + [String]$AgentPool, + + [Parameter(Mandatory=$False)] + [String]$DevopsUrl = 'https://dev.azure.com/vcpkg', + + [Parameter()] + [String]$BaseName = 'vcpkg-eg-mac', + + [Parameter()] + [String]$BoxName = 'vcpkg/macos-ci' +) + +Set-StrictMode -Version 2 + +if (-not $IsMacOS) { + throw 'This script should only be run on a macOS host' +} + +if (-not [String]::IsNullOrEmpty($Date)) { + $BoxVersion = $Date + $AgentPool = "PrOsx-$Date" +} + +if ([String]::IsNullOrEmpty($MachineId)) { + $hostname = hostname -s + if ($hostname -match '^VCPKGMM-([0-9]{2})$') { + $MachineId = $matches[1] + } else { + Write-Error "Hostname ($hostname) does not match the expected format (VCPKGMM-NN). Please pass -MachineId in order to give the VM a number." + } +} + +if (Test-Path '~/vagrant/vcpkg-eg-mac') { + Push-Location '~/vagrant/vcpkg-eg-mac' + try { + Write-Host 'Deleting existing directories' + vagrant destroy -f + Remove-Item -Recurse -Force -LiteralPath '~/vagrant/vcpkg-eg-mac' | Out-Null + } finally { + Pop-Location + } +} + +Write-Host 'Creating new directories' +if (-not (Test-Path -Path '~/vagrant')) { + New-Item -ItemType 'Directory' -Path '~/vagrant' | Out-Null +} +New-Item -ItemType 'Directory' -Path '~/vagrant/vcpkg-eg-mac' | Out-Null + +Copy-Item ` + -Path "$PSScriptRoot/configuration/Vagrantfile-vm.rb" ` + -Destination '~/vagrant/vcpkg-eg-mac/Vagrantfile' + +$configuration = @{ + pat = $DevopsPat + agent_pool = $AgentPool + devops_url = $DevopsUrl + machine_name = "${BaseName}-${MachineId}" + box_name = $BoxName + box_version = $BoxVersion +} +ConvertTo-Json -InputObject $configuration -Depth 5 ` + | Set-Content -Path '~/vagrant/vcpkg-eg-mac/vagrant-configuration.json' diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/osx/Utilities.psm1 b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/osx/Utilities.psm1 new file mode 100644 index 000000000..1b70d61f7 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/osx/Utilities.psm1 @@ -0,0 +1,90 @@ +#Requires -Version 6.0 +Set-StrictMode -Version 2 + +<# +.SYNOPSIS +Returns whether the specified command exists in the current environment. + +.DESCRIPTION +Get-CommandExists takes a string as a parameter, +and returns whether it exists in the current environment; +either a function, alias, or an executable in the path. +It's somewhat equivalent to `which`. + +.PARAMETER Name +Specifies the name of the command which may or may not exist. + +.INPUTS +System.String + The name of the command. + +.OUTPUTS +System.Boolean + Whether the command exists. +#> +function Get-CommandExists +{ + [CmdletBinding()] + [OutputType([Boolean])] + Param( + [Parameter(ValueFromPipeline)] + [String]$Name + ) + + $null -ne (Get-Command -Name $Name -ErrorAction SilentlyContinue) +} + +<# +.SYNOPSIS +Downloads a file and checks its hash. + +.DESCRIPTION +Get-RemoteFile takes a URI and a hash, +downloads the file at that URI to OutFile, +and checks that the hash of the downloaded file. +It then returns a FileInfo object corresponding to the downloaded file. + +.PARAMETER OutFile +Specifies the file path to download to. + +.PARAMETER Uri +The URI to download from. + +.PARAMETER Sha256 +The expected SHA256 of the downloaded file. + +.INPUTS +None + +.OUTPUTS +System.IO.FileInfo + The FileInfo for the downloaded file. +#> +function Get-RemoteFile +{ + [CmdletBinding(PositionalBinding=$False)] + [OutputType([System.IO.FileInfo])] + Param( + [Parameter(Mandatory=$True)] + [String]$OutFile, + [Parameter(Mandatory=$True)] + [String]$Uri, + [Parameter(Mandatory=$True)] + [String]$Sha256 + ) + + Invoke-WebRequest -OutFile $OutFile -Uri $Uri + $actualHash = Get-FileHash -Algorithm SHA256 -Path $OutFile + + if ($actualHash.Hash -ne $Sha256) { + throw @" +Invalid hash for file $OutFile; + expected: $Hash + found: $($actualHash.Hash) +Please make sure that the hash in the powershell file is correct. +"@ + } + + Get-Item $OutFile +} + diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/osx/azure-pipelines.yml b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/osx/azure-pipelines.yml new file mode 100644 index 000000000..6f327c1e9 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/osx/azure-pipelines.yml @@ -0,0 +1,59 @@ +# Copyright (c) Microsoft Corporation.
+# SPDX-License-Identifier: MIT
+#
+
+jobs:
+- job: x64_osx
+ pool:
+ name: ${{ parameters.poolName }}
+ workspace:
+ clean: resources
+ timeoutInMinutes: 1440 # 1 day
+ variables:
+ - name: WORKING_ROOT
+ value: /Users/vagrant/Data
+ - name: VCPKG_DOWNLOADS
+ value: /Users/vagrant/Data/downloads
+ - group: osx-2021-04-16
+ - name: BINARY_SOURCE_STUB
+ value: "x-azblob,$(azblob-root-url),$(azblob-test-sas)"
+
+ steps:
+ - bash: df -h
+ displayName: 'Report on Disk Space'
+ - bash: |
+ sudo mkdir ${{ variables.VCPKG_DOWNLOADS }} || 0
+ sudo chmod 777 ${{ variables.VCPKG_DOWNLOADS }} || 0
+ exit 0
+ displayName: 'Create ${{ variables.VCPKG_DOWNLOADS }}'
+ - task: Bash@3
+ displayName: 'Build vcpkg'
+ inputs:
+ filePath: bootstrap-vcpkg.sh
+ - task: PowerShell@2
+ displayName: '*** Test Modified Ports and Prepare Test Logs ***'
+ inputs:
+ failOnStderr: true
+ filePath: 'scripts/azure-pipelines/test-modified-ports.ps1'
+ arguments: '-Triplet x64-osx -BuildReason $(Build.Reason) -BinarySourceStub "$(BINARY_SOURCE_STUB)" -WorkingRoot ${{ variables.WORKING_ROOT }} -ArtifactStagingDirectory $(Build.ArtifactStagingDirectory)'
+ pwsh: true
+ - bash: |
+ df -h
+ displayName: 'Report on Disk Space After Build'
+ condition: always()
+ - task: PublishBuildArtifacts@1
+ displayName: 'Publish Artifact: failure logs for x64-osx'
+ inputs:
+ PathtoPublish: '$(Build.ArtifactStagingDirectory)/failure-logs'
+ ArtifactName: 'failure logs for x64-osx'
+ condition: always()
+ - bash: |
+ python3 scripts/file_script.py /Users/vagrant/Data/installed/vcpkg/info/
+ displayName: 'Build a file list for all packages'
+ condition: always()
+ - task: PublishBuildArtifacts@1
+ displayName: 'Publish Artifact: file lists for x64-osx'
+ condition: always()
+ inputs:
+ PathtoPublish: scripts/list_files
+ ArtifactName: 'file lists for x64-osx'
diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/osx/configuration/Vagrantfile-box.rb b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/osx/configuration/Vagrantfile-box.rb new file mode 100644 index 000000000..90ad6c4c5 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/osx/configuration/Vagrantfile-box.rb @@ -0,0 +1,36 @@ +require 'json' + +configuration = JSON.parse(File.read("#{__dir__}/vagrant-box-configuration.json")) + +Vagrant.configure('2') do |config| + config.vm.box = 'vcpkg/macos-ci-base' + config.vm.box_version = configuration['box_version'] + config.vm.synced_folder '.', '/Users/vagrant/shared' + + config.vm.provision 'shell', + run: 'once', + name: 'Install Xcode Command Line Tools: attach dmg file', + inline: 'hdiutil attach shared/clt.dmg -mountpoint /Volumes/setup-installer', + privileged: false + config.vm.provision 'shell', + run: 'once', + name: 'Install Xcode Command Line Tools: run installer', + inline: 'installer -pkg "/Volumes/setup-installer/Command Line Tools.pkg" -target /', + privileged: true + config.vm.provision 'shell', + run: 'once', + name: 'Install XCode Command Line Tools: detach dmg file', + inline: 'hdiutil detach /Volumes/setup-installer', + privileged: false + + config.vm.provision 'shell', + run: 'once', + name: 'Install brew', + inline: '/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"', + privileged: false + config.vm.provision 'shell', + run: 'once', + name: 'Install brew applications', + inline: "brew install #{configuration['brew'].join(' ')} && brew install --cask #{configuration['brew-cask'].join(' ')}", + privileged: false +end diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/osx/configuration/Vagrantfile-vm.rb b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/osx/configuration/Vagrantfile-vm.rb new file mode 100644 index 000000000..ed689ab7b --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/osx/configuration/Vagrantfile-vm.rb @@ -0,0 +1,68 @@ +require 'json' + +configuration = JSON.parse(File.read("#{__dir__}/vagrant-configuration.json")) + +server = { + :hostname => configuration['machine_name'], + :box => configuration['box_name'], + :box_version => configuration['box_version'], + :ram => 12000, + :cpu => 11 +} + +azure_agent_url = 'https://vstsagentpackage.azureedge.net/agent/2.185.1/vsts-agent-osx-x64-2.185.1.tar.gz' +devops_url = configuration['devops_url'] +agent_pool = configuration['agent_pool'] +pat = configuration['pat'] + +Vagrant.configure('2') do |config| + config.vm.box = server[:box] + config.vm.box_version = server[:box_version] + config.vm.hostname = server[:hostname] + config.vm.synced_folder '.', '/vagrant', disabled: true + + config.vm.provider 'parallels' do |prl| + prl.memory = server[:ram] + prl.cpus = server[:cpu] + end + + config.vm.provision 'shell', + run: 'once', + name: 'Create the data directory', + inline: "mkdir ~/Data", + privileged: false + + config.vm.provision 'shell', + run: 'once', + name: 'Download azure agent', + inline: "curl -s -o ~/Downloads/azure-agent.tar.gz #{azure_agent_url}", + privileged: false + + config.vm.provision 'shell', + run: 'once', + name: 'Unpack azure agent', + inline: 'mkdir myagent; cd myagent; tar xf ~/Downloads/azure-agent.tar.gz', + privileged: false + + config.vm.provision 'shell', + run: 'once', + name: 'Add VM to azure agent pool', + inline: "cd ~/myagent;\ + ./config.sh --unattended \ + --url #{devops_url} \ + --work ~/Data/work \ + --auth pat --token #{pat} \ + --pool #{agent_pool} \ + --agent `hostname` \ + --replace \ + --acceptTeeEula", + privileged: false + + # Start listening for jobs + config.vm.provision 'shell', + run: 'always', + name: 'Start running azure pipelines', + inline: 'cd /Users/vagrant/myagent;\ + nohup ./run.sh&', + privileged: false +end diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/osx/configuration/installables.json b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/osx/configuration/installables.json new file mode 100644 index 000000000..1b2c2d015 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/osx/configuration/installables.json @@ -0,0 +1,40 @@ +{ + "$schema": "./installables.schema.json", + + "Applications": [ + { + "Name": "vagrant", + "VersionCommand": [ "vagrant", "-v" ], + "VersionRegex": "Vagrant (.*)", + "Version": "2.2.15", + "DmgUrl": "https://releases.hashicorp.com/vagrant/2.2.15/vagrant_2.2.15_x86_64.dmg", + "Sha256": "5C2B290C4FA2371E255C56B1E96DED3D0C838D54CB7F0E8E6CF154E9F206A20E", + "InstallerPath": "vagrant.pkg" + }, + { + "Name": "osxfuse", + "VersionCommand": [ "cat", "/Library/Filesystems/macfuse.fs/Contents/version.plist" ], + "VersionRegex": "<key>CFBundleVersion</key>[\\n\\t ]*<string>([0-9.]+)</string>", + "Version": "4.1.0", + "DmgUrl": "https://github.com/osxfuse/osxfuse/releases/download/macfuse-4.1.0/macfuse-4.1.0.dmg", + "Sha256": "3CB6A49406FD036C50EF1B4AD717A377F4DCF182811BDE172D69F1C289791085", + "InstallerPath": "Install macFUSE.pkg" + }, + { + "Name": "sshfs", + "VersionCommand": [ "sshfs", "--version" ], + "VersionRegex": "SSHFS version [0-9.]* \\(OSXFUSE SSHFS (.*)\\)", + "Version": "2.5.0", + "PkgUrl": "https://github.com/osxfuse/sshfs/releases/download/osxfuse-sshfs-2.5.0/sshfs-2.5.0.pkg", + "Sha256": "F8F4F71814273EA42DBE6CD92199F7CFF418571FFD1B10C0608878D3472D2162" + } + ], + "Brew": [ + ], + "VagrantPlugins": [ + { + "Name": "vagrant-parallels", + "Version": "2.2.1" + } + ] +} diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/osx/configuration/installables.schema.json b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/osx/configuration/installables.schema.json new file mode 100644 index 000000000..b7ec7ae80 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/osx/configuration/installables.schema.json @@ -0,0 +1,83 @@ +{ + "$schema": "https://json-schema.org/draft-07/schema", + "type": "object", + "definitions": { + "sha256": { + "type": "string", + "pattern": "[A-Z0-9]{64}" + } + }, + "required": [ + "Applications", + "Brew", + "VagrantPlugins" + ], + "properties": { + "Applications": { + "type": "array", + "items": { + "type": "object", + "properties": { + "Name": { + "type": "string" + }, + "VersionCommand": { + "type": "array", + "items": { + "type": "string" + }, + "minItems": 1 + }, + "VersionRegex": { + "type": "string", + "format": "regex" + }, + "Version": { + "type": "string" + }, + "DmgUrl": { + "type": "string", + "format": "uri" + }, + "Sha256": { + "$ref": "#/definitions/sha256" + }, + "InstallerPath": { + "type": "string" + } + } + } + }, + "Brew": { + "type": "array", + "items": { + "type": "object", + "required": [ "Name" ], + "properties": { + "Name": { + "type": "string" + }, + "Kind": { + "type": "string", + "enum": [ "cask" ] + } + } + } + }, + "VagrantPlugins": { + "type": "array", + "items": { + "type": "object", + "required": [ "Name", "Version" ], + "properties": { + "Name": { + "type": "string" + }, + "Version": { + "type": "string" + } + } + } + } + } +} diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/osx/configuration/vagrant-box-configuration.json b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/osx/configuration/vagrant-box-configuration.json new file mode 100644 index 000000000..d800c257a --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/osx/configuration/vagrant-box-configuration.json @@ -0,0 +1,21 @@ +{ + "$schema": "./vagrant-vm-configuration.schema.json", + "brew": [ + "autoconf", + "automake", + "bison", + "gettext", + "gfortran", + "gperf", + "gtk-doc", + "libtool", + "meson", + "mono", + "nasm", + "pkg-config", + "yasm" + ], + "brew-cask": [ + "powershell" + ] +} diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/osx/configuration/vagrant-box-configuration.schema.json b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/osx/configuration/vagrant-box-configuration.schema.json new file mode 100644 index 000000000..80845f70f --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/osx/configuration/vagrant-box-configuration.schema.json @@ -0,0 +1,18 @@ +{ + "$schema": "https://json-schema.org/draft-07/schema", + "type": "object", + "required": [ + "brew", + "brew-cask" + ], + "properties": { + "brew": { + "type": "array", + "items": { "type": "string" } + }, + "brew-cask": { + "type": "array", + "items": { "type": "string" } + } + } +} diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/osx/configuration/vagrant-configuration.schema.json b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/osx/configuration/vagrant-configuration.schema.json new file mode 100644 index 000000000..91540d77c --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/osx/configuration/vagrant-configuration.schema.json @@ -0,0 +1,35 @@ +{ + "$schema": "https://json-schema.org/draft/2019-09/schema", + + "type": "object", + + "required": [ + "pat", + "agent_pool", + "devops_url", + "machine_name", + "box_name", + "box_version" + ], + + "properties": { + "pat": { + "type": "string" + }, + "agent_pool": { + "type": "string" + }, + "devops_url": { + "type": "string" + }, + "machine_name": { + "type": "string" + }, + "box_name": { + "type": "string" + }, + "box_version": { + "type": "string" + } + } +} diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/test-modified-ports.ps1 b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/test-modified-ports.ps1 new file mode 100755 index 000000000..34533aef7 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/test-modified-ports.ps1 @@ -0,0 +1,157 @@ +# Copyright (c) Microsoft Corporation.
+# SPDX-License-Identifier: MIT
+#
+
+<#
+.SYNOPSIS
+Runs the 'Test Modified Ports' part of the vcpkg CI system for all platforms.
+
+.PARAMETER Triplet
+The triplet to test.
+
+.PARAMETER WorkingRoot
+The location used as scratch space for 'installed', 'packages', and 'buildtrees' vcpkg directories.
+
+.PARAMETER ArtifactStagingDirectory
+The Azure Pipelines artifacts directory. If not supplied, defaults to the current directory.
+
+.PARAMETER ArchivesRoot
+Equivalent to '-BinarySourceStub "files,$ArchivesRoot"'
+
+.PARAMETER UseEnvironmentSasToken
+Equivalent to '-BinarySourceStub "x-azblob,https://$($env:PROVISIONED_AZURE_STORAGE_NAME).blob.core.windows.net/archives,$($env:PROVISIONED_AZURE_STORAGE_SAS_TOKEN)"'
+
+.PARAMETER BinarySourceStub
+The type and parameters of the binary source. Shared across runs of this script. If
+this parameter is not set, binary caching will not be used. Example: "files,W:\"
+
+.PARAMETER BuildReason
+The reason Azure Pipelines is running this script (controls in which mode Binary Caching is used).
+If BinarySourceStub is not set, this parameter has no effect. If BinarySourceStub is set and this is
+not, binary caching will default to read-write mode.
+#>
+
+[CmdletBinding(DefaultParameterSetName="ArchivesRoot")]
+Param(
+ [Parameter(Mandatory = $true)]
+ [ValidateNotNullOrEmpty()]
+ [string]$Triplet,
+ [Parameter(Mandatory = $true)]
+ [ValidateNotNullOrEmpty()]
+ $WorkingRoot,
+ [ValidateNotNullOrEmpty()]
+ $ArtifactStagingDirectory = '.',
+ [Parameter(ParameterSetName='ArchivesRoot')]
+ $ArchivesRoot = $null,
+ [switch]
+ $UseEnvironmentSasToken = $false,
+ [Parameter(ParameterSetName='BinarySourceStub')]
+ $BinarySourceStub = $null,
+ $BuildReason = $null
+)
+
+if (-Not ((Test-Path "triplets/$Triplet.cmake") -or (Test-Path "triplets/community/$Triplet.cmake"))) {
+ Write-Error "Incorrect triplet '$Triplet', please supply a valid triplet."
+ throw
+}
+
+$usingBinaryCaching = $true
+if ([string]::IsNullOrWhiteSpace($BinarySourceStub)) {
+ if ([string]::IsNullOrWhiteSpace($ArchivesRoot)) {
+ if ($UseEnvironmentSasToken) {
+ $BinarySourceStub = "x-azblob,https://$($env:PROVISIONED_AZURE_STORAGE_NAME).blob.core.windows.net/archives,$($env:PROVISIONED_AZURE_STORAGE_SAS_TOKEN)"
+ } else {
+ $usingBinaryCaching = $false
+ }
+ } else {
+ if ($UseEnvironmentSasToken) {
+ Write-Error "Only one binary caching setting may be used."
+ throw
+ } else {
+ $BinarySourceStub = "files,$ArchivesRoot"
+ }
+ }
+} elseif ((-Not [string]::IsNullOrWhiteSpace($ArchivesRoot)) -Or $UseEnvironmentSasToken) {
+ Write-Error "Only one binary caching setting may be used."
+ throw
+}
+
+$env:VCPKG_DOWNLOADS = Join-Path $WorkingRoot 'downloads'
+$buildtreesRoot = Join-Path $WorkingRoot 'buildtrees'
+$installRoot = Join-Path $WorkingRoot 'installed'
+$packagesRoot = Join-Path $WorkingRoot 'packages'
+
+$commonArgs = @()
+if ($usingBinaryCaching) {
+ $commonArgs += @('--binarycaching')
+} else {
+ $commonArgs += @('--no-binarycaching')
+}
+
+$commonArgs += @(
+ "--x-buildtrees-root=$buildtreesRoot",
+ "--x-install-root=$installRoot",
+ "--x-packages-root=$packagesRoot",
+ "--overlay-ports=scripts/test_ports"
+)
+
+$skipFailures = $false
+if ($usingBinaryCaching) {
+ $binaryCachingMode = 'readwrite'
+ if ([string]::IsNullOrWhiteSpace($BuildReason)) {
+ Write-Host 'Build reason not specified, defaulting to using binary caching in read write mode.'
+ }
+ elseif ($BuildReason -eq 'PullRequest') {
+ Write-Host 'Build reason was Pull Request, using binary caching in read write mode, skipping failures.'
+ $skipFailures = $true
+ }
+ else {
+ Write-Host "Build reason was $BuildReason, using binary caching in write only mode."
+ $binaryCachingMode = 'write'
+ }
+
+ $commonArgs += @("--binarysource=clear;$BinarySourceStub,$binaryCachingMode")
+}
+
+if ($Triplet -eq 'x64-linux') {
+ $env:HOME = '/home/agent'
+ $executableExtension = [string]::Empty
+}
+elseif ($Triplet -eq 'x64-osx') {
+ $executableExtension = [string]::Empty
+}
+else {
+ $executableExtension = '.exe'
+}
+
+$xmlResults = Join-Path $ArtifactStagingDirectory 'xml-results'
+mkdir $xmlResults
+$xmlFile = Join-Path $xmlResults "$Triplet.xml"
+
+$failureLogs = Join-Path $ArtifactStagingDirectory 'failure-logs'
+
+& "./vcpkg$executableExtension" x-ci-clean @commonArgs
+$skipList = . "$PSScriptRoot/generate-skip-list.ps1" `
+ -Triplet $Triplet `
+ -BaselineFile "$PSScriptRoot/../ci.baseline.txt" `
+ -SkipFailures:$skipFailures
+
+# WORKAROUND: the x86-windows flavors of these are needed for all cross-compilation, but they are not auto-installed.
+# Install them so the CI succeeds:
+if ($Triplet -in @('x64-uwp', 'arm64-windows', 'arm-uwp', 'x64-windows', 'x64-windows-static', 'x64-windows-static-md')) {
+ .\vcpkg.exe install yasm-tool:x86-windows @commonArgs
+}
+
+if ($Triplet -in @('x64-windows', 'x64-osx', 'x64-linux'))
+{
+ # WORKAROUND: These triplets are native-targetting which triggers an issue in how vcpkg handles the skip list.
+ # The workaround is to pass the skip list as host-excludes as well.
+ & "./vcpkg$executableExtension" ci $Triplet --x-xunit=$xmlFile --exclude=$skipList --host-exclude=$skipList --failure-logs=$failureLogs @commonArgs
+}
+else
+{
+ & "./vcpkg$executableExtension" ci $Triplet --x-xunit=$xmlFile --exclude=$skipList --failure-logs=$failureLogs @commonArgs
+}
+& "$PSScriptRoot/analyze-test-results.ps1" -logDir $xmlResults `
+ -triplet $Triplet `
+ -baselineFile .\scripts\ci.baseline.txt
diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/windows-unstable/README.md b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/windows-unstable/README.md new file mode 100644 index 000000000..d60367247 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/windows-unstable/README.md @@ -0,0 +1,4 @@ +The "unstable" build is used internally by Microsoft to test prerelease versions
+of our C++ compiler; not seeing results from these build definitions in the
+GitHub portal is normal as these builds depend on acquisition of private
+compiler bits that aren't yet shipping.
diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/windows-unstable/azure-pipelines.yml b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/windows-unstable/azure-pipelines.yml new file mode 100644 index 000000000..189ab31ac --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/windows-unstable/azure-pipelines.yml @@ -0,0 +1,11 @@ +# Copyright (c) Microsoft Corporation.
+# SPDX-License-Identifier: MIT
+#
+variables:
+ unstable-pool: 'VcpkgUnstable-2020-09-01'
+
+jobs:
+- template: job.yml
+ parameters:
+ triplet: x64-windows
+ jobName: x64_windows
diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/windows-unstable/job.yml b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/windows-unstable/job.yml new file mode 100644 index 000000000..d440ef7fa --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/windows-unstable/job.yml @@ -0,0 +1,100 @@ +# Copyright (c) Microsoft Corporation.
+# SPDX-License-Identifier: MIT
+#
+
+jobs:
+- job: ${{ parameters.jobName }}
+ pool:
+ name: $(unstable-pool)
+ workspace:
+ clean: resources
+ timeoutInMinutes: 1440 # 1 day
+ variables:
+ - name: WORKING_ROOT
+ value: D:\
+ - name: VCPKG_DOWNLOADS
+ value: D:\downloads
+
+ steps:
+ - task: DownloadBuildArtifacts@0
+ displayName: 'Download DropBuildNumber if not specified'
+ inputs:
+ buildType: specific
+ project: '0bdbc590-a062-4c3f-b0f6-9383f67865ee'
+ pipeline: 8136
+ buildVersionToDownload: latestFromBranch
+ branchName: 'refs/heads/$(MSVCBranchName)'
+ artifactName: BuildNumber
+ downloadPath: 'D:\msvc-drops'
+ condition: eq(variables['DropBuildNumber'], '')
+ - task: PowerShell@2
+ displayName: 'Set DropBuildNumber if not specified'
+ inputs:
+ targetType: inline
+ script: |
+ $DropBuildNumber = Get-Content -Path D:\msvc-drops\BuildNumber\Build.BuildNumber.txt
+ Write-Host "##vso[task.setvariable variable=DropBuildNumber]$DropBuildNumber"
+ Write-Host "Build Number set to: $DropBuildNumber"
+ pwsh: true
+ condition: eq(variables['DropBuildNumber'], '')
+ - task: ms-vscs-artifact.build-tasks.artifactDropDownloadTask-1.artifactDropDownloadTask@0
+ displayName: 'Download msvc x86 ret'
+ inputs:
+ dropServiceURI: 'https://devdiv.artifacts.visualstudio.com/DefaultCollection'
+ buildNumber: 'msvc/builds/$(DropBuildNumber)/x86ret'
+ destinationPath: 'D:\msvc-drops\$(DropBuildNumber)\binaries.x86ret'
+ - task: ms-vscs-artifact.build-tasks.artifactDropDownloadTask-1.artifactDropDownloadTask@0
+ displayName: 'Download msvc amd64 ret'
+ inputs:
+ dropServiceURI: 'https://devdiv.artifacts.visualstudio.com/DefaultCollection'
+ buildNumber: 'msvc/builds/$(DropBuildNumber)/amd64ret'
+ destinationPath: 'D:\msvc-drops\$(DropBuildNumber)\binaries.amd64ret'
+ - task: PowerShell@2
+ displayName: 'Rearrange MSVC Drop Layout'
+ inputs:
+ targetType: filePath
+ filePath: 'scripts/azure-pipelines/windows-unstable/rearrange-msvc-drop-layout.ps1'
+ arguments: '-DropRoot "D:\msvc-drops\$(DropBuildNumber)" -BuildType ret'
+ pwsh: true
+ - task: PowerShell@2
+ displayName: 'Report on Disk Space'
+ condition: always()
+ inputs:
+ filePath: 'scripts/azure-pipelines/windows/disk-space.ps1'
+ pwsh: true
+ - script: .\bootstrap-vcpkg.bat
+ displayName: 'Build vcpkg'
+ - task: PowerShell@2
+ displayName: '*** Test Modified Ports and Prepare Test Logs ***'
+ inputs:
+ failOnStderr: true
+ filePath: 'scripts/azure-pipelines/test-modified-ports.ps1'
+ arguments: '-Triplet ${{ parameters.triplet }} -BuildReason $(Build.Reason) -WorkingRoot ${{ variables.WORKING_ROOT }} -ArtifactStagingDirectory $(Build.ArtifactStagingDirectory)'
+ pwsh: true
+ - task: PowerShell@2
+ displayName: 'Report on Disk Space After Build'
+ condition: always()
+ inputs:
+ filePath: 'scripts/azure-pipelines/windows/disk-space.ps1'
+ pwsh: true
+ - task: PublishBuildArtifacts@1
+ displayName: 'Publish Artifact: failure logs for ${{ parameters.triplet }}'
+ inputs:
+ PathtoPublish: '$(Build.ArtifactStagingDirectory)\failure-logs'
+ ArtifactName: 'failure logs for ${{ parameters.triplet }}'
+ condition: always()
+ - task: PowerShell@2
+ displayName: 'Build a file list for all packages'
+ condition: always()
+ inputs:
+ targetType: inline
+ script: |
+ ./vcpkg.exe fetch python3
+ & $(.\vcpkg fetch python3) .\scripts\file_script.py D:\installed\vcpkg\info\
+ pwsh: true
+ - task: PublishBuildArtifacts@1
+ displayName: 'Publish Artifact: file lists for ${{ parameters.triplet }}'
+ condition: always()
+ inputs:
+ PathtoPublish: scripts/list_files
+ ArtifactName: 'file lists for ${{ parameters.triplet }}'
diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/windows-unstable/rearrange-msvc-drop-layout.ps1 b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/windows-unstable/rearrange-msvc-drop-layout.ps1 new file mode 100644 index 000000000..d409bc208 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/windows-unstable/rearrange-msvc-drop-layout.ps1 @@ -0,0 +1,75 @@ +# Copyright (c) Microsoft Corporation. +# SPDX-License-Identifier: MIT +# +<# +.SYNOPSIS +Moves files from an MSVC compiler drop to the locations where they are installed in a Visual Studio installation. + +.PARAMETER DropRoot +The location where the MSVC compiler drop has been downloaded. + +.PARAMETER BuildType +The MSVC drop build type set with /p:_BuildType when MSVC was built. Defaults to 'ret'. + +#> +[CmdletBinding()] +param( + [Parameter(Mandatory = $true)][string]$DropRoot, + [Parameter(Mandatory = $false)][ValidateSet('ret', 'chk')][string]$BuildType = 'ret' +) + +Set-StrictMode -Version Latest + +$MSVCRoot = "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC" + +$ErrorActionPreference = "Stop" + +$tempRoot = "$DropRoot\readytodeploy" + +New-Item -ItemType Directory -Path $tempRoot | Out-Null + +Write-Host "Rearranging x86$BuildType" +New-Item -ItemType Directory -Path "$tempRoot\bin\HostX86" | Out-Null +Move-Item "$DropRoot\binaries.x86$BuildType\bin\i386" "$tempRoot\bin\HostX86\x86" +Move-Item "$DropRoot\binaries.x86$BuildType\bin\x86_amd64" "$tempRoot\bin\HostX86\x64" +Move-Item "$DropRoot\binaries.x86$BuildType\bin\x86_arm" "$tempRoot\bin\HostX86\arm" + +Write-Host "Rearranging amd64$BuildType" +New-Item -ItemType Directory -Path "$tempRoot\bin\HostX64" | Out-Null +Move-Item "$DropRoot\binaries.amd64$BuildType\bin\amd64" "$tempRoot\bin\HostX64\x64" +Move-Item "$DropRoot\binaries.amd64$BuildType\bin\amd64_x86" "$tempRoot\bin\HostX64\x86" +Move-Item "$DropRoot\binaries.amd64$BuildType\bin\amd64_arm" "$tempRoot\bin\HostX64\arm" + +# Only copy files and directories that already exist in the VS installation. +Write-Host "Rearranging inc, lib" +New-Item -ItemType Directory -Path "$tempRoot\lib" | Out-Null +Move-Item "$DropRoot\binaries.x86$BuildType\inc" "$tempRoot\include" +Move-Item "$DropRoot\binaries.x86$BuildType\lib\i386" "$tempRoot\lib\x86" +Move-Item "$DropRoot\binaries.amd64$BuildType\lib\amd64" "$tempRoot\lib\x64" + +Write-Host "Rearranging atlmfc" +New-Item -ItemType Directory -Path "$tempRoot\atlmfc" | Out-Null +New-Item -ItemType Directory -Path "$tempRoot\atlmfc\lib" | Out-Null +Move-Item "$DropRoot\binaries.x86$BuildType\atlmfc\include" "$tempRoot\atlmfc\include" +Move-Item "$DropRoot\binaries.x86$BuildType\atlmfc\lib\i386" "$tempRoot\atlmfc\lib\x86" +Move-Item "$DropRoot\binaries.amd64$BuildType\atlmfc\lib\amd64" "$tempRoot\atlmfc\lib\x64" + +$toolsets = Get-ChildItem -Path $MSVCRoot -Directory | Sort-Object -Descending +if ($toolsets.Length -eq 0) { + throw "Could not find Visual Studio toolset!" +} + +Write-Host "Found toolsets:`n$($toolsets -join `"`n`")`n" +$selectedToolset = $toolsets[0] +Write-Host "Using toolset: $selectedToolset" +for ($idx = 1; $idx -lt $toolsets.Length; $idx++) { + $badToolset = $toolsets[$idx] + Write-Host "Deleting toolset: $badToolset" + Remove-Item $badToolset -Recurse -Force +} + +Write-Host "Deploying $tempRoot => $selectedToolset" +Copy-Item "$tempRoot\*" $selectedToolset -Recurse -Force +Write-Host "Deleting $DropRoot..." +Remove-Item $DropRoot -Recurse -Force +Write-Host "Done!" diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/windows/azure-pipelines.yml b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/windows/azure-pipelines.yml new file mode 100644 index 000000000..c2d74b8bc --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/windows/azure-pipelines.yml @@ -0,0 +1,69 @@ +# Copyright (c) Microsoft Corporation.
+# SPDX-License-Identifier: MIT
+#
+
+jobs:
+- job: ${{ parameters.jobName }}
+ pool:
+ name: ${{ parameters.poolName }}
+ workspace:
+ clean: resources
+ timeoutInMinutes: 1440 # 1 day
+ variables:
+ - name: WORKING_ROOT
+ value: D:\
+ - name: VCPKG_DOWNLOADS
+ value: D:\downloads
+
+ steps:
+ - task: PowerShell@2
+ displayName: 'Report on Disk Space'
+ condition: always()
+ inputs:
+ filePath: 'scripts/azure-pipelines/windows/disk-space.ps1'
+ pwsh: true
+ # Note: D: is the Azure machines' temporary disk.
+ - script: .\bootstrap-vcpkg.bat
+ displayName: 'Bootstrap vcpkg'
+ - task: PowerShell@2
+ displayName: '*** Test Modified Ports and Prepare Test Logs ***'
+ inputs:
+ failOnStderr: true
+ filePath: 'scripts/azure-pipelines/test-modified-ports.ps1'
+ arguments: '-Triplet ${{ parameters.triplet }} -BuildReason $(Build.Reason) -UseEnvironmentSasToken -WorkingRoot ${{ variables.WORKING_ROOT }} -ArtifactStagingDirectory $(Build.ArtifactStagingDirectory)'
+ pwsh: true
+ - task: PowerShell@2
+ displayName: 'Validate version files'
+ condition: eq('${{ parameters.triplet }}', 'x86-windows')
+ inputs:
+ targetType: inline
+ script: |
+ ./vcpkg.exe --feature-flags=versions x-ci-verify-versions --verbose
+ pwsh: true
+ - task: PowerShell@2
+ displayName: 'Report on Disk Space After Build'
+ condition: always()
+ inputs:
+ filePath: 'scripts/azure-pipelines/windows/disk-space.ps1'
+ pwsh: true
+ - task: PublishBuildArtifacts@1
+ displayName: 'Publish Artifact: failure logs for ${{ parameters.triplet }}'
+ inputs:
+ PathtoPublish: '$(Build.ArtifactStagingDirectory)\failure-logs'
+ ArtifactName: 'failure logs for ${{ parameters.triplet }}'
+ condition: always()
+ - task: PowerShell@2
+ displayName: 'Build a file list for all packages'
+ condition: always()
+ inputs:
+ targetType: inline
+ script: |
+ ./vcpkg.exe fetch python3
+ & $(.\vcpkg fetch python3) .\scripts\file_script.py D:\installed\vcpkg\info\
+ pwsh: true
+ - task: PublishBuildArtifacts@1
+ displayName: 'Publish Artifact: file lists for ${{ parameters.triplet }}'
+ condition: always()
+ inputs:
+ PathtoPublish: scripts/list_files
+ ArtifactName: 'file lists for ${{ parameters.triplet }}'
diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/windows/create-vmss.ps1 b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/windows/create-vmss.ps1 new file mode 100644 index 000000000..fddba0eec --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/windows/create-vmss.ps1 @@ -0,0 +1,511 @@ +# Copyright (c) Microsoft Corporation.
+# SPDX-License-Identifier: MIT
+#
+
+<#
+.SYNOPSIS
+Creates a Windows virtual machine scale set, set up for vcpkg's CI.
+
+.DESCRIPTION
+create-vmss.ps1 creates an Azure Windows VM scale set, set up for vcpkg's CI
+system. See https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/overview
+for more information.
+
+This script assumes you have installed Azure tools into PowerShell by following the instructions
+at https://docs.microsoft.com/en-us/powershell/azure/install-az-ps?view=azps-3.6.1
+or are running from Azure Cloud Shell.
+
+.PARAMETER Unstable
+If this parameter is set, the machine is configured for use in the "unstable" pool used for testing
+the compiler rather than for testing vcpkg. Differences:
+* The machine prefix is changed to VcpkgUnstable instead of PrWin.
+* No storage account or "archives" share is provisioned.
+* The firewall is not opened to allow communication with Azure Storage.
+
+.PARAMETER CudnnPath
+The path to a CUDNN zip file downloaded from NVidia official sources
+(e.g. https://developer.nvidia.com/compute/machine-learning/cudnn/secure/8.1.1.33/11.2_20210301/cudnn-11.2-windows-x64-v8.1.1.33.zip
+downloaded in a browser with an NVidia account logged in.)
+#>
+
+[CmdLetBinding()]
+Param(
+ [switch]$Unstable = $false,
+ [parameter(Mandatory=$true)]
+ [string]$CudnnPath
+)
+
+$Location = 'westus2'
+if ($Unstable) {
+ $Prefix = 'VcpkgUnstable-'
+} else {
+ $Prefix = 'PrWin-'
+}
+
+$Prefix += (Get-Date -Format 'yyyy-MM-dd')
+$VMSize = 'Standard_D16a_v4'
+$ProtoVMName = 'PROTOTYPE'
+$LiveVMPrefix = 'BUILD'
+$WindowsServerSku = '2019-Datacenter'
+$ErrorActionPreference = 'Stop'
+
+$ProgressActivity = 'Creating Scale Set'
+$TotalProgress = 18
+$CurrentProgress = 1
+
+Import-Module "$PSScriptRoot/../create-vmss-helpers.psm1" -DisableNameChecking
+
+if (-Not $CudnnPath.EndsWith('.zip')) {
+ Write-Error 'Expected CudnnPath to be a zip file.'
+ return
+}
+
+####################################################################################################
+Write-Progress `
+ -Activity $ProgressActivity `
+ -Status 'Creating resource group' `
+ -PercentComplete (100 / $TotalProgress * $CurrentProgress++)
+
+$ResourceGroupName = Find-ResourceGroupName $Prefix
+$AdminPW = New-Password
+New-AzResourceGroup -Name $ResourceGroupName -Location $Location
+$AdminPWSecure = ConvertTo-SecureString $AdminPW -AsPlainText -Force
+$Credential = New-Object System.Management.Automation.PSCredential ("AdminUser", $AdminPWSecure)
+
+####################################################################################################
+Write-Progress `
+ -Activity $ProgressActivity `
+ -Status 'Creating virtual network' `
+ -PercentComplete (100 / $TotalProgress * $CurrentProgress++)
+
+$allFirewallRules = @()
+
+$allFirewallRules += New-AzNetworkSecurityRuleConfig `
+ -Name AllowHTTP `
+ -Description 'Allow HTTP(S)' `
+ -Access Allow `
+ -Protocol Tcp `
+ -Direction Outbound `
+ -Priority 1008 `
+ -SourceAddressPrefix * `
+ -SourcePortRange * `
+ -DestinationAddressPrefix * `
+ -DestinationPortRange @(80, 443)
+
+$allFirewallRules += New-AzNetworkSecurityRuleConfig `
+ -Name AllowSFTP `
+ -Description 'Allow (S)FTP' `
+ -Access Allow `
+ -Protocol Tcp `
+ -Direction Outbound `
+ -Priority 1009 `
+ -SourceAddressPrefix * `
+ -SourcePortRange * `
+ -DestinationAddressPrefix * `
+ -DestinationPortRange @(21, 22)
+
+$allFirewallRules += New-AzNetworkSecurityRuleConfig `
+ -Name AllowDNS `
+ -Description 'Allow DNS' `
+ -Access Allow `
+ -Protocol * `
+ -Direction Outbound `
+ -Priority 1010 `
+ -SourceAddressPrefix * `
+ -SourcePortRange * `
+ -DestinationAddressPrefix * `
+ -DestinationPortRange 53
+
+$allFirewallRules += New-AzNetworkSecurityRuleConfig `
+ -Name AllowGit `
+ -Description 'Allow git' `
+ -Access Allow `
+ -Protocol Tcp `
+ -Direction Outbound `
+ -Priority 1011 `
+ -SourceAddressPrefix * `
+ -SourcePortRange * `
+ -DestinationAddressPrefix * `
+ -DestinationPortRange 9418
+
+$allFirewallRules += New-AzNetworkSecurityRuleConfig `
+ -Name DenyElse `
+ -Description 'Deny everything else' `
+ -Access Deny `
+ -Protocol * `
+ -Direction Outbound `
+ -Priority 1013 `
+ -SourceAddressPrefix * `
+ -SourcePortRange * `
+ -DestinationAddressPrefix * `
+ -DestinationPortRange *
+
+$NetworkSecurityGroupName = $ResourceGroupName + 'NetworkSecurity'
+$NetworkSecurityGroup = New-AzNetworkSecurityGroup `
+ -Name $NetworkSecurityGroupName `
+ -ResourceGroupName $ResourceGroupName `
+ -Location $Location `
+ -SecurityRules $allFirewallRules
+
+$SubnetName = $ResourceGroupName + 'Subnet'
+$Subnet = New-AzVirtualNetworkSubnetConfig `
+ -Name $SubnetName `
+ -AddressPrefix "10.0.0.0/16" `
+ -NetworkSecurityGroup $NetworkSecurityGroup `
+ -ServiceEndpoint "Microsoft.Storage"
+
+$VirtualNetworkName = $ResourceGroupName + 'Network'
+$VirtualNetwork = New-AzVirtualNetwork `
+ -Name $VirtualNetworkName `
+ -ResourceGroupName $ResourceGroupName `
+ -Location $Location `
+ -AddressPrefix "10.0.0.0/16" `
+ -Subnet $Subnet
+
+####################################################################################################
+Write-Progress `
+ -Activity $ProgressActivity `
+ -Status 'Creating storage account' `
+ -CurrentOperation 'Initial setup' `
+ -PercentComplete (100 / $TotalProgress * $CurrentProgress++)
+
+$StorageAccountName = Sanitize-Name $ResourceGroupName
+
+New-AzStorageAccount `
+ -ResourceGroupName $ResourceGroupName `
+ -Location $Location `
+ -Name $StorageAccountName `
+ -SkuName 'Standard_LRS' `
+ -Kind StorageV2
+
+$StorageAccountKeys = Get-AzStorageAccountKey `
+ -ResourceGroupName $ResourceGroupName `
+ -Name $StorageAccountName
+
+$StorageAccountKey = $StorageAccountKeys[0].Value
+
+$StorageContext = New-AzStorageContext `
+ -StorageAccountName $StorageAccountName `
+ -StorageAccountKey $StorageAccountKey
+
+Write-Progress `
+ -Activity $ProgressActivity `
+ -Status 'Creating storage account' `
+ -CurrentOperation 'Uploading cudnn.zip' `
+ -PercentComplete (100 / $TotalProgress * $CurrentProgress) # note no ++
+
+New-AzStorageContainer -Name setup -Context $storageContext -Permission blob
+
+Set-AzStorageBlobContent -File $CudnnPath `
+ -Container 'setup' `
+ -Blob 'cudnn.zip' `
+ -Context $StorageContext
+
+$CudnnBlobUrl = "https://$StorageAccountName.blob.core.windows.net/setup/cudnn.zip"
+
+Write-Progress `
+ -Activity $ProgressActivity `
+ -Status 'Creating storage account' `
+ -CurrentOperation 'Creating archives container' `
+ -PercentComplete (100 / $TotalProgress * $CurrentProgress) # note no ++
+
+New-AzStorageContainer -Name archives -Context $StorageContext -Permission Off
+
+$StartTime = [DateTime]::Now
+$ExpiryTime = $StartTime.AddMonths(6)
+
+$SasToken = New-AzStorageAccountSASToken `
+ -Service Blob `
+ -Permission "racwdlup" `
+ -Context $StorageContext `
+ -StartTime $StartTime `
+ -ExpiryTime $ExpiryTime `
+ -ResourceType Service,Container,Object `
+ -Protocol HttpsOnly
+
+$SasToken = $SasToken.Substring(1) # strip leading ?
+
+Write-Progress `
+ -Activity $ProgressActivity `
+ -Status 'Creating storage account' `
+ -CurrentOperation 'Locking down network' `
+ -PercentComplete (100 / $TotalProgress * $CurrentProgress) # note no ++
+
+# Note that we put the storage account into the firewall after creating the above SAS token or we
+# would be denied since the person running this script isn't one of the VMs we're creating here.
+Set-AzStorageAccount `
+ -ResourceGroupName $ResourceGroupName `
+ -AccountName $StorageAccountName `
+ -NetworkRuleSet ( `
+ @{bypass="AzureServices"; `
+ virtualNetworkRules=( `
+ @{VirtualNetworkResourceId=$VirtualNetwork.Subnets[0].Id;Action="allow"}); `
+ defaultAction="Deny"})
+
+####################################################################################################
+Write-Progress `
+ -Activity $ProgressActivity `
+ -Status 'Creating prototype VM' `
+ -PercentComplete (100 / $TotalProgress * $CurrentProgress++)
+
+$NicName = $ResourceGroupName + 'NIC'
+$Nic = New-AzNetworkInterface `
+ -Name $NicName `
+ -ResourceGroupName $ResourceGroupName `
+ -Location $Location `
+ -Subnet $VirtualNetwork.Subnets[0]
+
+$VM = New-AzVMConfig -Name $ProtoVMName -VMSize $VMSize -Priority 'Spot' -MaxPrice -1
+$VM = Set-AzVMOperatingSystem `
+ -VM $VM `
+ -Windows `
+ -ComputerName $ProtoVMName `
+ -Credential $Credential `
+ -ProvisionVMAgent
+
+$VM = Add-AzVMNetworkInterface -VM $VM -Id $Nic.Id
+$VM = Set-AzVMSourceImage `
+ -VM $VM `
+ -PublisherName 'MicrosoftWindowsServer' `
+ -Offer 'WindowsServer' `
+ -Skus $WindowsServerSku `
+ -Version latest
+
+$VM = Set-AzVMBootDiagnostic -VM $VM -Disable
+New-AzVm `
+ -ResourceGroupName $ResourceGroupName `
+ -Location $Location `
+ -VM $VM
+
+####################################################################################################
+Write-Progress `
+ -Activity $ProgressActivity `
+ -Status 'Running provisioning script deploy-psexec.ps1 in VM' `
+ -PercentComplete (100 / $TotalProgress * $CurrentProgress++)
+
+$DeployPsExecResult = Invoke-AzVMRunCommand `
+ -ResourceGroupName $ResourceGroupName `
+ -VMName $ProtoVMName `
+ -CommandId 'RunPowerShellScript' `
+ -ScriptPath "$PSScriptRoot\deploy-psexec.ps1"
+
+Write-Host "deploy-psexec.ps1 output: $($DeployPsExecResult.value.Message)"
+
+####################################################################################################
+function Invoke-ScriptWithPrefix {
+ param(
+ [string]$ScriptName,
+ [switch]$AddAdminPw,
+ [switch]$AddCudnnUrl
+ )
+
+ Write-Progress `
+ -Activity $ProgressActivity `
+ -Status "Running provisioning script $ScriptName in VM" `
+ -PercentComplete (100 / $TotalProgress * $CurrentProgress++)
+
+ $DropToAdminUserPrefix = Get-Content "$PSScriptRoot\drop-to-admin-user-prefix.ps1" -Encoding utf8NoBOM -Raw
+ $UtilityPrefixContent = Get-Content "$PSScriptRoot\utility-prefix.ps1" -Encoding utf8NoBOM -Raw
+
+ $tempScriptFilename = [System.IO.Path]::GetTempPath() + [System.IO.Path]::GetRandomFileName() + ".txt"
+ try {
+ $script = Get-Content "$PSScriptRoot\$ScriptName" -Encoding utf8NoBOM -Raw
+ if ($AddAdminPw) {
+ $script = $script.Replace('# REPLACE WITH DROP-TO-ADMIN-USER-PREFIX.ps1', $DropToAdminUserPrefix)
+ }
+
+ if ($AddCudnnUrl) {
+ $script = $script.Replace('# REPLACE WITH $CudnnUrl', "`$CudnnUrl = '$CudnnBlobUrl'")
+ }
+
+ $script = $script.Replace('# REPLACE WITH UTILITY-PREFIX.ps1', $UtilityPrefixContent);
+ Set-Content -Path $tempScriptFilename -Value $script -Encoding utf8NoBOM
+
+ $parameter = $null
+ if ($AddAdminPw) {
+ $parameter = @{AdminUserPassword = $AdminPW;}
+ }
+
+ $InvokeResult = Invoke-AzVMRunCommand `
+ -ResourceGroupName $ResourceGroupName `
+ -VMName $ProtoVMName `
+ -CommandId 'RunPowerShellScript' `
+ -ScriptPath $tempScriptFilename `
+ -Parameter $parameter
+
+ Write-Host "$ScriptName output: $($InvokeResult.value.Message)"
+ } finally {
+ Remove-Item $tempScriptFilename -Force
+ }
+}
+
+Invoke-ScriptWithPrefix -ScriptName 'deploy-visual-studio.ps1' -AddAdminPw
+Restart-AzVM -ResourceGroupName $ResourceGroupName -Name $ProtoVMName
+
+####################################################################################################
+Invoke-ScriptWithPrefix -ScriptName 'deploy-windows-wdk.ps1' -AddAdminPw
+Restart-AzVM -ResourceGroupName $ResourceGroupName -Name $ProtoVMName
+
+####################################################################################################
+Invoke-ScriptWithPrefix -ScriptName 'deploy-mpi.ps1' -AddAdminPw
+Restart-AzVM -ResourceGroupName $ResourceGroupName -Name $ProtoVMName
+
+####################################################################################################
+Invoke-ScriptWithPrefix -ScriptName 'deploy-cuda.ps1' -AddAdminPw -AddCudnnUrl
+Restart-AzVM -ResourceGroupName $ResourceGroupName -Name $ProtoVMName
+
+####################################################################################################
+Invoke-ScriptWithPrefix -ScriptName 'deploy-pwsh.ps1' -AddAdminPw
+Restart-AzVM -ResourceGroupName $ResourceGroupName -Name $ProtoVMName
+
+####################################################################################################
+Write-Progress `
+ -Activity $ProgressActivity `
+ -Status 'Running provisioning script deploy-settings.txt (as a .ps1) in VM' `
+ -PercentComplete (100 / $TotalProgress * $CurrentProgress++)
+
+$ProvisionImageResult = Invoke-AzVMRunCommand `
+ -ResourceGroupName $ResourceGroupName `
+ -VMName $ProtoVMName `
+ -CommandId 'RunPowerShellScript' `
+ -ScriptPath "$PSScriptRoot\deploy-settings.txt"
+
+Write-Host "deploy-settings.txt output: $($ProvisionImageResult.value.Message)"
+
+####################################################################################################
+Write-Progress `
+ -Activity $ProgressActivity `
+ -Status 'Deploying SAS token into VM' `
+ -PercentComplete (100 / $TotalProgress * $CurrentProgress++)
+
+$tempScriptFilename = [System.IO.Path]::GetTempPath() + [System.IO.Path]::GetRandomFileName() + ".txt"
+try {
+ $script = "Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Environment' " `
+ + "-Name PROVISIONED_AZURE_STORAGE_NAME " `
+ + "-Value '$StorageAccountName'`r`n" `
+ + "Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Environment' " `
+ + "-Name PROVISIONED_AZURE_STORAGE_SAS_TOKEN " `
+ + "-Value '$SasToken'`r`n"
+
+ Write-Host "Script content is:"
+ Write-Host $script
+
+ Set-Content -Path $tempScriptFilename -Value $script -Encoding utf8NoBOM
+ $InvokeResult = Invoke-AzVMRunCommand `
+ -ResourceGroupName $ResourceGroupName `
+ -VMName $ProtoVMName `
+ -CommandId 'RunPowerShellScript' `
+ -ScriptPath $tempScriptFilename
+
+ Write-Host "Deploy SAS token output: $($InvokeResult.value.Message)"
+} finally {
+ Remove-Item $tempScriptFilename -Force
+}
+
+Restart-AzVM -ResourceGroupName $ResourceGroupName -Name $ProtoVMName
+
+####################################################################################################
+Write-Progress `
+ -Activity $ProgressActivity `
+ -Status 'Running provisioning script sysprep.ps1 in VM' `
+ -PercentComplete (100 / $TotalProgress * $CurrentProgress++)
+
+$SysprepResult = Invoke-AzVMRunCommand `
+ -ResourceGroupName $ResourceGroupName `
+ -VMName $ProtoVMName `
+ -CommandId 'RunPowerShellScript' `
+ -ScriptPath "$PSScriptRoot\sysprep.ps1"
+
+Write-Host "sysprep.ps1 output: $($SysprepResult.value.Message)"
+
+####################################################################################################
+Write-Progress `
+ -Activity $ProgressActivity `
+ -Status 'Waiting for VM to shut down' `
+ -PercentComplete (100 / $TotalProgress * $CurrentProgress++)
+
+Wait-Shutdown -ResourceGroupName $ResourceGroupName -Name $ProtoVMName
+
+####################################################################################################
+Write-Progress `
+ -Activity $ProgressActivity `
+ -Status 'Converting VM to Image' `
+ -PercentComplete (100 / $TotalProgress * $CurrentProgress++)
+
+Stop-AzVM `
+ -ResourceGroupName $ResourceGroupName `
+ -Name $ProtoVMName `
+ -Force
+
+Set-AzVM `
+ -ResourceGroupName $ResourceGroupName `
+ -Name $ProtoVMName `
+ -Generalized
+
+$VM = Get-AzVM -ResourceGroupName $ResourceGroupName -Name $ProtoVMName
+$PrototypeOSDiskName = $VM.StorageProfile.OsDisk.Name
+$ImageConfig = New-AzImageConfig -Location $Location -SourceVirtualMachineId $VM.ID
+$Image = New-AzImage -Image $ImageConfig -ImageName $ProtoVMName -ResourceGroupName $ResourceGroupName
+
+####################################################################################################
+Write-Progress `
+ -Activity $ProgressActivity `
+ -Status 'Deleting unused VM and disk' `
+ -PercentComplete (100 / $TotalProgress * $CurrentProgress++)
+
+Remove-AzVM -Id $VM.ID -Force
+Remove-AzDisk -ResourceGroupName $ResourceGroupName -DiskName $PrototypeOSDiskName -Force
+
+####################################################################################################
+Write-Progress `
+ -Activity $ProgressActivity `
+ -Status 'Creating scale set' `
+ -PercentComplete (100 / $TotalProgress * $CurrentProgress++)
+
+$VmssIpConfigName = $ResourceGroupName + 'VmssIpConfig'
+$VmssIpConfig = New-AzVmssIpConfig -SubnetId $Nic.IpConfigurations[0].Subnet.Id -Primary -Name $VmssIpConfigName
+$VmssName = $ResourceGroupName + 'Vmss'
+$Vmss = New-AzVmssConfig `
+ -Location $Location `
+ -SkuCapacity 0 `
+ -SkuName $VMSize `
+ -SkuTier 'Standard' `
+ -Overprovision $false `
+ -UpgradePolicyMode Manual `
+ -EvictionPolicy Delete `
+ -Priority Spot `
+ -MaxPrice -1
+
+$Vmss = Add-AzVmssNetworkInterfaceConfiguration `
+ -VirtualMachineScaleSet $Vmss `
+ -Primary $true `
+ -IpConfiguration $VmssIpConfig `
+ -NetworkSecurityGroupId $NetworkSecurityGroup.Id `
+ -Name $NicName
+
+$Vmss = Set-AzVmssOsProfile `
+ -VirtualMachineScaleSet $Vmss `
+ -ComputerNamePrefix $LiveVMPrefix `
+ -AdminUsername 'AdminUser' `
+ -AdminPassword $AdminPW `
+ -WindowsConfigurationProvisionVMAgent $true `
+ -WindowsConfigurationEnableAutomaticUpdate $true
+
+$Vmss = Set-AzVmssStorageProfile `
+ -VirtualMachineScaleSet $Vmss `
+ -OsDiskCreateOption 'FromImage' `
+ -OsDiskCaching ReadWrite `
+ -ImageReferenceId $Image.Id
+
+New-AzVmss `
+ -ResourceGroupName $ResourceGroupName `
+ -Name $VmssName `
+ -VirtualMachineScaleSet $Vmss
+
+####################################################################################################
+Write-Progress -Activity $ProgressActivity -Completed
+Write-Host "Location: $Location"
+Write-Host "Resource group name: $ResourceGroupName"
+Write-Host "User name: AdminUser"
+Write-Host "Using generated password: $AdminPW"
+Write-Host 'Finished!'
diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/windows/deploy-cuda.ps1 b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/windows/deploy-cuda.ps1 new file mode 100644 index 000000000..ab1cc1c54 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/windows/deploy-cuda.ps1 @@ -0,0 +1,62 @@ +# Copyright (c) Microsoft Corporation.
+# SPDX-License-Identifier: MIT
+
+# REPLACE WITH DROP-TO-ADMIN-USER-PREFIX.ps1
+
+# REPLACE WITH UTILITY-PREFIX.ps1
+
+# REPLACE WITH $CudnnUrl
+
+$CudnnLocalZipPath = "$PSScriptRoot\cudnn-11.2-windows-x64-v8.1.1.33.zip"
+
+$CudaUrl = 'https://developer.download.nvidia.com/compute/cuda/11.3.0/network_installers/cuda_11.3.0_win10_network.exe'
+
+$CudaFeatures = 'nvcc_11.3 cuobjdump_11.3 nvprune_11.3 cupti_11.3 memcheck_11.3 nvdisasm_11.3 nvprof_11.3 ' + `
+ 'visual_studio_integration_11.3 visual_profiler_11.3 visual_profiler_11.3 cublas_11.3 cublas_dev_11.3 ' + `
+ 'cudart_11.3 cufft_11.3 cufft_dev_11.3 curand_11.3 curand_dev_11.3 cusolver_11.3 cusolver_dev_11.3 ' + `
+ 'cusparse_11.3 cusparse_dev_11.3 npp_11.3 npp_dev_11.3 nvrtc_11.3 nvrtc_dev_11.3 nvml_dev_11.3 ' + `
+ 'occupancy_calculator_11.3 thrust_11.3 '
+
+$destination = "$env:ProgramFiles\NVIDIA GPU Computing Toolkit\CUDA\v11.3"
+
+try {
+ Write-Host 'Downloading CUDA...'
+ [string]$installerPath = Get-TempFilePath -Extension 'exe'
+ curl.exe -L -o $installerPath -s -S $CudaUrl
+ Write-Host 'Installing CUDA...'
+ $proc = Start-Process -FilePath $installerPath -ArgumentList @('-s ' + $CudaFeatures) -Wait -PassThru
+ $exitCode = $proc.ExitCode
+ if ($exitCode -eq 0) {
+ Write-Host 'Installation successful!'
+ }
+ else {
+ Write-Error "Installation failed! Exited with $exitCode."
+ throw
+ }
+}
+catch {
+ Write-Error "Failed to install CUDA! $($_.Exception.Message)"
+ throw
+}
+
+try {
+ if ([string]::IsNullOrWhiteSpace($CudnnUrl)) {
+ if (-Not (Test-Path $CudnnLocalZipPath)) {
+ throw "CUDNN zip ($CudnnLocalZipPath) was missing, please download from NVidia and place next to this script."
+ }
+
+ $cudnnZipPath = $CudnnLocalZipPath
+ } else {
+ Write-Host 'Downloading CUDNN...'
+ $cudnnZipPath = Get-TempFilePath -Extension 'zip'
+ curl.exe -L -o $cudnnZipPath -s -S $CudnnUrl
+ }
+
+ Write-Host "Installing CUDNN to $destination..."
+ tar.exe -xvf "$cudnnZipPath" --strip 1 --directory "$destination"
+ Write-Host 'Installation successful!'
+}
+catch {
+ Write-Error "Failed to install CUDNN! $($_.Exception.Message)"
+ throw
+}
diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/windows/deploy-mpi.ps1 b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/windows/deploy-mpi.ps1 new file mode 100644 index 000000000..ba369f797 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/windows/deploy-mpi.ps1 @@ -0,0 +1,47 @@ +# Copyright (c) Microsoft Corporation.
+# SPDX-License-Identifier: MIT
+
+# REPLACE WITH DROP-TO-ADMIN-USER-PREFIX.ps1
+
+# REPLACE WITH UTILITY-PREFIX.ps1
+
+$MpiUrl = 'https://download.microsoft.com/download/a/5/2/a5207ca5-1203-491a-8fb8-906fd68ae623/msmpisetup.exe'
+
+<#
+.SYNOPSIS
+Installs MPI
+
+.DESCRIPTION
+Downloads the MPI installer located at $Url, and installs it with the
+correct flags.
+
+.PARAMETER Url
+The URL of the installer.
+#>
+Function InstallMpi {
+ Param(
+ [String]$Url
+ )
+
+ try {
+ Write-Host 'Downloading MPI...'
+ [string]$installerPath = Get-TempFilePath -Extension 'exe'
+ curl.exe -L -o $installerPath -s -S $Url
+ Write-Host 'Installing MPI...'
+ $proc = Start-Process -FilePath $installerPath -ArgumentList @('-force', '-unattend') -Wait -PassThru
+ $exitCode = $proc.ExitCode
+ if ($exitCode -eq 0) {
+ Write-Host 'Installation successful!'
+ }
+ else {
+ Write-Error "Installation failed! Exited with $exitCode."
+ throw
+ }
+ }
+ catch {
+ Write-Error "Failed to install MPI! $($_.Exception.Message)"
+ throw
+ }
+}
+
+InstallMpi -Url $MpiUrl
diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/windows/deploy-psexec.ps1 b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/windows/deploy-psexec.ps1 new file mode 100644 index 000000000..2a1f6fb14 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/windows/deploy-psexec.ps1 @@ -0,0 +1,8 @@ +# Copyright (c) Microsoft Corporation.
+# SPDX-License-Identifier: MIT
+
+$ErrorActionPreference = 'Stop'
+$ProgressPreference = 'SilentlyContinue'
+$PsExecPath = 'C:\PsExec64.exe'
+Write-Host "Downloading psexec to: $PsExecPath"
+& curl.exe -L -o $PsExecPath -s -S https://live.sysinternals.com/PsExec64.exe
diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/windows/deploy-pwsh.ps1 b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/windows/deploy-pwsh.ps1 new file mode 100644 index 000000000..b766385a3 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/windows/deploy-pwsh.ps1 @@ -0,0 +1,9 @@ +# Copyright (c) Microsoft Corporation.
+# SPDX-License-Identifier: MIT
+
+# REPLACE WITH DROP-TO-ADMIN-USER-PREFIX.ps1
+
+# REPLACE WITH UTILITY-PREFIX.ps1
+
+$PwshUrl = 'https://github.com/PowerShell/PowerShell/releases/download/v7.1.3/PowerShell-7.1.3-win-x64.msi'
+InstallMSI -Url $PwshUrl -Name 'PowerShell Core'
diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/windows/deploy-settings.txt b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/windows/deploy-settings.txt new file mode 100644 index 000000000..a80ddce39 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/windows/deploy-settings.txt @@ -0,0 +1,20 @@ +$ErrorActionPreference = 'Stop'
+$ProgressPreference = 'SilentlyContinue'
+
+Write-Host 'Disabling pagefile...'
+wmic computersystem set AutomaticManagedPagefile=False
+wmic pagefileset delete
+
+$av = Get-Command Add-MPPreference -ErrorAction SilentlyContinue
+if ($null -eq $av) {
+ Write-Host 'AntiVirus not installed, skipping exclusions.'
+} else {
+ Write-Host 'Configuring AntiVirus exclusions...'
+ Add-MpPreference -ExclusionPath C:\agent
+ Add-MPPreference -ExclusionPath D:\
+ Add-MPPreference -ExclusionProcess ninja.exe
+ Add-MPPreference -ExclusionProcess clang-cl.exe
+ Add-MPPreference -ExclusionProcess cl.exe
+ Add-MPPreference -ExclusionProcess link.exe
+ Add-MPPreference -ExclusionProcess python.exe
+}
diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/windows/deploy-visual-studio.ps1 b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/windows/deploy-visual-studio.ps1 new file mode 100644 index 000000000..2de2de919 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/windows/deploy-visual-studio.ps1 @@ -0,0 +1,86 @@ +# Copyright (c) Microsoft Corporation.
+# SPDX-License-Identifier: MIT
+
+# REPLACE WITH DROP-TO-ADMIN-USER-PREFIX.ps1
+
+# REPLACE WITH UTILITY-PREFIX.ps1
+
+$VisualStudioBootstrapperUrl = 'https://aka.ms/vs/16/release/vs_enterprise.exe'
+$Workloads = @(
+ 'Microsoft.VisualStudio.Workload.NativeDesktop',
+ 'Microsoft.VisualStudio.Workload.Universal',
+ 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64',
+ 'Microsoft.VisualStudio.Component.VC.Tools.ARM',
+ 'Microsoft.VisualStudio.Component.VC.Tools.ARM64',
+ 'Microsoft.VisualStudio.Component.VC.ATL',
+ 'Microsoft.VisualStudio.Component.VC.ATLMFC',
+ 'Microsoft.VisualStudio.Component.VC.v141.x86.x64.Spectre',
+ 'Microsoft.VisualStudio.Component.Windows10SDK.18362',
+ 'Microsoft.VisualStudio.Component.Windows10SDK.19041',
+ 'Microsoft.Net.Component.4.8.SDK',
+ 'Microsoft.Component.NetFX.Native',
+ 'Microsoft.VisualStudio.Component.VC.Llvm.ClangToolset',
+ 'Microsoft.VisualStudio.Component.VC.Llvm.Clang',
+ 'Microsoft.VisualStudio.Component.VC.v141.x86.x64',
+ 'Microsoft.VisualStudio.Component.VC.140'
+)
+
+<#
+.SYNOPSIS
+Install Visual Studio.
+
+.DESCRIPTION
+InstallVisualStudio takes the $Workloads array, and installs it with the
+installer that's pointed at by $BootstrapperUrl.
+
+.PARAMETER Workloads
+The set of VS workloads to install.
+
+.PARAMETER BootstrapperUrl
+The URL of the Visual Studio installer, i.e. one of vs_*.exe.
+
+.PARAMETER InstallPath
+The path to install Visual Studio at.
+
+.PARAMETER Nickname
+The nickname to give the installation.
+#>
+Function InstallVisualStudio {
+ Param(
+ [String[]]$Workloads,
+ [String]$BootstrapperUrl,
+ [String]$InstallPath = $null,
+ [String]$Nickname = $null
+ )
+
+ try {
+ Write-Host 'Downloading Visual Studio...'
+ [string]$bootstrapperExe = Get-TempFilePath -Extension 'exe'
+ curl.exe -L -o $bootstrapperExe -s -S $BootstrapperUrl
+ Write-Host 'Installing Visual Studio...'
+ $vsArgs = @('/c', $bootstrapperExe, '--quiet', '--norestart', '--wait', '--nocache')
+ foreach ($workload in $Workloads) {
+ $vsArgs += '--add'
+ $vsArgs += $workload
+ }
+
+ if (-not ([String]::IsNullOrWhiteSpace($InstallPath))) {
+ $vsArgs += '--installpath'
+ $vsArgs += $InstallPath
+ }
+
+ if (-not ([String]::IsNullOrWhiteSpace($Nickname))) {
+ $vsArgs += '--nickname'
+ $vsArgs += $Nickname
+ }
+
+ $proc = Start-Process -FilePath cmd.exe -ArgumentList $vsArgs -Wait -PassThru
+ PrintMsiExitCodeMessage $proc.ExitCode
+ }
+ catch {
+ Write-Error "Failed to install Visual Studio! $($_.Exception.Message)"
+ throw
+ }
+}
+
+InstallVisualStudio -Workloads $Workloads -BootstrapperUrl $VisualStudioBootstrapperUrl -Nickname 'Stable'
diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/windows/deploy-windows-wdk.ps1 b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/windows/deploy-windows-wdk.ps1 new file mode 100644 index 000000000..d145f79d7 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/windows/deploy-windows-wdk.ps1 @@ -0,0 +1,47 @@ +# Copyright (c) Microsoft Corporation.
+# SPDX-License-Identifier: MIT
+
+# REPLACE WITH DROP-TO-ADMIN-USER-PREFIX.ps1
+
+# REPLACE WITH UTILITY-PREFIX.ps1
+
+$WindowsWDKUrl = 'https://go.microsoft.com/fwlink/?linkid=2128854'
+
+<#
+.SYNOPSIS
+Installs Windows WDK version 2004
+
+.DESCRIPTION
+Downloads the Windows WDK installer located at $Url, and installs it with the
+correct flags.
+
+.PARAMETER Url
+The URL of the installer.
+#>
+Function InstallWindowsWDK {
+ Param(
+ [String]$Url
+ )
+
+ try {
+ Write-Host 'Downloading Windows WDK...'
+ [string]$installerPath = Get-TempFilePath -Extension 'exe'
+ curl.exe -L -o $installerPath -s -S $Url
+ Write-Host 'Installing Windows WDK...'
+ $proc = Start-Process -FilePath $installerPath -ArgumentList @('/features', '+', '/q') -Wait -PassThru
+ $exitCode = $proc.ExitCode
+ if ($exitCode -eq 0) {
+ Write-Host 'Installation successful!'
+ }
+ else {
+ Write-Error "Installation failed! Exited with $exitCode."
+ throw
+ }
+ }
+ catch {
+ Write-Error "Failed to install Windows WDK! $($_.Exception.Message)"
+ throw
+ }
+}
+
+InstallWindowsWDK -Url $WindowsWDKUrl
diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/windows/disk-space.ps1 b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/windows/disk-space.ps1 new file mode 100644 index 000000000..8680d7701 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/windows/disk-space.ps1 @@ -0,0 +1,35 @@ +# Copyright (c) Microsoft Corporation.
+# SPDX-License-Identifier: MIT
+#
+
+<#
+.SYNOPSIS
+Prints total and free disk space for each disk on the system
+#>
+
+Function Format-Size {
+ [CmdletBinding()]
+ Param([long]$Size)
+
+ if ($Size -lt 1024) {
+ $Size = [int]$Size
+ return "$Size B"
+ }
+
+ $Size = $Size / 1024
+ if ($Size -lt 1024) {
+ $Size = [int]$Size
+ return "$Size KiB"
+ }
+
+ $Size = $Size / 1024
+ if ($Size -lt 1024) {
+ $Size = [int]$Size
+ return "$Size MiB"
+ }
+
+ $Size = [int]($Size / 1024)
+ return "$Size GiB"
+}
+
+Get-CimInstance -ClassName Win32_LogicalDisk | Format-Table -Property @{Label="Disk"; Expression={ $_.DeviceID }},@{Label="Label"; Expression={ $_.VolumeName }},@{Label="Size"; Expression={ Format-Size($_.Size) }},@{Label="Free Space"; Expression={ Format-Size($_.FreeSpace) }}
diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/windows/drop-to-admin-user-prefix.ps1 b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/windows/drop-to-admin-user-prefix.ps1 new file mode 100644 index 000000000..b4592eabd --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/windows/drop-to-admin-user-prefix.ps1 @@ -0,0 +1,27 @@ +param(
+ [string]$AdminUserPassword = $null
+)
+
+$ErrorActionPreference = 'Stop'
+$ProgressPreference = 'SilentlyContinue'
+if (-Not [string]::IsNullOrEmpty($AdminUserPassword)) {
+ $PsExecPath = 'C:\PsExec64.exe'
+ $PsExecArgs = @(
+ '-u',
+ 'AdminUser',
+ '-p',
+ $AdminUserPassword,
+ '-accepteula',
+ '-i',
+ '-h',
+ 'C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe',
+ '-ExecutionPolicy',
+ 'Unrestricted',
+ '-File',
+ $PSCommandPath
+ )
+
+ Write-Host "Executing: $PsExecPath $PsExecArgs"
+ $proc = Start-Process -FilePath $PsExecPath -ArgumentList $PsExecArgs -Wait -PassThru
+ exit $proc.ExitCode
+}
diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/windows/provision-entire-image.ps1 b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/windows/provision-entire-image.ps1 new file mode 100644 index 000000000..3bfb5dbd9 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/windows/provision-entire-image.ps1 @@ -0,0 +1,16 @@ +# This script runs all the scripts we run on Azure machines to deploy prerequisites,
+# and assumes it is being run as an admin user.
+
+. "$PSScriptRoot\utility-prefix.ps1"
+
+. "$PSScriptRoot\deploy-visual-studio.ps1"
+. "$PSScriptRoot\deploy-windows-wdk.ps1"
+. "$PSScriptRoot\deploy-mpi.ps1"
+. "$PSScriptRoot\deploy-cuda.ps1"
+. "$PSScriptRoot\deploy-pwsh.ps1"
+try {
+ Copy-Item "$PSScriptRoot\deploy-settings.txt" "$PSScriptRoot\deploy-settings.ps1"
+ . "$PSScriptRoot\deploy-settings.ps1"
+} finally {
+ Remove-Item "$PSScriptRoot\deploy-settings.ps1"
+}
diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/windows/sysprep.ps1 b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/windows/sysprep.ps1 new file mode 100644 index 000000000..a29950044 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/windows/sysprep.ps1 @@ -0,0 +1,17 @@ +# Copyright (c) Microsoft Corporation.
+# SPDX-License-Identifier: MIT
+#
+
+<#
+.SYNOPSIS
+Prepares the virtual machine for imaging.
+
+.DESCRIPTION
+Runs the `sysprep` utility to prepare the system for imaging.
+See https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/sysprep--system-preparation--overview
+for more information.
+#>
+
+$ErrorActionPreference = 'Stop'
+Write-Host 'Running sysprep'
+& C:\Windows\system32\sysprep\sysprep.exe /oobe /generalize /mode:vm /shutdown
diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/windows/utility-prefix.ps1 b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/windows/utility-prefix.ps1 new file mode 100644 index 000000000..8cd0066db --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/windows/utility-prefix.ps1 @@ -0,0 +1,125 @@ +# Copyright (c) Microsoft Corporation.
+# SPDX-License-Identifier: MIT
+
+<#
+.SYNOPSIS
+Gets a random file path in the temp directory.
+
+.DESCRIPTION
+Get-TempFilePath takes an extension, and returns a path with a random
+filename component in the temporary directory with that extension.
+
+.PARAMETER Extension
+The extension to use for the path.
+#>
+Function Get-TempFilePath {
+ Param(
+ [String]$Extension
+ )
+
+ if ([String]::IsNullOrWhiteSpace($Extension)) {
+ throw 'Missing Extension'
+ }
+
+ $tempPath = [System.IO.Path]::GetTempPath()
+ $tempName = [System.IO.Path]::GetRandomFileName() + '.' + $Extension
+ return Join-Path $tempPath $tempName
+}
+
+<#
+.SYNOPSIS
+Writes a message to the screen depending on ExitCode.
+
+.DESCRIPTION
+Since msiexec can return either 0 or 3010 successfully, in both cases
+we write that installation succeeded, and which exit code it exited with.
+If msiexec returns anything else, we write an error.
+
+.PARAMETER ExitCode
+The exit code that msiexec returned.
+#>
+Function PrintMsiExitCodeMessage {
+ Param(
+ $ExitCode
+ )
+
+ # 3010 is probably ERROR_SUCCESS_REBOOT_REQUIRED
+ if ($ExitCode -eq 0 -or $ExitCode -eq 3010) {
+ Write-Host "Installation successful! Exited with $ExitCode."
+ }
+ else {
+ Write-Error "Installation failed! Exited with $ExitCode."
+ throw
+ }
+}
+
+<#
+.SYNOPSIS
+Install a .msi file.
+
+.DESCRIPTION
+InstallMSI takes a url where an .msi lives, and installs that .msi to the system.
+
+.PARAMETER Name
+The name of the thing to install.
+
+.PARAMETER Url
+The URL at which the .msi lives.
+#>
+Function InstallMSI {
+ Param(
+ [String]$Name,
+ [String]$Url
+ )
+
+ try {
+ Write-Host "Downloading $Name..."
+ [string]$msiPath = Get-TempFilePath -Extension 'msi'
+ curl.exe -L -o $msiPath -s -S $Url
+ Write-Host "Installing $Name..."
+ $args = @('/i', $msiPath, '/norestart', '/quiet', '/qn')
+ $proc = Start-Process -FilePath 'msiexec.exe' -ArgumentList $args -Wait -PassThru
+ PrintMsiExitCodeMessage $proc.ExitCode
+ }
+ catch {
+ Write-Error "Failed to install $Name! $($_.Exception.Message)"
+ throw
+ }
+}
+
+<#
+.SYNOPSIS
+Unpacks a zip file to $Dir.
+
+.DESCRIPTION
+InstallZip takes a URL of a zip file, and unpacks the zip file to the directory
+$Dir.
+
+.PARAMETER Name
+The name of the tool being installed.
+
+.PARAMETER Url
+The URL of the zip file to unpack.
+
+.PARAMETER Dir
+The directory to unpack the zip file to.
+#>
+Function InstallZip {
+ Param(
+ [String]$Name,
+ [String]$Url,
+ [String]$Dir
+ )
+
+ try {
+ Write-Host "Downloading $Name..."
+ [string]$zipPath = Get-TempFilePath -Extension 'zip'
+ curl.exe -L -o $zipPath -s -S $Url
+ Write-Host "Installing $Name..."
+ Expand-Archive -Path $zipPath -DestinationPath $Dir -Force
+ }
+ catch {
+ Write-Error "Failed to install $Name! $($_.Exception.Message)"
+ throw
+ }
+}
diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/boost/.gitignore b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/boost/.gitignore new file mode 100644 index 000000000..f8e31288e --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/boost/.gitignore @@ -0,0 +1,3 @@ +/boost
+/downloads
+/libs
\ No newline at end of file diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/boost/generate-ports.ps1 b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/boost/generate-ports.ps1 new file mode 100644 index 000000000..499a09dee --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/boost/generate-ports.ps1 @@ -0,0 +1,481 @@ +[CmdletBinding()]
+param (
+ $libraries = @(),
+ $version = "1.75.0",
+ $portsDir = $null
+)
+
+$ErrorActionPreference = 'Stop'
+
+$scriptsDir = split-path -parent $MyInvocation.MyCommand.Definition
+if ($null -eq $portsDir)
+{
+ $portsDir = "$scriptsDir/../../ports"
+}
+
+if ($IsWindows)
+{
+ $vcpkg = "$scriptsDir/../../vcpkg.exe"
+ $curl = "curl.exe"
+}
+else
+{
+ $vcpkg = "$scriptsDir/../../vcpkg"
+ $curl = "curl"
+}
+
+# Clear this array when moving to a new boost version
+$port_versions = @{
+ #e.g. "asio" = 1;
+ "asio" = 1;
+ "python" = 2;
+ "context" = 2;
+ "concept-check" = 2;
+}
+
+$per_port_data = @{
+ "asio" = @{ "supports" = "!emscripten" };
+ "beast" = @{ "supports" = "!emscripten" };
+ "fiber" = @{ "supports" = "!osx&!uwp&!arm&!emscripten" };
+ "filesystem" = @{ "supports" = "!uwp" };
+ "iostreams" = @{ "supports" = "!uwp" };
+ "context" = @{ "supports" = "!uwp&!emscripten" };
+ "stacktrace" = @{ "supports" = "!uwp" };
+ "coroutine" = @{ "supports" = "!arm&!uwp&!emscripten" };
+ "coroutine2" = @{ "supports" = "!emscripten" };
+ "test" = @{ "supports" = "!uwp" };
+ "wave" = @{ "supports" = "!uwp" };
+ "log" = @{ "supports" = "!uwp&!emscripten" };
+ "locale" = @{
+ "supports" = "!uwp";
+ "features" = @{
+ icu=@{
+ dependencies=@("icu")
+ description="ICU backend for Boost.Locale"
+ }
+ }
+ };
+ "parameter-python" = @{ "supports" = "!emscripten" };
+ "process" = @{ "supports" = "!emscripten" };
+ "python" = @{
+ "supports" = "!uwp&!(arm&windows)&!emscripten";
+ "features" = @{
+ python2=@{
+ dependencies=@(@{name="python2"; platform="windows"})
+ description="Build with Python2 support"
+ }
+ }
+ };
+ "regex" = @{
+ "features" = @{
+ icu=@{
+ dependencies=@("icu")
+ description="ICU backend for Boost.Regex"
+ }
+ }
+ }
+}
+
+function TransformReference()
+{
+ param (
+ [string]$library
+ )
+
+ if ($per_port_data[$library].supports)
+ {
+ @{name="boost-$library"; platform=$per_port_data[$library].supports}
+ }
+ else
+ {
+ "boost-$library"
+ }
+}
+
+function Generate()
+{
+ param (
+ [string]$Name,
+ [string]$PortName,
+ [string]$Hash,
+ [bool]$NeedsBuild,
+ $Depends = @()
+ )
+
+ New-Item -ItemType "Directory" "$portsDir/boost-$PortName" -erroraction SilentlyContinue | out-null
+ $controlLines = @{
+ name="boost-$PortName"; `
+ "version-string"=$version; `
+ dependencies=$Depends; `
+ homepage="https://github.com/boostorg/$Name"; `
+ description="Boost $Name module" `
+ }
+ if ($port_versions[$PortName])
+ {
+ $controlLines["port-version"] = $port_versions[$PortName]
+ }
+ elseif ($NeedsBuild)
+ {
+ # This can be removed on next update; this is used to track the host dependencies change
+ $controlLines["port-version"] = 1
+ }
+
+ if ($per_port_data[$PortName])
+ {
+ $controlLines += $per_port_data[$PortName]
+ }
+ $controlLines | ConvertTo-Json -Depth 10 -Compress | out-file -enc ascii "$portsDir/boost-$PortName/vcpkg.json"
+ & $vcpkg format-manifest "$portsDir/boost-$PortName/vcpkg.json"
+
+ $portfileLines = @(
+ "# Automatically generated by scripts/boost/generate-ports.ps1"
+ ""
+ )
+
+ if ($PortName -eq "system")
+ {
+ $portfileLines += @(
+ "vcpkg_buildpath_length_warning(37)"
+ ""
+ )
+ }
+
+ $portfileLines += @(
+ "vcpkg_from_github("
+ " OUT_SOURCE_PATH SOURCE_PATH"
+ " REPO boostorg/$Name"
+ " REF boost-$version"
+ " SHA512 $Hash"
+ " HEAD_REF master"
+ )
+ $patches = Get-ChildItem $portsDir/boost-$PortName/*.patch
+ if ($patches.Count -eq 0)
+ {
+ }
+ elseif ($patches.Count -eq 1)
+ {
+ $portfileLines += @(" PATCHES $($patches.name)")
+ }
+ else
+ {
+ $portfileLines += @(" PATCHES")
+ foreach ($patch in $patches)
+ {
+ $portfileLines += @(" $($patch.name)")
+ }
+ }
+ $portfileLines += @(
+ ")"
+ ""
+ )
+
+ if (Test-Path "$scriptsDir/post-source-stubs/$PortName.cmake")
+ {
+ $portfileLines += @(get-content "$scriptsDir/post-source-stubs/$PortName.cmake")
+ }
+
+ if ($NeedsBuild)
+ {
+ $portfileLines += @(
+ "if(NOT DEFINED CURRENT_HOST_INSTALLED_DIR)"
+ " message(FATAL_ERROR `"boost-$PortName requires a newer version of vcpkg in order to build.`")"
+ "endif()"
+ "include(`${CURRENT_HOST_INSTALLED_DIR}/share/boost-build/boost-modular-build.cmake)"
+ )
+ # b2-options.cmake contains port-specific build options
+ if (Test-Path "$portsDir/boost-$PortName/b2-options.cmake")
+ {
+ $portfileLines += @(
+ "boost_modular_build("
+ " SOURCE_PATH `${SOURCE_PATH}"
+ " BOOST_CMAKE_FRAGMENT `"`${CMAKE_CURRENT_LIST_DIR}/b2-options.cmake`""
+ ")"
+ )
+ }
+ elseif (Test-Path "$portsDir/boost-$PortName/b2-options.cmake.in")
+ {
+ $portfileLines += @(
+ 'configure_file('
+ ' "${CMAKE_CURRENT_LIST_DIR}/b2-options.cmake.in"'
+ ' "${CURRENT_BUILDTREES_DIR}/vcpkg-b2-options.cmake"'
+ ' @ONLY'
+ ')'
+ 'boost_modular_build('
+ ' SOURCE_PATH ${SOURCE_PATH}'
+ ' BOOST_CMAKE_FRAGMENT "${CURRENT_BUILDTREES_DIR}/vcpkg-b2-options.cmake"'
+ ')'
+ )
+ }
+ else
+ {
+ $portfileLines += @(
+ "boost_modular_build(SOURCE_PATH `${SOURCE_PATH})"
+ )
+ }
+ }
+
+ $portfileLines += @(
+ "include(`${CURRENT_INSTALLED_DIR}/share/boost-vcpkg-helpers/boost-modular-headers.cmake)"
+ "boost_modular_headers(SOURCE_PATH `${SOURCE_PATH})"
+ )
+
+ if (Test-Path "$scriptsDir/post-build-stubs/$PortName.cmake")
+ {
+ $portfileLines += @(get-content "$scriptsDir/post-build-stubs/$PortName.cmake")
+ }
+
+ $portfileLines += @("")
+ $($portfileLines -join "`r`n") | out-file -enc ascii "$portsDir/boost-$PortName/portfile.cmake" -NoNewline
+}
+
+if (!(Test-Path "$scriptsDir/boost"))
+{
+ "Cloning boost..."
+ pushd $scriptsDir
+ try
+ {
+ git clone https://github.com/boostorg/boost --branch boost-$version
+ }
+ finally
+ {
+ popd
+ }
+}
+else
+{
+ pushd $scriptsDir/boost
+ try
+ {
+ git fetch
+ git checkout -f boost-$version
+ }
+ finally
+ {
+ popd
+ }
+}
+
+$libraries_found = Get-ChildItem $scriptsDir/boost/libs -directory | % name | % {
+ if ($_ -match "numeric")
+ {
+ "numeric_conversion"
+ "interval"
+ "odeint"
+ "ublas"
+ "safe_numerics"
+ }
+ elseif ($_ -eq "headers")
+ {
+ }
+ else
+ {
+ $_
+ }
+}
+
+New-Item -ItemType "Directory" $scriptsDir/downloads -erroraction SilentlyContinue | out-null
+
+if ($libraries.Length -eq 0)
+{
+ $libraries = $libraries_found
+}
+
+$libraries_in_boost_port = @()
+
+foreach ($library in $libraries)
+{
+ "Handling boost/$library..."
+ $archive = "$scriptsDir/downloads/$library-boost-$version.tar.gz"
+ if (!(Test-Path $archive))
+ {
+ "Downloading boost/$library..."
+ & $curl -L "https://github.com/boostorg/$library/archive/boost-$version.tar.gz" --output "$scriptsDir/downloads/$library-boost-$version.tar.gz"
+ }
+ $hash = & $vcpkg hash $archive
+ $unpacked = "$scriptsDir/libs/$library-boost-$version"
+ if (!(Test-Path $unpacked))
+ {
+ "Unpacking boost/$library..."
+ New-Item -ItemType "Directory" $scriptsDir/libs -erroraction SilentlyContinue | out-null
+ pushd $scriptsDir/libs
+ try
+ {
+ cmake -E tar xf $archive
+ }
+ finally
+ {
+ popd
+ }
+ }
+ pushd $unpacked
+ try
+ {
+ if ($IsWindows)
+ {
+ $groups = $(
+ findstr /si /C:"include <boost/" include/*
+ findstr /si /C:"include <boost/" src/*
+ ) | % { $_ -replace "^[^:]*:","" }
+ }
+ else
+ {
+ $groups = $(
+ grep -irhs "include <boost/" include src
+ )
+ }
+
+ $groups = $groups |
+ % { $_ `
+ -replace "boost/numeric/conversion/","boost/numeric_conversion/" `
+ -replace "boost/functional/hash.hpp","boost/container_hash/hash.hpp" `
+ -replace "boost/detail/([^/]+)/","boost/`$1/" `
+ -replace " *# *include *<boost/([a-zA-Z0-9\._]*)(/|>).*", "`$1" `
+ -replace "/|\.hp?p?| ","" } | group | % name | % {
+ # mappings
+ Write-Verbose "${library}: $_"
+ if ($_ -match "aligned_storage") { "type_traits" }
+ elseif ($_ -match "noncopyable|ref|swap|get_pointer|checked_delete|visit_each") { "core" }
+ elseif ($_ -eq "type") { "core" }
+ elseif ($_ -match "concept|concept_archetype") { "concept_check" }
+ elseif ($_ -match "unordered_") { "unordered" }
+ elseif ($_ -match "cstdint|integer_fwd|integer_traits") { "integer" }
+ elseif ($_ -match "call_traits|operators|current_function|cstdlib|next_prior|compressed_pair") { "utility" }
+ elseif ($_ -match "^version|^workaround") { "config" }
+ elseif ($_ -match "enable_shared_from_this|shared_ptr|make_shared|make_unique|intrusive_ptr|scoped_ptr|pointer_cast|pointer_to_other|weak_ptr|shared_array|scoped_array") { "smart_ptr" }
+ elseif ($_ -match "iterator_adaptors|generator_iterator|pointee") { "iterator" }
+ elseif ($_ -eq "regex_fwd") { "regex" }
+ elseif ($_ -eq "make_default") { "convert" }
+ elseif ($_ -eq "foreach_fwd") { "foreach" }
+ elseif ($_ -eq "cerrno") { "system" }
+ elseif ($_ -eq "circular_buffer_fwd") { "circular_buffer" }
+ elseif ($_ -eq "archive") { "serialization" }
+ elseif ($_ -match "none|none_t") { "optional" }
+ elseif ($_ -eq "limits") { "compatibility" }
+ elseif ($_ -match "cstdfloat|math_fwd") { "math" }
+ elseif ($_ -eq "cast") { "conversion"; "numeric_conversion" } # DEPRECATED header file, includes <boost/polymorphic_cast.hpp> and <boost/numeric/conversion/cast.hpp>
+ elseif ($_ -match "polymorphic_cast|implicit_cast") { "conversion" }
+ elseif ($_ -eq "nondet_random") { "random" }
+ elseif ($_ -eq "memory_order") { "atomic" }
+ elseif ($_ -match "blank|blank_fwd|numeric_traits|fenv") { "detail" }
+ elseif ($_ -match "is_placeholder|mem_fn") { "bind" }
+ elseif ($_ -eq "exception_ptr") { "exception" }
+ elseif ($_ -match "multi_index_container|multi_index_container_fwd") { "multi_index" }
+ elseif ($_ -eq "lexical_cast") { "lexical_cast"; "math" }
+ elseif ($_ -match "token_iterator|token_functions") { "tokenizer" }
+ elseif ($_ -eq "numeric" -and $library -notmatch "numeric_conversion|interval|odeint|ublas") { "numeric_conversion"; "interval"; "odeint"; "ublas" }
+ elseif ($_ -eq "io_fwd") { "io" }
+ else { $_ }
+ } | group | % name | ? { $_ -ne $library }
+
+ #"`nFor ${library}:"
+ " [known] " + $($groups | ? { $libraries_found -contains $_ })
+ " [unknown] " + $($groups | ? { $libraries_found -notcontains $_ })
+
+ $deps = @($groups | ? { $libraries_found -contains $_ })
+
+ $deps = @($deps | ? {
+ # Boost contains cycles, so remove a few dependencies to break the loop.
+ (($library -notmatch "core|assert|mpl|detail|throw_exception|type_traits|^exception") -or ($_ -notmatch "utility")) `
+ -and `
+ (($library -notmatch "assert") -or ($_ -notmatch "integer"))`
+ -and `
+ (($library -notmatch "range") -or ($_ -notmatch "algorithm"))`
+ -and `
+ (($library -ne "config") -or ($_ -notmatch "integer"))`
+ -and `
+ (($library -notmatch "multiprecision") -or ($_ -notmatch "random|math"))`
+ -and `
+ (($library -notmatch "lexical_cast") -or ($_ -notmatch "math"))`
+ -and `
+ (($library -notmatch "functional") -or ($_ -notmatch "function"))`
+ -and `
+ (($library -notmatch "detail") -or ($_ -notmatch "static_assert|integer|mpl|type_traits"))`
+ -and `
+ ($_ -notmatch "mpi")`
+ -and `
+ (($library -notmatch "spirit") -or ($_ -notmatch "serialization"))`
+ -and `
+ (($library -notmatch "throw_exception") -or ($_ -notmatch "^exception"))`
+ -and `
+ (($library -notmatch "iostreams|math") -or ($_ -notmatch "random"))`
+ -and `
+ (($library -notmatch "utility|concept_check") -or ($_ -notmatch "iterator"))
+ } | % { $_ -replace "_","-" } | % { TransformReference $_ })
+
+ $deps += @("boost-vcpkg-helpers")
+
+ $needsBuild = $false
+ if ((Test-Path $unpacked/build/Jamfile.v2) -and $library -ne "metaparse" -and $library -ne "graph_parallel")
+ {
+ $deps += @(
+ @{ name="boost-build"; host=$True },
+ @{ name="boost-modular-build-helper"; host=$True }
+ )
+ $needsBuild = $true
+ }
+
+ if ($library -eq "python")
+ {
+ $deps += @("python3")
+ $needsBuild = $true
+ }
+ elseif ($library -eq "iostreams")
+ {
+ $deps += @("zlib", "bzip2", "liblzma", "zstd")
+ }
+ elseif ($library -eq "locale")
+ {
+ $deps += @(@{ name="libiconv"; platform="!uwp&!windows&!mingw" }, "boost-system")
+ }
+ elseif ($library -eq "asio")
+ {
+ $deps += @("openssl")
+ }
+ elseif ($library -eq "mpi")
+ {
+ $deps += @("mpi")
+ }
+
+ $portName = $library -replace "_","-"
+
+ Generate `
+ -Name $library `
+ -PortName $portName `
+ -Hash $hash `
+ -Depends $deps `
+ -NeedsBuild $needsBuild
+
+ $libraries_in_boost_port += @(TransformReference $portName)
+ }
+ finally
+ {
+ popd
+ }
+}
+
+if ($libraries_in_boost_port.length -gt 1) {
+ # Generate master boost control file which depends on each individual library
+ # mpi is excluded due to it having a dependency on msmpi/openmpi
+ $boostDependsList = $libraries_in_boost_port | ? { $_ -notmatch "boost-mpi" }
+
+ @{
+ name="boost";
+ "version-string"=$version;
+ "port-version"= $port_versions.boost ? $port_versions.boost : 0;
+ homepage="https://boost.org";
+ description="Peer-reviewed portable C++ source libraries";
+ dependencies=$boostDependsList;
+ features=@(
+ @{
+ name="mpi";
+ description="Build with MPI support";
+ dependencies=@("boost-mpi");
+ }
+ );
+ } | ConvertTo-Json -Depth 10 -Compress | out-file -enc ascii $portsDir/boost/vcpkg.json
+ & $vcpkg format-manifest "$portsDir/boost/vcpkg.json"
+
+ "set(VCPKG_POLICY_EMPTY_PACKAGE enabled)`n" | out-file -enc ascii $portsDir/boost/portfile.cmake
+}
+
+return
diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/boost/post-build-stubs/config.cmake b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/boost/post-build-stubs/config.cmake new file mode 100644 index 000000000..b09ea209b --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/boost/post-build-stubs/config.cmake @@ -0,0 +1,7 @@ +file(APPEND ${CURRENT_PACKAGES_DIR}/include/boost/config/user.hpp "\n#ifndef BOOST_ALL_NO_LIB\n#define BOOST_ALL_NO_LIB\n#endif\n")
+file(APPEND ${CURRENT_PACKAGES_DIR}/include/boost/config/user.hpp "\n#undef BOOST_ALL_DYN_LINK\n")
+
+if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
+ file(APPEND ${CURRENT_PACKAGES_DIR}/include/boost/config/user.hpp "\n#define BOOST_ALL_DYN_LINK\n")
+endif()
+file(COPY ${SOURCE_PATH}/checks DESTINATION ${CURRENT_PACKAGES_DIR}/share/boost-config)
diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/boost/post-build-stubs/context.cmake b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/boost/post-build-stubs/context.cmake new file mode 100644 index 000000000..a88f8441d --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/boost/post-build-stubs/context.cmake @@ -0,0 +1,6 @@ +
+# boost-context removed all.hpp, which is used by FindBoost to determine that context is installed
+if(NOT EXISTS ${CURRENT_PACKAGES_DIR}/include/boost/context/all.hpp)
+ file(WRITE ${CURRENT_PACKAGES_DIR}/include/boost/context/all.hpp
+ "#error \"#include <boost/context/all.hpp> is no longer supported by boost_context.\"")
+endif()
diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/boost/post-build-stubs/exception.cmake b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/boost/post-build-stubs/exception.cmake new file mode 100644 index 000000000..43594a044 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/boost/post-build-stubs/exception.cmake @@ -0,0 +1,3 @@ +
+set(VCPKG_LIBRARY_LINKAGE static)
+file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin)
diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/boost/post-build-stubs/predef.cmake b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/boost/post-build-stubs/predef.cmake new file mode 100644 index 000000000..b960fcd6e --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/boost/post-build-stubs/predef.cmake @@ -0,0 +1,2 @@ +
+file(COPY ${SOURCE_PATH}/tools/check DESTINATION ${CURRENT_PACKAGES_DIR}/share/boost-predef)
diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/boost/post-build-stubs/test.cmake b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/boost/post-build-stubs/test.cmake new file mode 100644 index 000000000..c6d07dbc4 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/boost/post-build-stubs/test.cmake @@ -0,0 +1,14 @@ +if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
+ file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/lib/manual-link)
+ file(GLOB MONITOR_LIBS ${CURRENT_PACKAGES_DIR}/lib/*_exec_monitor*)
+ file(COPY ${MONITOR_LIBS} DESTINATION ${CURRENT_PACKAGES_DIR}/lib/manual-link)
+ file(REMOVE ${MONITOR_LIBS})
+endif()
+
+if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
+ file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/lib/manual-link)
+ file(GLOB DEBUG_MONITOR_LIBS ${CURRENT_PACKAGES_DIR}/debug/lib/*_exec_monitor*)
+ file(COPY ${DEBUG_MONITOR_LIBS} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib/manual-link)
+ file(REMOVE ${DEBUG_MONITOR_LIBS})
+endif()
+
diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/boost/post-source-stubs/atomic.cmake b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/boost/post-source-stubs/atomic.cmake new file mode 100644 index 000000000..0715d20f7 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/boost/post-source-stubs/atomic.cmake @@ -0,0 +1,8 @@ +file(READ "${SOURCE_PATH}/build/Jamfile.v2" _contents)
+string(REPLACE
+ "project.load [ path.join [ path.make $(here:D) ] ../../config/checks/architecture ]"
+ "project.load [ path.join [ path.make $(here:D) ] config/checks/architecture ]"
+ _contents "${_contents}")
+file(WRITE "${SOURCE_PATH}/build/Jamfile.v2" "${_contents}")
+file(COPY "${CURRENT_INSTALLED_DIR}/share/boost-config/checks" DESTINATION "${SOURCE_PATH}/build/config")
+
diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/boost/post-source-stubs/context.cmake b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/boost/post-source-stubs/context.cmake new file mode 100644 index 000000000..9ccf34233 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/boost/post-source-stubs/context.cmake @@ -0,0 +1,5 @@ +file(READ "${SOURCE_PATH}/build/Jamfile.v2" _contents)
+string(REPLACE "import ../../config/checks/config" "import config/checks/config" _contents "${_contents}")
+file(WRITE "${SOURCE_PATH}/build/Jamfile.v2" "${_contents}")
+file(COPY "${CURRENT_INSTALLED_DIR}/share/boost-config/checks" DESTINATION "${SOURCE_PATH}/build/config")
+
diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/boost/post-source-stubs/fiber.cmake b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/boost/post-source-stubs/fiber.cmake new file mode 100644 index 000000000..9ccf34233 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/boost/post-source-stubs/fiber.cmake @@ -0,0 +1,5 @@ +file(READ "${SOURCE_PATH}/build/Jamfile.v2" _contents)
+string(REPLACE "import ../../config/checks/config" "import config/checks/config" _contents "${_contents}")
+file(WRITE "${SOURCE_PATH}/build/Jamfile.v2" "${_contents}")
+file(COPY "${CURRENT_INSTALLED_DIR}/share/boost-config/checks" DESTINATION "${SOURCE_PATH}/build/config")
+
diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/boost/post-source-stubs/log.cmake b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/boost/post-source-stubs/log.cmake new file mode 100644 index 000000000..be17a0419 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/boost/post-source-stubs/log.cmake @@ -0,0 +1,13 @@ +file(READ "${SOURCE_PATH}/build/Jamfile.v2" _contents)
+string(REPLACE "import ../../config/checks/config" "import config/checks/config" _contents "${_contents}")
+string(REPLACE " <conditional>@select-arch-specific-sources" "#<conditional>@select-arch-specific-sources" _contents "${_contents}")
+file(WRITE "${SOURCE_PATH}/build/Jamfile.v2" "${_contents}")
+file(COPY "${CURRENT_INSTALLED_DIR}/share/boost-config/checks" DESTINATION "${SOURCE_PATH}/build/config")
+
+file(READ ${SOURCE_PATH}/build/log-arch-config.jam _contents)
+string(REPLACE
+ "project.load [ path.join [ path.make $(here:D) ] ../../config/checks/architecture ]"
+ "project.load [ path.join [ path.make $(here:D) ] config/checks/architecture ]"
+ _contents "${_contents}")
+file(WRITE ${SOURCE_PATH}/build/log-arch-config.jam "${_contents}")
+
diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/boost/post-source-stubs/nowide.cmake b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/boost/post-source-stubs/nowide.cmake new file mode 100644 index 000000000..a52342259 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/boost/post-source-stubs/nowide.cmake @@ -0,0 +1,7 @@ +file(READ "${SOURCE_PATH}/build/Jamfile.v2" _contents)
+string(REPLACE "import ../../config/checks/config" "import config/checks/config" _contents "${_contents}")
+string(REPLACE "check-target-builds ../config//cxx11_moveable_fstreams" "check-target-builds ../check_movable_fstreams.cpp" _contents "${_contents}")
+string(REPLACE "check-target-builds ../config//lfs_support" "check-target-builds ../check_lfs_support.cpp" _contents "${_contents}")
+file(WRITE "${SOURCE_PATH}/build/Jamfile.v2" "${_contents}")
+file(COPY "${CURRENT_INSTALLED_DIR}/share/boost-config/checks" DESTINATION "${SOURCE_PATH}/build/config")
+file(COPY "${SOURCE_PATH}/config/check_lfs_support.cpp" "${SOURCE_PATH}/config/check_movable_fstreams.cpp" DESTINATION "${SOURCE_PATH}/build/config")
diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/boost/post-source-stubs/test.cmake b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/boost/post-source-stubs/test.cmake new file mode 100644 index 000000000..b2872338d --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/boost/post-source-stubs/test.cmake @@ -0,0 +1,5 @@ +file(READ "${SOURCE_PATH}/build/Jamfile.v2" _contents)
+string(REPLACE "import ../../predef/check/predef" "import predef/check/predef" _contents "${_contents}")
+file(WRITE "${SOURCE_PATH}/build/Jamfile.v2" "${_contents}")
+file(COPY "${CURRENT_INSTALLED_DIR}/share/boost-predef/check" DESTINATION "${SOURCE_PATH}/build/predef")
+
diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/bootstrap.ps1 b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/bootstrap.ps1 new file mode 100644 index 000000000..1b0da1d33 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/bootstrap.ps1 @@ -0,0 +1,76 @@ +[CmdletBinding()] +param( + $badParam, + [Parameter(Mandatory=$False)][switch]$win64 = $false, + [Parameter(Mandatory=$False)][string]$withVSPath = "", + [Parameter(Mandatory=$False)][string]$withWinSDK = "", + [Parameter(Mandatory=$False)][switch]$disableMetrics = $false +) +Set-StrictMode -Version Latest +# Powershell2-compatible way of forcing named-parameters +if ($badParam) +{ + if ($disableMetrics -and $badParam -eq "1") + { + Write-Warning "'disableMetrics 1' is deprecated, please change to 'disableMetrics' (without '1')." + } + else + { + throw "Only named parameters are allowed." + } +} + +if ($win64) +{ + Write-Warning "-win64 no longer has any effect; ignored." +} + +if (-Not [string]::IsNullOrWhiteSpace($withVSPath)) +{ + Write-Warning "-withVSPath no longer has any effect; ignored." +} + +if (-Not [string]::IsNullOrWhiteSpace($withWinSDK)) +{ + Write-Warning "-withWinSDK no longer has any effect; ignored." +} + +$scriptsDir = split-path -parent $script:MyInvocation.MyCommand.Definition +$vcpkgRootDir = $scriptsDir +while (!($vcpkgRootDir -eq "") -and !(Test-Path "$vcpkgRootDir\.vcpkg-root")) +{ + Write-Verbose "Examining $vcpkgRootDir for .vcpkg-root" + $vcpkgRootDir = Split-path $vcpkgRootDir -Parent +} + +Write-Verbose "Examining $vcpkgRootDir for .vcpkg-root - Found" + +& "$scriptsDir/tls12-download.exe" github.com "/microsoft/vcpkg-tool/releases/download/2021-05-05-9f849c4c43e50d1b16186ae76681c27b0c1be9d9/vcpkg.exe" "$vcpkgRootDir\vcpkg.exe" +Write-Host "" + +if ($LASTEXITCODE -ne 0) +{ + Write-Error "Downloading vcpkg.exe failed. Please check your internet connection, or consider downloading a recent vcpkg.exe from https://github.com/microsoft/vcpkg-tool with a browser." + throw +} + +if ($disableMetrics) +{ + Set-Content -Value "" -Path "$vcpkgRootDir\vcpkg.disable-metrics" -Force +} +elseif (-Not (Test-Path "$vcpkgRootDir\vcpkg.disable-metrics")) +{ + # Note that we intentionally leave any existing vcpkg.disable-metrics; once a user has + # opted out they should stay opted out. + Write-Host @" +Telemetry +--------- +vcpkg collects usage data in order to help us improve your experience. +The data collected by Microsoft is anonymous. +You can opt-out of telemetry by re-running the bootstrap-vcpkg script with -disableMetrics, +passing --disable-metrics to vcpkg on the command line, +or by setting the VCPKG_DISABLE_METRICS environment variable. + +Read more about vcpkg telemetry at docs/about/privacy.md +"@ +} diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/bootstrap.sh b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/bootstrap.sh new file mode 100644 index 000000000..9a97751d6 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/bootstrap.sh @@ -0,0 +1,325 @@ +#!/bin/sh + +# Find .vcpkg-root, which indicates the root of this repo +vcpkgRootDir=$(X= cd -- "$(dirname -- "$0")" && pwd -P) +while [ "$vcpkgRootDir" != "/" ] && ! [ -e "$vcpkgRootDir/.vcpkg-root" ]; do + vcpkgRootDir="$(dirname "$vcpkgRootDir")" +done + +# Argument parsing +vcpkgDisableMetrics="OFF" +vcpkgUseSystem=false +vcpkgAllowAppleClang=false +vcpkgBuildTests="OFF" +for var in "$@" +do + if [ "$var" = "-disableMetrics" -o "$var" = "--disableMetrics" ]; then + vcpkgDisableMetrics="ON" + elif [ "$var" = "-useSystemBinaries" -o "$var" = "--useSystemBinaries" ]; then + vcpkgUseSystem=true + elif [ "$var" = "-allowAppleClang" -o "$var" = "--allowAppleClang" ]; then + vcpkgAllowAppleClang=true + elif [ "$var" = "-buildTests" ]; then + vcpkgBuildTests="ON" + elif [ "$var" = "-help" -o "$var" = "--help" ]; then + echo "Usage: ./bootstrap-vcpkg.sh [options]" + echo + echo "Options:" + echo " -help Display usage help" + echo " -disableMetrics Do not build metrics reporting into the executable" + echo " -useSystemBinaries Force use of the system utilities for building vcpkg" + echo " -allowAppleClang Set VCPKG_ALLOW_APPLE_CLANG to build vcpkg in apple with clang anyway" + exit 1 + else + echo "Unknown argument $var. Use '-help' for help." + exit 1 + fi +done + +# Enable using this entry point on windows from git bash by redirecting to the .bat file. +unixName=$(uname -s | sed 's/MINGW.*_NT.*/MINGW_NT/') +if [ "$unixName" = "MINGW_NT" ]; then + if [ "$vcpkgDisableMetrics" = "ON" ]; then + args="-disableMetrics" + else + args="" + fi + + vcpkgRootDir=$(cygpath -aw "$vcpkgRootDir") + cmd "/C $vcpkgRootDir\\bootstrap-vcpkg.bat $args" || exit 1 + exit 0 +fi + +if [ -z ${VCPKG_DOWNLOADS+x} ]; then + downloadsDir="$vcpkgRootDir/downloads" +else + downloadsDir="$VCPKG_DOWNLOADS" + if [ ! -d "$VCPKG_DOWNLOADS" ]; then + echo "VCPKG_DOWNLOADS was set to '$VCPKG_DOWNLOADS', but that was not a directory." + exit 1 + fi + +fi + +extractStringBetweenDelimiters() +{ + input=$1;leftDelim=$2;rightDelim=$3 + output="${input##*$leftDelim}" + output="${output%%$rightDelim*}" + echo "$output" +} + +vcpkgCheckRepoTool() +{ + __tool=$1 + if ! command -v "$__tool" >/dev/null 2>&1 ; then + echo "Could not find $__tool. Please install it (and other dependencies) with:" + echo "sudo apt-get install curl zip unzip tar" + exit 1 + fi +} + +vcpkgCheckBuildTool() +{ + __tool=$1 + if ! command -v "$__tool" >/dev/null 2>&1 ; then + echo "Could not find $__tool. Please install it (and other dependencies) with:" + echo "sudo apt-get install cmake ninja-build" + exit 1 + fi +} + +vcpkgCheckEqualFileHash() +{ + url=$1; filePath=$2; expectedHash=$3 + + if command -v "sha512sum" >/dev/null 2>&1 ; then + actualHash=$(sha512sum "$filePath") + else + # sha512sum is not available by default on osx + # shasum is not available by default on Fedora + actualHash=$(shasum -a 512 "$filePath") + fi + + actualHash="${actualHash%% *}" # shasum returns [hash filename], so get the first word + + if ! [ "$expectedHash" = "$actualHash" ]; then + echo "" + echo "File does not have expected hash:" + echo " url: [ $url ]" + echo " File path: [ $downloadPath ]" + echo " Expected hash: [ $sha512 ]" + echo " Actual hash: [ $actualHash ]" + exit 1 + fi +} + +vcpkgDownloadFile() +{ + url=$1; downloadPath=$2 sha512=$3 + vcpkgCheckRepoTool "curl" + rm -rf "$downloadPath.part" + curl -L $url --tlsv1.2 --create-dirs --retry 3 --output "$downloadPath.part" || exit 1 + + vcpkgCheckEqualFileHash $url "$downloadPath.part" $sha512 + mv "$downloadPath.part" "$downloadPath" +} + +vcpkgExtractArchive() +{ + archive=$1; toPath=$2 + rm -rf "$toPath" "$toPath.partial" + mkdir -p "$toPath.partial" + + archiveType="${archive##*.}" + if [ "$archiveType" = "zip" ]; then + vcpkgCheckRepoTool "unzip" + $(cd "$toPath.partial" && unzip -qqo "$archive") + else + vcpkgCheckRepoTool "tar" + $(cd "$toPath.partial" && tar xzf "$archive") + fi + mv "$toPath.partial" "$toPath" +} + +fetchTool() +{ + tool=$1; UNAME=$2; __output=$3 + + if [ "$tool" = "" ]; then + echo "No tool name provided" + return 1 + fi + + if [ "$UNAME" = "Linux" ]; then + os="linux" + elif [ "$UNAME" = "Darwin" ]; then + os="osx" + elif [ "$UNAME" = "FreeBSD" ]; then + os="freebsd" + else + echo "Unknown uname: $UNAME" + return 1 + fi + + xmlFileAsString=`cat "$vcpkgRootDir/scripts/vcpkgTools.xml"` + toolRegexStart="<tool name=\"$tool\" os=\"$os\">" + toolData="$(extractStringBetweenDelimiters "$xmlFileAsString" "$toolRegexStart" "</tool>")" + if [ "$toolData" = "" ]; then + echo "Unknown tool: $tool" + return 1 + fi + + version="$(extractStringBetweenDelimiters "$toolData" "<version>" "</version>")" + + toolPath="$downloadsDir/tools/$tool-$version-$os" + + exeRelativePath="$(extractStringBetweenDelimiters "$toolData" "<exeRelativePath>" "</exeRelativePath>")" + exePath="$toolPath/$exeRelativePath" + + if [ -e "$exePath" ]; then + eval $__output="'$exePath'" + return 0 + fi + + isArchive=true + if [ $isArchive = true ]; then + archiveName="$(extractStringBetweenDelimiters "$toolData" "<archiveName>" "</archiveName>")" + downloadPath="$downloadsDir/$archiveName" + else + echo "Non-archives not supported yet" + return 1 + fi + + url="$(extractStringBetweenDelimiters "$toolData" "<url>" "</url>")" + sha512="$(extractStringBetweenDelimiters "$toolData" "<sha512>" "</sha512>")" + if ! [ -e "$downloadPath" ]; then + echo "Downloading $tool..." + vcpkgDownloadFile $url "$downloadPath" $sha512 + echo "Downloading $tool... done." + else + vcpkgCheckEqualFileHash $url "$downloadPath" $sha512 + fi + + if [ $isArchive = true ]; then + echo "Extracting $tool..." + vcpkgExtractArchive "$downloadPath" "$toolPath" + echo "Extracting $tool... done." + fi + + if ! [ -e "$exePath" ]; then + echo "Could not detect or download $tool" + return 1 + fi + + eval $__output="'$exePath'" + return 0 +} + +selectCXX() +{ + if [ "x$CXX" = "x" ]; then + if which g++-11 >/dev/null 2>&1; then + CXX=g++-11 + elif which g++-10 >/dev/null 2>&1; then + CXX=g++-10 + elif which g++-9 >/dev/null 2>&1; then + CXX=g++-9 + elif which g++-8 >/dev/null 2>&1; then + CXX=g++-8 + elif which g++-7 >/dev/null 2>&1; then + CXX=g++-7 + elif which g++-6 >/dev/null 2>&1; then + CXX=g++-6 + elif which g++ >/dev/null 2>&1; then + CXX=g++ + fi + # If we can't find g++, allow CMake to do the look-up + fi +} + +# Preparation +UNAME="$(uname)" +ARCH="$(uname -m)" + +# Force using system utilities for building vcpkg if host arch is arm, arm64, s390x, or ppc64le. +if [ "$ARCH" = "armv7l" -o "$ARCH" = "aarch64" -o "$ARCH" = "s390x" -o "$ARCH" = "ppc64le" ]; then + vcpkgUseSystem=true +fi + +if [ "$UNAME" = "OpenBSD" ]; then + vcpkgUseSystem=true + + if [ -z "$CXX" ]; then + CXX=/usr/bin/clang++ + fi + if [ -z "$CC" ]; then + CC=/usr/bin/clang + fi +fi + +if $vcpkgUseSystem; then + cmakeExe="cmake" + ninjaExe="ninja" + vcpkgCheckBuildTool "$cmakeExe" + vcpkgCheckBuildTool "$ninjaExe" +else + fetchTool "cmake" "$UNAME" cmakeExe || exit 1 + fetchTool "ninja" "$UNAME" ninjaExe || exit 1 +fi +if [ "$os" = "osx" ]; then + if [ "$vcpkgAllowAppleClang" = "true" ] ; then + CXX=clang++ + else + selectCXX + fi +else + selectCXX +fi + +# Do the build +vcpkgToolReleaseTag="2021-05-05-9f849c4c43e50d1b16186ae76681c27b0c1be9d9" +vcpkgToolReleaseSha="2b85eb0da65221d207a5023eda0d4da74258d7fb5db9e211718efb2573673daa3fa98a75af4a570595f12467a8f7e7759a3be01b33598a4fb6d4203bf83949ef" +vcpkgToolReleaseTarball="$vcpkgToolReleaseTag.tar.gz" +vcpkgToolUrl="https://github.com/microsoft/vcpkg-tool/archive/$vcpkgToolReleaseTarball" +baseBuildDir="$vcpkgRootDir/buildtrees/_vcpkg" +buildDir="$baseBuildDir/build" +tarballPath="$downloadsDir/$vcpkgToolReleaseTarball" +srcBaseDir="$baseBuildDir/src" +srcDir="$srcBaseDir/vcpkg-tool-$vcpkgToolReleaseTag" + +if [ -e "$tarballPath" ]; then + vcpkgCheckEqualFileHash "$vcpkgToolUrl" "$tarballPath" "$vcpkgToolReleaseSha" +else + echo "Downloading vcpkg tool sources" + vcpkgDownloadFile "$vcpkgToolUrl" "$tarballPath" "$vcpkgToolReleaseSha" +fi + +echo "Building vcpkg-tool..." +rm -rf "$baseBuildDir" +mkdir -p "$buildDir" +vcpkgExtractArchive "$tarballPath" "$srcBaseDir" + +(cd "$buildDir" && CXX="$CXX" "$cmakeExe" "$srcDir" -DCMAKE_BUILD_TYPE=Release -G "Ninja" "-DCMAKE_MAKE_PROGRAM=$ninjaExe" "-DBUILD_TESTING=$vcpkgBuildTests" "-DVCPKG_DEVELOPMENT_WARNINGS=OFF" "-DVCPKG_ALLOW_APPLE_CLANG=$vcpkgAllowAppleClang") || exit 1 +(cd "$buildDir" && "$cmakeExe" --build .) || exit 1 + +rm -rf "$vcpkgRootDir/vcpkg" +cp "$buildDir/vcpkg" "$vcpkgRootDir/" + +if [ "$vcpkgDisableMetrics" = "ON" ]; then + touch "$vcpkgRootDir/vcpkg.disable-metrics" +elif ! [ -f "$vcpkgRootDir/vcpkg.disable-metrics" ]; then + # Note that we intentionally leave any existing vcpkg.disable-metrics; once a user has + # opted out they should stay opted out. + cat <<EOF +Telemetry +--------- +vcpkg collects usage data in order to help us improve your experience. +The data collected by Microsoft is anonymous. +You can opt-out of telemetry by re-running the bootstrap-vcpkg script with -disableMetrics, +passing --disable-metrics to vcpkg on the command line, +or by setting the VCPKG_DISABLE_METRICS environment variable. + +Read more about vcpkg telemetry at docs/about/privacy.md +EOF +fi diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/build_info.cmake b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/build_info.cmake new file mode 100644 index 000000000..a6208016a --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/build_info.cmake @@ -0,0 +1,40 @@ +set(BUILD_INFO_FILE_PATH ${CURRENT_PACKAGES_DIR}/BUILD_INFO)
+file(WRITE ${BUILD_INFO_FILE_PATH} "CRTLinkage: ${VCPKG_CRT_LINKAGE}\n")
+file(APPEND ${BUILD_INFO_FILE_PATH} "LibraryLinkage: ${VCPKG_LIBRARY_LINKAGE}\n")
+
+if (DEFINED VCPKG_POLICY_DLLS_WITHOUT_LIBS)
+ file(APPEND ${BUILD_INFO_FILE_PATH} "PolicyDLLsWithoutLIBs: ${VCPKG_POLICY_DLLS_WITHOUT_LIBS}\n")
+endif()
+if (DEFINED VCPKG_POLICY_DLLS_WITHOUT_EXPORTS)
+ file(APPEND ${BUILD_INFO_FILE_PATH} "PolicyDLLsWithoutExports: ${VCPKG_POLICY_DLLS_WITHOUT_EXPORTS}\n")
+endif()
+if (DEFINED VCPKG_POLICY_DLLS_IN_STATIC_LIBRARY)
+ file(APPEND ${BUILD_INFO_FILE_PATH} "PolicyDLLsInStaticLibrary: ${VCPKG_POLICY_DLLS_IN_STATIC_LIBRARY}\n")
+endif()
+if (DEFINED VCPKG_POLICY_MISMATCHED_NUMBER_OF_BINARIES)
+ file(APPEND ${BUILD_INFO_FILE_PATH} "PolicyMismatchedNumberOfBinaries: ${VCPKG_POLICY_MISMATCHED_NUMBER_OF_BINARIES}\n")
+endif()
+if (DEFINED VCPKG_POLICY_EMPTY_PACKAGE)
+ file(APPEND ${BUILD_INFO_FILE_PATH} "PolicyEmptyPackage: ${VCPKG_POLICY_EMPTY_PACKAGE}\n")
+endif()
+if (DEFINED VCPKG_POLICY_ONLY_RELEASE_CRT)
+ file(APPEND ${BUILD_INFO_FILE_PATH} "PolicyOnlyReleaseCRT: ${VCPKG_POLICY_ONLY_RELEASE_CRT}\n")
+endif()
+if (DEFINED VCPKG_POLICY_ALLOW_OBSOLETE_MSVCRT)
+ file(APPEND ${BUILD_INFO_FILE_PATH} "PolicyAllowObsoleteMsvcrt: ${VCPKG_POLICY_ALLOW_OBSOLETE_MSVCRT}\n")
+endif()
+if (DEFINED VCPKG_POLICY_EMPTY_INCLUDE_FOLDER)
+ file(APPEND ${BUILD_INFO_FILE_PATH} "PolicyEmptyIncludeFolder: ${VCPKG_POLICY_EMPTY_INCLUDE_FOLDER}\n")
+endif()
+if (DEFINED VCPKG_POLICY_ALLOW_RESTRICTED_HEADERS)
+ file(APPEND ${BUILD_INFO_FILE_PATH} "PolicyAllowRestrictedHeaders: ${VCPKG_POLICY_ALLOW_RESTRICTED_HEADERS}\n")
+endif()
+if (DEFINED VCPKG_POLICY_SKIP_DUMPBIN_CHECKS)
+ file(APPEND ${BUILD_INFO_FILE_PATH} "PolicySkipDumpbinChecks: ${VCPKG_POLICY_SKIP_DUMPBIN_CHECKS}\n")
+endif()
+if (DEFINED VCPKG_POLICY_SKIP_ARCHITECTURE_CHECK)
+ file(APPEND ${BUILD_INFO_FILE_PATH} "PolicySkipArchitectureCheck: ${VCPKG_POLICY_SKIP_ARCHITECTURE_CHECK}\n")
+endif()
+if (DEFINED VCPKG_HEAD_VERSION)
+ file(APPEND ${BUILD_INFO_FILE_PATH} "Version: ${VCPKG_HEAD_VERSION}\n")
+endif()
diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/buildsystems/make_wrapper/cl_cpp_wrapper b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/buildsystems/make_wrapper/cl_cpp_wrapper new file mode 100644 index 000000000..32fde518f --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/buildsystems/make_wrapper/cl_cpp_wrapper @@ -0,0 +1,104 @@ +#!/usr/bin/bash +# cl_cpp_wrapper +# Wrapper around MS's cl.exe to make it act more like Unix cpp + +PATH="$PATH:/usr/bin" + +case $MACHTYPE in + *-msys) + slash="-" + ;; + *) + slash="/" + ;; +esac + +# prog specifies the program that should be run cl.exe +prog=cl.exe +debug= +cppopt=("${slash}nologo") +cppopt+=("${slash}E") +verbose= +shared_index=-1 + +processargs() +{ +### Run through every option and convert it to the proper MS one +while test $# -gt 0; do + case "$1" in + -D*) optarg= ;; + -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;; + *) optarg= ;; + esac + gotparam=1 + case "$1" in + --help) + usage + exit 0 + ;; + --verbose) + verbose=1 + ;; + -*) + # Remaining '-' options are passed to the compiler + if test x$optarg != x ; then + cppopt+=("${slash}${1:1}=$optarg") + else + cppopt+=("${slash}${1:1}") + fi + ;; + + /*) + # All '/' options are assumed to be for cpp and are passed through + cppopt+=("${slash}${1:1}") + ;; + + *) + file=$1 + #cppopt+=("$1") + ;; + esac + shift +done +} + +# Whitespace in paths is dealt with by setting IFS and using bash arrays + +# processargs $CPP_FLAGS +IFS="" +processargs $@ + +if test x$V = x1 ; then + verbose=1 +fi + +if test -n "$verbose" ; then + echo -n "$prog" + for opt in "${cppopt[@]}" ; do + echo -n " \"$opt\"" + done + echo "" +fi + +[ $# -ge 1 -a -f "$1" ] && input="$file" || input="-" + +input_file="${file:-/proc/self/fd/0}" +if [ "$input_file" == "/proc/self/fd/0" ]; then + #echo "STDIN" + # CL does not support reading from STDIN so it is wrapped here. + tmpout=cpp_wrapper_$RANDOM.h + /usr/bin/cp $input_file $tmpout + # from https://stackoverflow.com/questions/36313562/how-to-redirect-stdin-to-file-in-bash + #exec 3> cppstdtmp.h + #while IFS= read -r line; do + # printf '%s' "$line" + #done + #exec 3<&- + #echo "$(</dev/stdin)" > cppstdtmp.h + exec $prog ${cppopt[@]} $tmpout + rm -f $tmpout +else + #echo "FILE" + exec $prog ${cppopt[@]} $input_file +fi + diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/buildsystems/make_wrapper/windres-rc b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/buildsystems/make_wrapper/windres-rc new file mode 100644 index 000000000..88cc8425f --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/buildsystems/make_wrapper/windres-rc @@ -0,0 +1,130 @@ +#! /bin/sh +# Wrapper for windres to rc which do not understand '-i -o --output-format'. +# cvtres is invoked by the linker +scriptversion=2020-08-17.03; # UTC + + +nl=' +' + +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent tools from complaining about whitespace usage. +IFS=" "" $nl" + +file_conv= + +# func_file_conv build_file lazy +# Convert a $build file to $host form and store it in $file +# Currently only supports Windows hosts. If the determined conversion +# type is listed in (the comma separated) LAZY, no conversion will +# take place. +func_file_conv () +{ + file=$1 + case $file in + / | /[!/]*) # absolute file, and not a UNC file + if test -z "$file_conv"; then + # lazily determine how to convert abs files + case `uname -s` in + MINGW*) + file_conv=mingw + ;; + CYGWIN* | MSYS*) + file_conv=cygwin + ;; + *) + file_conv=wine + ;; + esac + fi + case $file_conv/,$2, in + *,$file_conv,*) + ;; + mingw/*) + file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` + ;; + cygwin/* | msys/*) + file=`cygpath -m "$file" || echo "$file"` + ;; + wine/*) + file=`winepath -w "$file" || echo "$file"` + ;; + esac + ;; + esac +} + +# func_windres_wrapper rc args... +# Adjust compile command to suit rc instead of windres +func_windres_wrapper () +{ + echo "FROM WINDRESWRAPPER FUNCTION:$@" + echo "RCFLAGS:$(RCFLAGS)" + # Assume a capable shell + in= + out= + + for arg + do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + eat=1 + func_file_conv "$2" + out="$file" + echo "OUTPUT:$file" + set x "$@" + shift + ;; + *.obj) + func_file_conv "$1" + out="$file" + echo "OUTPUT:$file" + set x "$@" + shift + ;; + --output-format=*) + set x "$@" + shift + ;; + -i) + eat=1 + func_file_conv "$2" mingw + in="$file" + echo "INPUT:$file" + set x "$@" + shift + ;; + -*) + set x "$@" "${1//\\\"/\"}" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift + done + echo "$@" -fo "$out" "$in" + exec "$@" -fo "$out" "$in" + exit 1 +} + +eat= + +func_windres_wrapper "$@" + + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'before-save-hook 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC0" +# time-stamp-end: "; # UTC" +# End: diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/buildsystems/meson/none.txt b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/buildsystems/meson/none.txt new file mode 100644 index 000000000..6dafc8090 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/buildsystems/meson/none.txt @@ -0,0 +1,19 @@ +# native file used to make the build machine compiler unusable + +[host_machine] +system = 'none' +cpu_family = 'none' +cpu = 'none' +endian = 'little' + +[properties] + +[binaries] +c = ['false'] +cpp = ['false'] +objc = ['false'] +objcpp = ['false'] +ar = ['false'] +pkgconfig = ['false'] +cmake = ['false'] +ninja = ['false']
\ No newline at end of file diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/buildsystems/msbuild/applocal.ps1 b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/buildsystems/msbuild/applocal.ps1 new file mode 100644 index 000000000..2e8d76cc2 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/buildsystems/msbuild/applocal.ps1 @@ -0,0 +1,152 @@ +[cmdletbinding()] +param([string]$targetBinary, [string]$installedDir, [string]$tlogFile, [string]$copiedFilesLog) + +$g_searched = @{} +# Note: installedDir is actually the bin\ directory. +$g_install_root = Split-Path $installedDir -parent +$g_is_debug = $g_install_root -match '(.*\\)?debug(\\)?$' + +# Ensure we create the copied files log, even if we don't end up copying any files +if ($copiedFilesLog) +{ + Set-Content -Path $copiedFilesLog -Value "" -Encoding UTF8 +} + +function computeHash([System.Security.Cryptography.HashAlgorithm]$alg, [string]$str) { + $bytes = [System.Text.Encoding]::UTF8.GetBytes($str) + $hash = $alg.ComputeHash($bytes) + return [Convert]::ToBase64String($hash) +} + +function getMutex([string]$targetDir) { + $sha512Hash = [System.Security.Cryptography.SHA512]::Create() + if ($sha512Hash) { + $hash = computeHash $sha512Hash $targetDir + $mtxName = "VcpkgAppLocalDeployBinary-" + $hash + return New-Object System.Threading.Mutex($false, $mtxName) + } + + return New-Object System.Threading.Mutex($false, "VcpkgAppLocalDeployBinary") +} + +# Note: this function signature is depended upon by the qtdeploy.ps1 script introduced in 5.7.1-7 +function deployBinary([string]$targetBinaryDir, [string]$SourceDir, [string]$targetBinaryName) { + try { + $mtx = getMutex($targetBinaryDir) + if ($mtx) { + $mtx.WaitOne() | Out-Null + } + + if (Test-Path "$targetBinaryDir\$targetBinaryName") { + $sourceModTime = (Get-Item $SourceDir\$targetBinaryName).LastWriteTime + $destModTime = (Get-Item $targetBinaryDir\$targetBinaryName).LastWriteTime + if ($destModTime -lt $sourceModTime) { + Write-Verbose " ${targetBinaryName}: Updating $SourceDir\$targetBinaryName" + Copy-Item "$SourceDir\$targetBinaryName" $targetBinaryDir + } else { + Write-Verbose " ${targetBinaryName}: already present" + } + } + else { + Write-Verbose " ${targetBinaryName}: Copying $SourceDir\$targetBinaryName" + Copy-Item "$SourceDir\$targetBinaryName" $targetBinaryDir + } + if ($copiedFilesLog) { Add-Content $copiedFilesLog "$targetBinaryDir\$targetBinaryName" -Encoding UTF8 } + if ($tlogFile) { Add-Content $tlogFile "$targetBinaryDir\$targetBinaryName" -Encoding Unicode } + } finally { + if ($mtx) { + $mtx.ReleaseMutex() | Out-Null + $mtx.Dispose() | Out-Null + } + } +} + + +Write-Verbose "Resolving base path $targetBinary..." +try +{ + $baseBinaryPath = Resolve-Path $targetBinary -erroraction stop + $baseTargetBinaryDir = Split-Path $baseBinaryPath -parent +} +catch [System.Management.Automation.ItemNotFoundException] +{ + return +} + +# Note: this function signature is depended upon by the qtdeploy.ps1 script +function resolve([string]$targetBinary) { + Write-Verbose "Resolving $targetBinary..." + try + { + $targetBinaryPath = Resolve-Path $targetBinary -erroraction stop + } + catch [System.Management.Automation.ItemNotFoundException] + { + return + } + $targetBinaryDir = Split-Path $targetBinaryPath -parent + + if (Get-Command "dumpbin" -ErrorAction SilentlyContinue) { + $a = $(dumpbin /DEPENDENTS $targetBinary | ? { $_ -match "^ [^ ].*\.dll" } | % { $_ -replace "^ ","" }) + } elseif (Get-Command "llvm-objdump" -ErrorAction SilentlyContinue) { + $a = $(llvm-objdump -p $targetBinary| ? { $_ -match "^ {4}DLL Name: .*\.dll" } | % { $_ -replace "^ {4}DLL Name: ","" }) + } else { + Write-Error "Neither dumpbin nor llvm-objdump could be found. Can not take care of dll dependencies." + } + $a | % { + if ([string]::IsNullOrEmpty($_)) { + return + } + if ($g_searched.ContainsKey($_)) { + Write-Verbose " ${_}: previously searched - Skip" + return + } + $g_searched.Set_Item($_, $true) + if (Test-Path "$installedDir\$_") { + deployBinary $baseTargetBinaryDir $installedDir "$_" + if (Test-Path function:\deployPluginsIfQt) { deployPluginsIfQt $baseTargetBinaryDir "$g_install_root\plugins" "$_" } + if (Test-Path function:\deployOpenNI2) { deployOpenNI2 $targetBinaryDir "$g_install_root" "$_" } + if (Test-Path function:\deployPluginsIfMagnum) { + if ($g_is_debug) { + deployPluginsIfMagnum $targetBinaryDir "$g_install_root\bin\magnum-d" "$_" + } else { + deployPluginsIfMagnum $targetBinaryDir "$g_install_root\bin\magnum" "$_" + } + } + if (Test-Path function:\deployAzureKinectSensorSDK) { deployAzureKinectSensorSDK $targetBinaryDir "$g_install_root" "$_" } + resolve "$baseTargetBinaryDir\$_" + } elseif (Test-Path "$targetBinaryDir\$_") { + Write-Verbose " ${_}: $_ not found in vcpkg; locally deployed" + resolve "$targetBinaryDir\$_" + } else { + Write-Verbose " ${_}: $installedDir\$_ not found" + } + } + Write-Verbose "Done Resolving $targetBinary." +} + +# Note: This is a hack to make Qt5 work. +# Introduced with Qt package version 5.7.1-7 +if (Test-Path "$g_install_root\plugins\qtdeploy.ps1") { + . "$g_install_root\plugins\qtdeploy.ps1" +} + +# Note: This is a hack to make OpenNI2 work. +if (Test-Path "$g_install_root\bin\OpenNI2\openni2deploy.ps1") { + . "$g_install_root\bin\OpenNI2\openni2deploy.ps1" +} + +# Note: This is a hack to make Magnum work. +if (Test-Path "$g_install_root\bin\magnum\magnumdeploy.ps1") { + . "$g_install_root\bin\magnum\magnumdeploy.ps1" +} elseif (Test-Path "$g_install_root\bin\magnum-d\magnumdeploy.ps1") { + . "$g_install_root\bin\magnum-d\magnumdeploy.ps1" +} + +# Note: This is a hack to make Azure Kinect Sensor SDK work. +if (Test-Path "$g_install_root\tools\azure-kinect-sensor-sdk\k4adeploy.ps1") { + . "$g_install_root\tools\azure-kinect-sensor-sdk\k4adeploy.ps1" +} + +resolve($targetBinary) +Write-Verbose $($g_searched | out-string) diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/buildsystems/msbuild/vcpkg-general.xml b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/buildsystems/msbuild/vcpkg-general.xml new file mode 100644 index 000000000..5c84aa0da --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/buildsystems/msbuild/vcpkg-general.xml @@ -0,0 +1,80 @@ +<?xml version="1.0" encoding="utf-8"?> +<Rule Name="VcpkgOptions" DisplayName="vcpkg" PageTemplate="generic" Description="Vcpkg" + xmlns="http://schemas.microsoft.com/build/2009/properties"> + + <Rule.Categories> + <Category Name="General" DisplayName="General" Description="General Vcpkg Configuration" /> + <Category Name="Conditional" DisplayName="Target and Configuration Specific" Description="Conditional Vcpkg Configuration" /> + </Rule.Categories> + + <Rule.DataSource> + <!-- Note: HasConfigurationCondition must be either "true" or ommitted. Otherwise, the vcpkg property sheet will not be displayed. --> + <!-- Note: Remove all instances of 'Label="Vcpkg"' from this file if the vcpkg property sheet does not display any values. --> + <DataSource Persistence="ProjectFile" Label="Vcpkg" HasConfigurationCondition="true" /> + </Rule.DataSource> + + <BoolProperty Name="VcpkgEnabled" DisplayName="Use Vcpkg" Category="General" Default="true" + Description="Use Vcpkg for includes and libraries."> + <BoolProperty.DataSource> + <DataSource Persistence="ProjectFile" Label="Vcpkg" HasConfigurationCondition="false" /> + </BoolProperty.DataSource> + </BoolProperty> + + <BoolProperty Name="VcpkgEnableManifest" DisplayName="Use Vcpkg Manifest" Category="General" Default="false" + Description="Use the vcpkg manifest file to define your dependencies."> + <BoolProperty.DataSource> + <DataSource Persistence="ProjectFile" Label="Vcpkg" HasConfigurationCondition="false" /> + </BoolProperty.DataSource> + </BoolProperty> + + <BoolProperty Name="VcpkgManifestInstall" DisplayName="Install Vcpkg Dependencies" Category="General" Default="true" + Description="Install dependencies from the vcpkg manifest."> + <BoolProperty.DataSource> + <DataSource Persistence="ProjectFile" Label="Vcpkg" HasConfigurationCondition="false" /> + </BoolProperty.DataSource> + </BoolProperty> + + <BoolProperty Name="VcpkgAutoLink" DisplayName="Use AutoLink" Category="General" Default="true" + Description="Enables automatic linking with libraries build using Vcpkg. Does not work with lld-link.exe."> + <BoolProperty.DataSource> + <DataSource Persistence="ProjectFile" Label="Vcpkg" HasConfigurationCondition="false" /> + </BoolProperty.DataSource> + </BoolProperty> + + <StringProperty Name="VcpkgRoot" DisplayName="Vcpkg Root" Category="General" Subtype="folder" Visible="false" + Description="Root path where Vcpkg is located. Be careful with changing this one. It is, for example, unable to update this property page from the new location without restarting visual studio."> + <StringProperty.DataSource> + <DataSource Persistence="ProjectFile" Label="Vcpkg" HasConfigurationCondition="false" /> + </StringProperty.DataSource> + </StringProperty> + + <StringProperty Name="VcpkgManifestRoot" DisplayName="Vcpkg Manifest Root" Category="General" Subtype="folder" Visible="false" + Description="The path to the directory which contains the manifest file, and the vcpkg_installed directory."> + <StringProperty.DataSource> + <DataSource Persistence="ProjectFile" Label="Vcpkg" HasConfigurationCondition="false" /> + </StringProperty.DataSource> + </StringProperty> + + <StringProperty Name="VcpkgInstalledDir" DisplayName="Installed Directory" Category="General" Subtype="folder" Visible="true" + Description="The location where headers and binaries will be consumed from. In manifest mode, this directory will be created and populated based on vcpkg.json."> + </StringProperty> + + <BoolProperty Name="VcpkgUseStatic" DisplayName="Use Static Libraries" Category="Conditional" Default="false" + Description="Vcpkg can build static libraries (e.g. x64-windows-static). This options changes the default triplet to use these static libraries by appending -static to $(VcpkgTriplet). This will not be shown in the evaluation of the Triplet within the UI." /> + + <StringProperty Name="VcpkgTriplet" DisplayName="Triplet" Category="Conditional" Subtype="Text" + Description="Specifies the triplet used by Vcpkg. Does not include the '-static' suffix that may be added by the 'Use static libraries' flag." /> + + <StringProperty Name="VcpkgHostTriplet" DisplayName="Host Triplet" Category="Conditional" Subtype="Text" + Description="Specifies the host triplet used by Vcpkg. If empty, this will be automatically determined." /> + + <StringProperty Name="VcpkgAdditionalInstallOptions" DisplayName="Additional Options" Category="General" Subtype="Text" + Description="Additional command line options to be passed to the underlying vcpkg tool when installing in manifest mode." /> + + <EnumProperty Name="VcpkgConfiguration" DisplayName="Vcpkg Configuration" Category="Conditional" + Description="Specifies if release or debug libraries build with vcpkg should be used."> + <EnumValue Name="Release" Description="Uses release libraries" /> + <EnumValue Name="Debug" Description="Uses debug libraries" /> + </EnumProperty> + +</Rule> diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/buildsystems/msbuild/vcpkg.props b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/buildsystems/msbuild/vcpkg.props new file mode 100644 index 000000000..788ba107b --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/buildsystems/msbuild/vcpkg.props @@ -0,0 +1,34 @@ +<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <!-- Do not define derived properties here. This file may be imported once and some of the properties below may be overridden afterwards -->
+
+ <!-- Set default OS Target-->
+ <PropertyGroup Condition="'$(VcpkgOSTarget)' == ''">
+ <VcpkgOSTarget>windows</VcpkgOSTarget>
+ <VcpkgOSTarget Condition="'$(AppContainerApplication)' == 'true'">uwp</VcpkgOSTarget>
+ </PropertyGroup>
+
+ <!-- Set default Platform Target. $(PlatformTarget) is not available at the top of the .vcxproj file. -->
+ <PropertyGroup Condition="'$(VcpkgPlatformTarget)' == ''">
+ <VcpkgPlatformTarget>$(Platform)</VcpkgPlatformTarget>
+ <VcpkgPlatformTarget Condition="'$(Platform)' == 'Win32'">x86</VcpkgPlatformTarget>
+ </PropertyGroup>
+
+ <PropertyGroup>
+ <VcpkgPropsImported>true</VcpkgPropsImported>
+ <VcpkgEnabled Condition="'$(VcpkgEnabled)' == ''">true</VcpkgEnabled>
+ <VcpkgConfiguration Condition="'$(VcpkgConfiguration)' == ''">$(Configuration)</VcpkgConfiguration>
+ <VcpkgUseStatic Condition="'$(VcpkgUseStatic)' == ''">false</VcpkgUseStatic>
+ <VcpkgRoot Condition="'$(VcpkgRoot)' == ''">$([System.IO.Path]::Combine($(MSBuildThisFileDirectory), '..\..\..'))</VcpkgRoot>
+
+ <VcpkgAutoLink Condition="'$(VcpkgAutoLink)' == ''">true</VcpkgAutoLink>
+ <!-- Deactivate Autolinking if lld is used as a linker. (Until a better way to solve the problem is found!).
+ Tried to add /lib as a parameter to the linker call but was unable to find a way to pass it as the first parameter. -->
+ <VcpkgAutoLink Condition="'$(UseLldLink)' == 'true'">false</VcpkgAutoLink>
+
+ <!-- Manifest files -->
+ <VcpkgEnableManifest Condition="'$(VcpkgEnableManifest)' == ''">false</VcpkgEnableManifest>
+ <VcpkgManifestInstall Condition="'$(VcpkgManifestInstall)' == ''">true</VcpkgManifestInstall>
+ <VcpkgManifestRoot Condition="'$(VcpkgManifestRoot)' == ''">$([MSbuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), vcpkg.json))</VcpkgManifestRoot>
+ </PropertyGroup>
+
+</Project>
diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/buildsystems/msbuild/vcpkg.targets b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/buildsystems/msbuild/vcpkg.targets new file mode 100644 index 000000000..7653c4e91 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/buildsystems/msbuild/vcpkg.targets @@ -0,0 +1,158 @@ +<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" TreatAsLocalProperty="VcpkgConfigSubdir;_ZVcpkgCurrentInstalledDir;VcpkgNormalizedConfiguration"> + + <!-- Import default properties if not done yet. This does not overwrite any previously defined properties. --> + <Import Condition="'$(VcpkgPropsImported)' != 'true'" Project="vcpkg.props" /> + + <!-- Define properties derived from those defined in vcpkg.props, in the project file or specified on the command line. --> + <PropertyGroup> + <!-- Note: Overwrite VcpkgPageSchema with a non-existing path to disable the VcPkg property sheet in your projects --> + <VcpkgPageSchema Condition="'$(VcpkgPageSchema)' == ''">$([System.IO.Path]::Combine($(VcpkgRoot), 'scripts\buildsystems\msbuild\vcpkg-general.xml'))</VcpkgPageSchema> + </PropertyGroup> + + <PropertyGroup Condition="'$(VcpkgEnabled)' == 'true'"> + <!-- Triplet defining platform, OS, and linkage --> + <VcpkgLinkage /> + <VcpkgLinkage Condition="'$(VcpkgUseStatic)' == 'true'">-static</VcpkgLinkage> + <VcpkgTriplet Condition="'$(VcpkgTriplet)' == ''">$(VcpkgPlatformTarget)-$(VcpkgOSTarget)$(VcpkgLinkage)</VcpkgTriplet> + + <VcpkgRoot Condition="'$(VcpkgRoot)' != '' and !$(VcpkgRoot.EndsWith('\'))">$(VcpkgRoot)\</VcpkgRoot> + <VcpkgManifestRoot Condition="'$(VcpkgManifestRoot)' != '' and !$(VcpkgManifestRoot.EndsWith('\'))">$(VcpkgManifestRoot)\</VcpkgManifestRoot> + + <VcpkgInstalledDir Condition="'$(VcpkgInstalledDir)' == '' and '$(VcpkgEnableManifest)' != 'true'">$([System.IO.Path]::Combine($(VcpkgRoot), 'installed'))</VcpkgInstalledDir> + <VcpkgInstalledDir Condition="'$(VcpkgInstalledDir)' == '' and '$(VcpkgEnableManifest)' == 'true'">$([System.IO.Path]::Combine($(VcpkgManifestRoot), 'vcpkg_installed'))</VcpkgInstalledDir> + <VcpkgInstalledDir Condition="!$(VcpkgInstalledDir.EndsWith('\'))">$(VcpkgInstalledDir)\</VcpkgInstalledDir> + + <_ZVcpkgCurrentInstalledDir>$([System.IO.Path]::Combine($(VcpkgInstalledDir), $(VcpkgTriplet)))</_ZVcpkgCurrentInstalledDir> + <_ZVcpkgCurrentInstalledDir Condition="!$(_ZVcpkgCurrentInstalledDir.EndsWith('\'))">$(_ZVcpkgCurrentInstalledDir)\</_ZVcpkgCurrentInstalledDir> + + <VcpkgNormalizedConfiguration Condition="$(VcpkgConfiguration.StartsWith('Debug'))">Debug</VcpkgNormalizedConfiguration> + <VcpkgNormalizedConfiguration Condition="$(VcpkgConfiguration.StartsWith('Release')) or '$(VcpkgConfiguration)' == 'RelWithDebInfo' or '$(VcpkgConfiguration)' == 'MinSizeRel'">Release</VcpkgNormalizedConfiguration> + + <VcpkgConfigSubdir Condition="'$(VcpkgNormalizedConfiguration)' == 'Debug'">debug\</VcpkgConfigSubdir> + <VcpkgApplocalDeps Condition="'$(VcpkgApplocalDeps)' == ''">true</VcpkgApplocalDeps> + + <_ZVcpkgHostTripletParameter Condition="'$(VcpkgHostTriplet)' != ''">"--host-triplet=$(VcpkgHostTriplet)"</_ZVcpkgHostTripletParameter> + <_ZVcpkgExecutable>$([System.IO.Path]::Combine($(VcpkgRoot), 'vcpkg.exe'))</_ZVcpkgExecutable> + + <ProjectStateLine>VcpkgTriplet=$(VcpkgTriplet):$(ProjectStateLine)</ProjectStateLine> + </PropertyGroup> + + <!-- Import property page 'Vcpkg' --> + <ItemGroup Condition="'$(VcpkgPageSchema)' != '' and exists('$(VcpkgPageSchema)')"> + <PropertyPageSchema Include="$(VcpkgPageSchema)"> + <Context>Project</Context> + </PropertyPageSchema> + </ItemGroup> + + <ItemDefinitionGroup Condition="'$(VcpkgEnabled)' == 'true'"> + <Link> + <AdditionalDependencies Condition="'$(VcpkgAutoLink)' != 'false'">%(AdditionalDependencies);$(_ZVcpkgCurrentInstalledDir)$(VcpkgConfigSubdir)lib\*.lib</AdditionalDependencies> + <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories);$(_ZVcpkgCurrentInstalledDir)$(VcpkgConfigSubdir)lib;$(_ZVcpkgCurrentInstalledDir)$(VcpkgConfigSubdir)lib\manual-link</AdditionalLibraryDirectories> + </Link> + <ClCompile> + <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(_ZVcpkgCurrentInstalledDir)include</AdditionalIncludeDirectories> + </ClCompile> + <ResourceCompile> + <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(_ZVcpkgCurrentInstalledDir)include</AdditionalIncludeDirectories> + </ResourceCompile> + </ItemDefinitionGroup> + + <Target Name="VcpkgCheckManifestRoot" BeforeTargets="VcpkgInstallManifestDependencies" Condition="'$(VcpkgEnabled)' == 'true'"> + <Error Text="The vcpkg manifest was enabled, but we couldn't find a manifest file (vcpkg.json) in any directories above $(MSBuildProjectDirectory). Please add a manifest, disable manifests in your properties page, or pass /p:VcpkgEnableManifest=false." + Condition="'$(VcpkgEnableManifest)' == 'true' and '$(VcpkgManifestRoot)' == ''" /> + <Message Text="The vcpkg manifest was disabled, but we found a manifest file in $(VcpkgManifestRoot). You may want to enable vcpkg manifests in your properties page or pass /p:VcpkgEnableManifest=true to the msbuild invocation." + Importance="High" Condition="'$(VcpkgEnableManifest)' != 'true' and '$(VcpkgManifestRoot)' != ''" /> + </Target> + + <Target Name="VcpkgTripletSelection" BeforeTargets="ClCompile"> + <Message Text="Using triplet "$(VcpkgTriplet)" from "$(_ZVcpkgCurrentInstalledDir)"" + Importance="Normal" Condition="'$(VcpkgEnabled)' == 'true'"/> + <Message Text="Not using Vcpkg because VcpkgEnabled is "$(VcpkgEnabled)"" + Importance="Normal" Condition="'$(VcpkgEnabled)' != 'true'"/> + <Message Text="Vcpkg is unable to link because we cannot decide between Release and Debug libraries. Please define the property VcpkgConfiguration to be 'Release' or 'Debug' (currently '$(VcpkgConfiguration)')." + Importance="High" Condition="'$(VcpkgEnabled)' == 'true' and '$(VcpkgNormalizedConfiguration)' == ''"/> + </Target> + + <PropertyGroup Condition="'$(VcpkgEnabled)' == 'true'"> + <_ZVcpkgManifestFileLocation>$(VcpkgManifestRoot)vcpkg.json </_ZVcpkgManifestFileLocation> + <_ZVcpkgConfigurationFileLocation>$(VcpkgManifestRoot)vcpkg-configuration.json</_ZVcpkgConfigurationFileLocation> + + <_ZVcpkgTLogFileLocation>$(TLogLocation)VcpkgInstallManifest$(VcpkgTriplet).$(VcpkgHostTriplet).read.1u.tlog</_ZVcpkgTLogFileLocation> + <_ZVcpkgMSBuildStampFile>$(VcpkgInstalledDir).msbuildstamp-$(VcpkgTriplet).$(VcpkgHostTriplet).stamp</_ZVcpkgMSBuildStampFile> + </PropertyGroup> + <ItemGroup Condition="'$(VcpkgEnabled)' == 'true'"> + <_ZVcpkgInstallManifestDependenciesInputs Include="$(_ZVcpkgManifestFileLocation)"/> + <_ZVcpkgInstallManifestDependenciesInputs Include="$(_ZVcpkgConfigurationFileLocation)" Condition="Exists('$(_ZVcpkgConfigurationFileLocation)')"/> + + <_ZVcpkgInstallManifestDependenciesOutputs Include="$(_ZVcpkgTLogFileLocation)"/> + <_ZVcpkgInstallManifestDependenciesOutputs Include="$(_ZVcpkgMSBuildStampFile)"/> + </ItemGroup> + + <Target Name="VcpkgInstallManifestDependencies" BeforeTargets="ClCompile" + Condition="'$(VcpkgEnabled)' == 'true' and '$(VcpkgEnableManifest)' == 'true' and '$(VcpkgManifestInstall)' == 'true'" + Inputs="@(_ZVcpkgInstallManifestDependenciesInputs)" + Outputs="@(_ZVcpkgInstallManifestDependenciesOutputs)"> + <Message Text="Installing vcpkg dependencies to $(VcpkgInstalledDir)" Importance="High" /> + <MakeDir Directories="$(TLogLocation)" /> + <ItemGroup> + <_ZVcpkgItemToDelete Include="$(TLogLocation)VcpkgInstallManifest*.read.1u.tlog" /> + <_ZVcpkgItemToDelete Include="$(VcpkgInstalledDir).msbuildstamp-*" /> + </ItemGroup> + <Delete Files="@(_ZVcpkgItemToDelete)" /> + <Message Text="%22$(_ZVcpkgExecutable)%22 install $(_ZVcpkgHostTripletParameter) --x-wait-for-lock --triplet %22$(VcpkgTriplet)%22 --vcpkg-root %22$(VcpkgRoot)\%22 %22--x-manifest-root=$(VcpkgManifestRoot)\%22 %22--x-install-root=$(VcpkgInstalledDir)\%22 $(VcpkgAdditionalInstallOptions)" + Importance="High" /> + <Exec Command="%22$(_ZVcpkgExecutable)%22 install $(_ZVcpkgHostTripletParameter) --x-wait-for-lock --triplet %22$(VcpkgTriplet)%22 --vcpkg-root %22$(VcpkgRoot)\%22 %22--x-manifest-root=$(VcpkgManifestRoot)\%22 %22--x-install-root=$(VcpkgInstalledDir)\%22 $(VcpkgAdditionalInstallOptions)" + StandardOutputImportance="High" /> + <WriteLinesToFile File="$(_ZVcpkgTLogFileLocation)" + Lines="@(_VcpkgInstallManifestDependenciesInputs -> '^%(Identity)')" + Encoding="Unicode" + Overwrite="true"/> + <Touch Files="$(_ZVcpkgMSBuildStampFile)" AlwaysCreate="true" /> + + <CreateProperty Value="false"> + <Output TaskParameter="ValueSetByTask" PropertyName="Link_MinimalRebuildFromTracking" /> + </CreateProperty> + </Target> + + <Target Name="AppLocalFromInstalled" AfterTargets="CopyFilesToOutputDirectory" BeforeTargets="CopyLocalFilesOutputGroup;RegisterOutput" + Condition="'$(VcpkgEnabled)' == 'true' and '$(VcpkgApplocalDeps)' == 'true' and '$(LinkSkippedExecution)' != 'true'"> + <Message Text="[vcpkg] Starting VcpkgApplocalDeps" Importance="low" /> + <PropertyGroup> + <_VcpkgAppLocalPowerShellCommonArguments>-ExecutionPolicy Bypass -noprofile -File "$(MSBuildThisFileDirectory)applocal.ps1" "$(TargetPath)" "$(_ZVcpkgCurrentInstalledDir)$(VcpkgConfigSubdir)bin" "$(TLogLocation)$(ProjectName).write.1u.tlog" "$(IntDir)vcpkg.applocal.log"</_VcpkgAppLocalPowerShellCommonArguments> + </PropertyGroup> + <!-- Search %PATH% for pwsh.exe if it is available. --> + <Exec + Command="pwsh.exe $(_VcpkgAppLocalPowerShellCommonArguments)" + StandardOutputImportance="Normal" + StandardErrorImportance="Normal" + IgnoreExitCode="true" + UseCommandProcessor="false"> + <Output TaskParameter="ExitCode" + PropertyName="_VcpkgAppLocalExitCode" /> + </Exec> + <!-- Fall back to well known system PowerShell location otherwise. --> + <Message Text="[vcpkg] Failed to run applocal.ps1 using pwsh, falling back to system PowerShell." Importance="low" + Condition="$(_VcpkgAppLocalExitCode) == 9009" /> + <Exec + Command="%22$(SystemRoot)\System32\WindowsPowerShell\v1.0\powershell.exe%22 $(_VcpkgAppLocalPowerShellCommonArguments)" + StandardOutputImportance="Normal" + StandardErrorImportance="Normal" + IgnoreExitCode="true" + UseCommandProcessor="false" + Condition="$(_VcpkgAppLocalExitCode) == 9009"> + <Output TaskParameter="ExitCode" + PropertyName="_VcpkgAppLocalExitCode" /> + </Exec> + <!-- We're ignoring the above exit codes, so translate into a warning if both failed. --> + <Warning Text="[vcpkg] Failed to gather app local DLL dependencies, program may not run. Set VcpkgApplocalDeps to false in your project file to suppress this warning. PowerShell arguments: $(_VcpkgAppLocalPowerShellCommonArguments)" + Condition="$(_VcpkgAppLocalExitCode) != 0"/> + <ReadLinesFromFile File="$(IntDir)vcpkg.applocal.log" + Condition="$(_VcpkgAppLocalExitCode) == 0"> + <Output TaskParameter="Lines" ItemName="VcpkgAppLocalDLLs" /> + </ReadLinesFromFile> + <Message Text="@(VcpkgAppLocalDLLs,'%0A')" Importance="Normal" Condition="$(_VcpkgAppLocalExitCode) == 0" /> + <ItemGroup Condition="$(_VcpkgAppLocalExitCode) == 0"> + <ReferenceCopyLocalPaths Include="@(VcpkgAppLocalDLLs)" /> + </ItemGroup> + </Target> +</Project> diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/buildsystems/osx/applocal.py b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/buildsystems/osx/applocal.py new file mode 100644 index 000000000..5237f1fdd --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/buildsystems/osx/applocal.py @@ -0,0 +1,425 @@ +#!/usr/bin/env python2 +# -*- coding: utf-8 -*- +""" +finish the job started by macdeployqtfix +from: https://github.com/arl/macdeployqtfix + +The MIT License (MIT) + +Copyright (c) 2015 Aurelien Rainone + +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. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +""" + +from subprocess import Popen, PIPE +from string import Template +import os +import sys +import logging +import argparse +import re +from collections import namedtuple + + +QTLIB_NAME_REGEX = r'^(?:@executable_path)?/.*/(Qt[a-zA-Z]*).framework/(?:Versions/\d/)?\1$' +QTLIB_NORMALIZED = r'$prefix/Frameworks/$qtlib.framework/Versions/$qtversion/$qtlib' + +QTPLUGIN_NAME_REGEX = r'^(?:@executable_path)?/.*/[pP]lug[iI]ns/(.*)/(.*).dylib$' +QTPLUGIN_NORMALIZED = r'$prefix/PlugIns/$plugintype/$pluginname.dylib' + +LOADERPATH_REGEX = r'^@[a-z_]+path/(.*)' +LOADERPATH_NORMALIZED = r'$prefix/Frameworks/$loaderpathlib' + + +class GlobalConfig(object): + logger = None + qtpath = None + exepath = None + + +def run_and_get_output(popen_args): + """Run process and get all output""" + process_output = namedtuple('ProcessOutput', ['stdout', 'stderr', 'retcode']) + try: + GlobalConfig.logger.debug('run_and_get_output({0})'.format(repr(popen_args))) + + proc = Popen(popen_args, stdin=PIPE, stdout=PIPE, stderr=PIPE) + stdout, stderr = proc.communicate(b'') + proc_out = process_output(stdout, stderr, proc.returncode) + + GlobalConfig.logger.debug('\tprocess_output: {0}'.format(proc_out)) + return proc_out + except Exception as exc: + GlobalConfig.logger.error('\texception: {0}'.format(exc)) + return process_output('', exc.message, -1) + + +def get_dependencies(filename): + """ + input: filename must be an absolute path + Should call `otool` and returns the list of dependencies, unsorted, + unmodified, just the raw list so then we could eventually re-use in other + more specialized functions + """ + GlobalConfig.logger.debug('get_dependencies({0})'.format(filename)) + popen_args = ['otool', '-L', filename] + proc_out = run_and_get_output(popen_args) + deps = [] + if proc_out.retcode == 0: + # some string splitting + deps = [s.strip().split(b' ')[0].decode('utf-8') for s in proc_out.stdout.splitlines()[1:] if s] + # prevent infinite recursion when a binary depends on itself (seen with QtWidgets)... + deps = [s for s in deps if os.path.basename(filename) not in s] + return deps + + +def is_qt_plugin(filename): + """ + Checks if a given file is a qt plugin. + Accepts absolute path as well as path containing @executable_path + """ + qtlib_name_rgx = re.compile(QTPLUGIN_NAME_REGEX) + return qtlib_name_rgx.match(filename) is not None + + +def is_qt_lib(filename): + """ + Checks if a given file is a qt library. + Accepts absolute path as well as path containing @executable_path + """ + qtlib_name_rgx = re.compile(QTLIB_NAME_REGEX) + return qtlib_name_rgx.match(filename) is not None + + +def is_loader_path_lib(filename): + """ + Checks if a given file is loaded via @loader_path or @rpath + """ + qtlib_name_rgx = re.compile(LOADERPATH_REGEX) + return qtlib_name_rgx.match(filename) is not None + + +def normalize_qtplugin_name(filename): + """ + input: a path to a qt plugin, as returned by otool, that can have this form : + - an absolute path /../plugins/PLUGINTYPE/PLUGINNAME.dylib + - @executable_path/../plugins/PLUGINTYPE/PLUGINNAME.dylib + output: + a tuple (qtlib, abspath, rpath) where: + - qtname is the name of the plugin (libqcocoa.dylib, etc.) + - abspath is the absolute path of the qt lib inside the app bundle of exepath + - relpath is the correct rpath to a qt lib inside the app bundle + """ + + GlobalConfig.logger.debug('normalize_plugin_name({0})'.format(filename)) + + qtplugin_name_rgx = re.compile(QTPLUGIN_NAME_REGEX) + rgxret = qtplugin_name_rgx.match(filename) + if not rgxret: + msg = 'couldn\'t normalize a non-qt plugin filename: {0}'.format(filename) + GlobalConfig.logger.critical(msg) + raise Exception(msg) + + # qtplugin normalization settings + qtplugintype = rgxret.groups()[0] + qtpluginname = rgxret.groups()[1] + + templ = Template(QTPLUGIN_NORMALIZED) + + # from qtlib, forge 2 path : + # - absolute path of qt lib in bundle, + abspath = os.path.normpath(templ.safe_substitute( + prefix=os.path.dirname(GlobalConfig.exepath) + '/..', + plugintype=qtplugintype, + pluginname=qtpluginname)) + + # - and rpath containing @executable_path, relative to exepath + rpath = templ.safe_substitute( + prefix='@executable_path/..', + plugintype=qtplugintype, + pluginname=qtpluginname) + + GlobalConfig.logger.debug('\treturns({0})'.format((qtpluginname, abspath, rpath))) + return qtpluginname, abspath, rpath + + +def normalize_qtlib_name(filename): + """ + input: a path to a qt library, as returned by otool, that can have this form : + - an absolute path /lib/xxx/yyy + - @executable_path/../Frameworks/QtSerialPort.framework/Versions/5/QtSerialPort + output: + a tuple (qtlib, abspath, rpath) where: + - qtlib is the name of the qtlib (QtCore, QtWidgets, etc.) + - abspath is the absolute path of the qt lib inside the app bundle of exepath + - relpath is the correct rpath to a qt lib inside the app bundle + """ + GlobalConfig.logger.debug('normalize_qtlib_name({0})'.format(filename)) + + qtlib_name_rgx = re.compile(QTLIB_NAME_REGEX) + rgxret = qtlib_name_rgx.match(filename) + if not rgxret: + msg = 'couldn\'t normalize a non-qt lib filename: {0}'.format(filename) + GlobalConfig.logger.critical(msg) + raise Exception(msg) + + # qtlib normalization settings + qtlib = rgxret.groups()[0] + qtversion = 5 + + templ = Template(QTLIB_NORMALIZED) + + # from qtlib, forge 2 path : + # - absolute path of qt lib in bundle, + abspath = os.path.normpath(templ.safe_substitute( + prefix=os.path.dirname(GlobalConfig.exepath) + '/..', + qtlib=qtlib, + qtversion=qtversion)) + + # - and rpath containing @executable_path, relative to exepath + rpath = templ.safe_substitute( + prefix='@executable_path/..', + qtlib=qtlib, + qtversion=qtversion) + + GlobalConfig.logger.debug('\treturns({0})'.format((qtlib, abspath, rpath))) + return qtlib, abspath, rpath + + +def normalize_loaderpath_name(filename): + """ + input: a path to a loaderpath library, as returned by otool, that can have this form : + - an relative path @loaderpath/yyy + output: + a tuple (loaderpathlib, abspath, rpath) where: + - loaderpathlib is the name of the loaderpath lib + - abspath is the absolute path of the qt lib inside the app bundle of exepath + - relpath is the correct rpath to a qt lib inside the app bundle + """ + GlobalConfig.logger.debug('normalize_loaderpath_name({0})'.format(filename)) + + loaderpath_name_rgx = re.compile(LOADERPATH_REGEX) + rgxret = loaderpath_name_rgx.match(filename) + if not rgxret: + msg = 'couldn\'t normalize a loaderpath lib filename: {0}'.format(filename) + GlobalConfig.logger.critical(msg) + raise Exception(msg) + + # loaderpath normalization settings + loaderpathlib = rgxret.groups()[0] + templ = Template(LOADERPATH_NORMALIZED) + + # from loaderpath, forge 2 path : + # - absolute path of qt lib in bundle, + abspath = os.path.normpath(templ.safe_substitute( + prefix=os.path.dirname(GlobalConfig.exepath) + '/..', + loaderpathlib=loaderpathlib)) + + # - and rpath containing @executable_path, relative to exepath + rpath = templ.safe_substitute( + prefix='@executable_path/..', + loaderpathlib=loaderpathlib) + + GlobalConfig.logger.debug('\treturns({0})'.format((loaderpathlib, abspath, rpath))) + return loaderpathlib, abspath, rpath + + +def fix_dependency(binary, dep): + """ + fix 'dep' dependency of 'binary'. 'dep' is a qt library + """ + if is_qt_lib(dep): + qtname, dep_abspath, dep_rpath = normalize_qtlib_name(dep) + qtnamesrc = os.path.join(GlobalConfig.qtpath, 'lib', '{0}.framework'. + format(qtname), qtname) + elif is_qt_plugin(dep): + qtname, dep_abspath, dep_rpath = normalize_qtplugin_name(dep) + qtnamesrc = os.path.join(GlobalConfig.qtpath, 'lib', '{0}.framework'. + format(qtname), qtname) + elif is_loader_path_lib(dep): + qtname, dep_abspath, dep_rpath = normalize_loaderpath_name(dep) + qtnamesrc = os.path.join(GlobalConfig.qtpath + '/lib', qtname) + else: + return True + + # if the source path doesn't exist it's probably not a dependency + # originating with vcpkg and we should leave it alone + if not os.path.exists(qtnamesrc): + return True + + dep_ok = True + # check that rpath of 'dep' inside binary has been correctly set + # (ie: relative to exepath using '@executable_path' syntax) + if dep != dep_rpath: + # dep rpath is not ok + GlobalConfig.logger.info('changing rpath \'{0}\' in binary {1}'.format(dep, binary)) + + # call install_name_tool -change on binary + popen_args = ['install_name_tool', '-change', dep, dep_rpath, binary] + proc_out = run_and_get_output(popen_args) + if proc_out.retcode != 0: + GlobalConfig.logger.error(proc_out.stderr) + dep_ok = False + else: + # call install_name_tool -id on binary + popen_args = ['install_name_tool', '-id', dep_rpath, binary] + proc_out = run_and_get_output(popen_args) + if proc_out.retcode != 0: + GlobalConfig.logger.error(proc_out.stderr) + dep_ok = False + + # now ensure that 'dep' exists at the specified path, relative to bundle + if dep_ok and not os.path.exists(dep_abspath): + + # ensure destination directory exists + GlobalConfig.logger.info('ensuring directory \'{0}\' exists: {0}'. + format(os.path.dirname(dep_abspath))) + popen_args = ['mkdir', '-p', os.path.dirname(dep_abspath)] + proc_out = run_and_get_output(popen_args) + if proc_out.retcode != 0: + GlobalConfig.logger.info(proc_out.stderr) + dep_ok = False + else: + # copy missing dependency into bundle + GlobalConfig.logger.info('copying missing dependency in bundle: {0}'. + format(qtname)) + popen_args = ['cp', qtnamesrc, dep_abspath] + proc_out = run_and_get_output(popen_args) + if proc_out.retcode != 0: + GlobalConfig.logger.info(proc_out.stderr) + dep_ok = False + else: + # ensure permissions are correct if we ever have to change its rpath + GlobalConfig.logger.info('ensuring 755 perm to {0}'.format(dep_abspath)) + popen_args = ['chmod', '755', dep_abspath] + proc_out = run_and_get_output(popen_args) + if proc_out.retcode != 0: + GlobalConfig.logger.info(proc_out.stderr) + dep_ok = False + else: + GlobalConfig.logger.debug('{0} is at correct location in bundle'.format(qtname)) + + if dep_ok: + return fix_binary(dep_abspath) + return False + + +def fix_binary(binary): + """ + input: + binary: relative or absolute path (no @executable_path syntax) + process: + - first fix the rpath for the qt libs on which 'binary' depend + - copy into the bundle of exepath the eventual libraries that are missing + - (create the soft links) needed ? + - do the same for all qt dependencies of binary (recursive) + """ + GlobalConfig.logger.debug('fix_binary({0})'.format(binary)) + + # loop on 'binary' dependencies + for dep in get_dependencies(binary): + if not fix_dependency(binary, dep): + GlobalConfig.logger.error('quitting early: couldn\'t fix dependency {0} of {1}'.format(dep, binary)) + return False + return True + + +def fix_main_binaries(): + """ + list the main binaries of the app bundle and fix them + """ + # deduce bundle path + bundlepath = os.path.sep.join(GlobalConfig.exepath.split(os.path.sep)[0:-3]) + + # fix main binary + GlobalConfig.logger.info('fixing executable \'{0}\''.format(GlobalConfig.exepath)) + if fix_binary(GlobalConfig.exepath): + GlobalConfig.logger.info('fixing plugins') + for root, dummy, files in os.walk(bundlepath): + for name in [f for f in files if os.path.splitext(f)[1] == '.dylib']: + GlobalConfig.logger.info('fixing plugin {0}'.format(name)) + if not fix_binary(os.path.join(root, name)): + return False + return True + + +def main(): + descr = """finish the job started by macdeployqt! + - find dependencies/rpaths with otool + - copy missed dependencies with cp and mkdir + - fix missed rpaths with install_name_tool + + exit codes: + - 0 : success + - 1 : error + """ + + parser = argparse.ArgumentParser(description=descr, + formatter_class=argparse.RawTextHelpFormatter) + parser.add_argument('exepath', + help='path to the binary depending on Qt') + parser.add_argument('qtpath', + help='path of Qt libraries used to build the Qt application') + parser.add_argument('-q', '--quiet', action='store_true', default=False, + help='do not create log on standard output') + parser.add_argument('-nl', '--no-log-file', action='store_true', default=False, + help='do not create log file \'./macdeployqtfix.log\'') + parser.add_argument('-v', '--verbose', action='store_true', default=False, + help='produce more log messages(debug log)') + args = parser.parse_args() + + # globals + GlobalConfig.qtpath = os.path.normpath(args.qtpath) + GlobalConfig.exepath = args.exepath + GlobalConfig.logger = logging.getLogger() + + # configure logging + ################### + + # create formatter + formatter = logging.Formatter('%(levelname)s | %(message)s') + # create console GlobalConfig.logger + if not args.quiet: + chdlr = logging.StreamHandler(sys.stdout) + chdlr.setFormatter(formatter) + GlobalConfig.logger.addHandler(chdlr) + + # create file GlobalConfig.logger + if not args.no_log_file: + fhdlr = logging.FileHandler('./macdeployqtfix.log', mode='w') + fhdlr.setFormatter(formatter) + GlobalConfig.logger.addHandler(fhdlr) + + if args.no_log_file and args.quiet: + GlobalConfig.logger.addHandler(logging.NullHandler()) + else: + GlobalConfig.logger.setLevel(logging.DEBUG if args.verbose else logging.INFO) + + if fix_main_binaries(): + GlobalConfig.logger.info('macdeployqtfix terminated with success') + ret = 0 + else: + GlobalConfig.logger.error('macdeployqtfix terminated with error') + ret = 1 + sys.exit(ret) + + +if __name__ == "__main__": + main() diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/buildsystems/vcpkg.cmake b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/buildsystems/vcpkg.cmake new file mode 100644 index 000000000..9bdf6573e --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/buildsystems/vcpkg.cmake @@ -0,0 +1,901 @@ +# Mark variables as used so cmake doesn't complain about them +mark_as_advanced(CMAKE_TOOLCHAIN_FILE) + +# NOTE: to figure out what cmake versions are required for different things, +# grep for `CMake 3`. All version requirement comments should follow that format. + +#[===[.md: +# z_vcpkg_add_fatal_error +Add a fatal error. + +```cmake +z_vcpkg_add_fatal_error(<message>...) +``` + +We use this system, instead of `message(FATAL_ERROR)`, +since cmake prints a lot of nonsense if the toolchain errors out before it's found the build tools. + +This `Z_VCPKG_HAS_FATAL_ERROR` must be checked before any filesystem operations are done, +since otherwise you might be doing something with bad variables set up. +#]===] +# this is defined above everything else so that it can be used. +set(Z_VCPKG_FATAL_ERROR) +set(Z_VCPKG_HAS_FATAL_ERROR OFF) +function(z_vcpkg_add_fatal_error ERROR) + if(NOT Z_VCPKG_HAS_FATAL_ERROR) + set(Z_VCPKG_HAS_FATAL_ERROR ON PARENT_SCOPE) + set(Z_VCPKG_FATAL_ERROR "${ERROR}" PARENT_SCOPE) + else() + string(APPEND Z_VCPKG_FATAL_ERROR "\n${ERROR}") + endif() +endfunction() + +set(Z_VCPKG_CMAKE_REQUIRED_MINIMUM_VERSION "3.1") +if(CMAKE_VERSION VERSION_LESS Z_VCPKG_CMAKE_REQUIRED_MINIMUM_VERSION) + message(FATAL_ERROR "vcpkg.cmake requires at least CMake ${Z_VCPKG_CMAKE_REQUIRED_MINIMUM_VERSION}.") +endif() +# this policy is required for this file; thus, CMake 3.1 is required. +cmake_policy(PUSH) +cmake_policy(SET CMP0054 NEW) + +include(CMakeDependentOption) + +# VCPKG toolchain options. +option(VCPKG_VERBOSE "Enables messages from the VCPKG toolchain for debugging purposes." OFF) +mark_as_advanced(VCPKG_VERBOSE) + +option(VCPKG_APPLOCAL_DEPS "Automatically copy dependencies into the output directory for executables." ON) +option(X_VCPKG_APPLOCAL_DEPS_SERIALIZED "(experimental) Add USES_TERMINAL to VCPKG_APPLOCAL_DEPS to force serialization." OFF) +option(X_VCPKG_APPLOCAL_DEPS_INSTALL "(experimental) Automatically copy dependencies into the install target directory for executables." OFF) + +# Manifest options and settings +if(NOT DEFINED VCPKG_MANIFEST_DIR) + if(EXISTS "${CMAKE_SOURCE_DIR}/vcpkg.json") + set(VCPKG_MANIFEST_DIR "${CMAKE_SOURCE_DIR}") + endif() +endif() +set(VCPKG_MANIFEST_DIR "${VCPKG_MANIFEST_DIR}" + CACHE PATH "The path to the vcpkg manifest directory." FORCE) + +if(DEFINED VCPKG_MANIFEST_DIR AND NOT VCPKG_MANIFEST_DIR STREQUAL "") + set(Z_VCPKG_HAS_MANIFEST_DIR ON) +else() + set(Z_VCPKG_HAS_MANIFEST_DIR OFF) +endif() + +option(VCPKG_MANIFEST_MODE "Use manifest mode, as opposed to classic mode." "${Z_VCPKG_HAS_MANIFEST_DIR}") + +if(VCPKG_MANIFEST_MODE AND NOT Z_VCPKG_HAS_MANIFEST_DIR) + z_vcpkg_add_fatal_error( +"vcpkg manifest mode was enabled, but we couldn't find a manifest file (vcpkg.json) +in the current source directory (${CMAKE_CURRENT_SOURCE_DIR}). +Please add a manifest, or disable manifests by turning off VCPKG_MANIFEST_MODE." + ) +endif() + +if(NOT DEFINED CACHE{Z_VCPKG_CHECK_MANIFEST_MODE}) + set(Z_VCPKG_CHECK_MANIFEST_MODE "${VCPKG_MANIFEST_MODE}" + CACHE INTERNAL "Making sure VCPKG_MANIFEST_MODE doesn't change") +endif() + +if(NOT VCPKG_MANIFEST_MODE AND Z_VCPKG_CHECK_MANIFEST_MODE) + z_vcpkg_add_fatal_error([[ +vcpkg manifest mode was disabled for a build directory where it was initially enabled. +This is not supported. Please delete the build directory and reconfigure. +]]) +elseif(VCPKG_MANIFEST_MODE AND NOT Z_VCPKG_CHECK_MANIFEST_MODE) + z_vcpkg_add_fatal_error([[ +vcpkg manifest mode was enabled for a build directory where it was initially disabled. +This is not supported. Please delete the build directory and reconfigure. +]]) +endif() + +CMAKE_DEPENDENT_OPTION(VCPKG_MANIFEST_INSTALL [[ +Install the dependencies listed in your manifest: + If this is off, you will have to manually install your dependencies. + See https://github.com/microsoft/vcpkg/tree/master/docs/specifications/manifests.md for more info. +]] + ON + "VCPKG_MANIFEST_MODE" + OFF) + +if(VCPKG_MANIFEST_INSTALL) + set(VCPKG_BOOTSTRAP_OPTIONS "${VCPKG_BOOTSTRAP_OPTIONS}" CACHE STRING "Additional options to bootstrap vcpkg" FORCE) + set(VCPKG_OVERLAY_PORTS "${VCPKG_OVERLAY_PORTS}" CACHE STRING "Overlay ports to use for vcpkg install in manifest mode" FORCE) + set(VCPKG_OVERLAY_TRIPLETS "${VCPKG_OVERLAY_TRIPLETS}" CACHE STRING "Overlay triplets to use for vcpkg install in manifest mode" FORCE) + set(VCPKG_INSTALL_OPTIONS "${VCPKG_INSTALL_OPTIONS}" CACHE STRING "Additional install options to pass to vcpkg" FORCE) + set(Z_VCPKG_UNUSED VCPKG_BOOTSTRAP_OPTIONS) + set(Z_VCPKG_UNUSED VCPKG_OVERLAY_PORTS) + set(Z_VCPKG_UNUSED VCPKG_OVERLAY_TRIPLETS) + set(Z_VCPKG_UNUSED VCPKG_INSTALL_OPTIONS) +endif() + +# CMake helper utilities + +#[===[.md: +# z_vcpkg_function_arguments + +Get a list of the arguments which were passed in. +Unlike `ARGV`, which is simply the arguments joined with `;`, +so that `(A B)` is not distinguishable from `("A;B")`, +this macro gives `"A;B"` for the first argument list, +and `"A\;B"` for the second. + +```cmake +z_vcpkg_function_arguments(<out-var> [<N>]) +``` + +`z_vcpkg_function_arguments` gets the arguments between `ARGV<N>` and the last argument. +`<N>` defaults to `0`, so that all arguments are taken. + +## Example: +```cmake +function(foo_replacement) + z_vcpkg_function_arguments(ARGS) + foo(${ARGS}) + ... +endfunction() +``` +#]===] + +# NOTE: this function definition is copied directly from scripts/cmake/z_vcpkg_function_arguments.cmake +# do not make changes here without making the same change there. +macro(z_vcpkg_function_arguments OUT_VAR) + if("${ARGC}" EQUAL 1) + set(z_vcpkg_function_arguments_FIRST_ARG 0) + elseif("${ARGC}" EQUAL 2) + set(z_vcpkg_function_arguments_FIRST_ARG "${ARGV1}") + else() + # vcpkg bug + message(FATAL_ERROR "z_vcpkg_function_arguments: invalid arguments (${ARGV})") + endif() + + set("${OUT_VAR}") + + # this allows us to get the value of the enclosing function's ARGC + set(z_vcpkg_function_arguments_ARGC_NAME "ARGC") + set(z_vcpkg_function_arguments_ARGC "${${z_vcpkg_function_arguments_ARGC_NAME}}") + + math(EXPR z_vcpkg_function_arguments_LAST_ARG "${z_vcpkg_function_arguments_ARGC} - 1") + # GREATER_EQUAL added in CMake 3.7 + if(NOT z_vcpkg_function_arguments_LAST_ARG LESS z_vcpkg_function_arguments_FIRST_ARG) + foreach(z_vcpkg_function_arguments_N RANGE "${z_vcpkg_function_arguments_FIRST_ARG}" "${z_vcpkg_function_arguments_LAST_ARG}") + string(REPLACE ";" "\\;" z_vcpkg_function_arguments_ESCAPED_ARG "${ARGV${z_vcpkg_function_arguments_N}}") + list(APPEND "${OUT_VAR}" "${z_vcpkg_function_arguments_ESCAPED_ARG}") + endforeach() + endif() +endmacro() + +#[===[.md: +# z_vcpkg_*_parent_scope_export +If you need to re-export variables to a parent scope from a call, +you can put these around the call to re-export those variables that have changed locally +to parent scope. + +## Usage: +```cmake +z_vcpkg_start_parent_scope_export( + [PREFIX <PREFIX>] +) +z_vcpkg_complete_parent_scope_export( + [PREFIX <PREFIX>] + [IGNORE_REGEX <REGEX>] +) +``` + +## Parameters +### PREFIX +The prefix to use to store the old variable values; defaults to `Z_VCPKG_PARENT_SCOPE_EXPORT`. +The value of each variable `<VAR>` will be stored in `${PREFIX}_<VAR>` by `start`, +and then every variable which is different from `${PREFIX}_VAR` will be re-exported by `complete`. + +### IGNORE_REGEX +Variables with names matching this regex will not be exported even if their value has changed. + +## Example: +```cmake +z_vcpkg_start_parent_scope_export() +_find_package(blah) +z_vcpkg_complete_parent_scope_export() +``` +#]===] +# Notes: these do not use `cmake_parse_arguments` in order to support older versions of cmake, +# pre-3.7 and PARSE_ARGV +macro(z_vcpkg_start_parent_scope_export) + if("${ARGC}" EQUAL "0") + set(z_vcpkg_parent_scope_export_PREFIX "Z_VCPKG_PARENT_SCOPE_EXPORT") + elseif("${ARGC}" EQUAL "2" AND "${ARGV0}" STREQUAL "PREFIX") + set(z_vcpkg_parent_scope_export_PREFIX "${ARGV1}") + else() + message(FATAL_ERROR "Invalid parameters to z_vcpkg_start_parent_scope_export: (${ARGV})") + endif() + get_property(z_vcpkg_parent_scope_export_VARIABLE_LIST + DIRECTORY PROPERTY "VARIABLES") + foreach(z_vcpkg_parent_scope_export_VARIABLE IN LISTS z_vcpkg_parent_scope_export_VARIABLE_LIST) + set("${z_vcpkg_parent_scope_export_PREFIX}_${z_vcpkg_parent_scope_export_VARIABLE}" "${${z_vcpkg_parent_scope_export_VARIABLE}}") + endforeach() +endmacro() + +macro(z_vcpkg_complete_parent_scope_export) + set(z_vcpkg_parent_scope_export_PREFIX_FILLED OFF) + if("${ARGC}" EQUAL "0") + # do nothing, replace with default values + elseif("${ARGC}" EQUAL "2") + if("${ARGV0}" STREQUAL "PREFIX") + set(z_vcpkg_parent_scope_export_PREFIX_FILLED ON) + set(z_vcpkg_parent_scope_export_PREFIX "${ARGV1}") + elseif("${ARGV0}" STREQUAL "IGNORE_REGEX") + set(z_vcpkg_parent_scope_export_IGNORE_REGEX "${ARGV1}") + else() + message(FATAL_ERROR "Invalid arguments to z_vcpkg_complete_parent_scope_export: (${ARGV})") + endif() + elseif("${ARGC}" EQUAL "4") + if("${ARGV0}" STREQUAL "PREFIX" AND "${ARGV2}" STREQUAL "IGNORE_REGEX") + set(z_vcpkg_parent_scope_export_PREFIX_FILLED ON) + set(z_vcpkg_parent_scope_export_PREFIX "${ARGV1}") + set(z_vcpkg_parent_scope_export_IGNORE_REGEX "${ARGV3}") + elseif("${ARGV0}" STREQUAL "IGNORE_REGEX" AND "${ARGV2}" STREQUAL "PREFIX") + set(z_vcpkg_parent_scope_export_IGNORE_REGEX "${ARGV1}") + set(z_vcpkg_parent_scope_export_PREFIX_FILLED ON) + set(z_vcpkg_parent_scope_export_PREFIX "${ARGV3}") + else() + message(FATAL_ERROR "Invalid arguments to z_vcpkg_start_parent_scope_export: (${ARGV})") + endif() + else() + message(FATAL_ERROR "Invalid arguments to z_vcpkg_complete_parent_scope_export: (${ARGV})") + endif() + + if(NOT z_vcpkg_parent_scope_export_PREFIX) + set(z_vcpkg_parent_scope_export_PREFIX "Z_VCPKG_PARENT_SCOPE_EXPORT") + endif() + + get_property(z_vcpkg_parent_scope_export_VARIABLE_LIST + DIRECTORY PROPERTY "VARIABLES") + foreach(z_vcpkg_parent_scope_export_VARIABLE IN LISTS z_vcpkg_parent_scope_export_VARIABLE_LIST) + if("${z_vcpkg_parent_scope_export_VARIABLE}" MATCHES "^${z_vcpkg_parent_scope_export_PREFIX}_") + # skip the backup variables + continue() + endif() + if("${z_vcpkg_parent_scope_export_VARIABLE}" MATCHES "^${z_vcpkg_parent_scope_export_PREFIX}_") + # skip the backup variables + continue() + endif() + + if(DEFINED "${z_vcpkg_parent_scope_export_IGNORE_REGEX}" AND "${z_vcpkg_parent_scope_export_VARIABLE}" MATCHES "${z_vcpkg_parent_scope_export_IGNORE_REGEX}") + # skip those variables which should be ignored + continue() + endif() + + if(NOT "${${z_vcpkg_parent_scope_export_PREFIX}_${z_vcpkg_parent_scope_export_VARIABLE}}" STREQUAL "${${z_vcpkg_parent_scope_export_VARIABLE}}") + set("${z_vcpkg_parent_scope_export_VARIABLE}" "${${z_vcpkg_parent_scope_export_VARIABLE}}" PARENT_SCOPE) + endif() + endforeach() +endmacro() + +#[===[.md: +# z_vcpkg_set_powershell_path + +Gets either the path to powershell or powershell core, +and places it in the variable Z_VCPKG_POWERSHELL_PATH. +#]===] +function(z_vcpkg_set_powershell_path) + # Attempt to use pwsh if it is present; otherwise use powershell + if(NOT DEFINED Z_VCPKG_POWERSHELL_PATH) + find_program(Z_VCPKG_PWSH_PATH pwsh) + if(Z_VCPKG_PWSH_PATH) + set(Z_VCPKG_POWERSHELL_PATH "${Z_VCPKG_PWSH_PATH}" CACHE INTERNAL "The path to the PowerShell implementation to use.") + else() + message(DEBUG "vcpkg: Could not find PowerShell Core; falling back to PowerShell") + find_program(Z_VCPKG_BUILTIN_POWERSHELL_PATH powershell REQUIRED) + if(Z_VCPKG_BUILTIN_POWERSHELL_PATH) + set(Z_VCPKG_POWERSHELL_PATH "${Z_VCPKG_BUILTIN_POWERSHELL_PATH}" CACHE INTERNAL "The path to the PowerShell implementation to use.") + else() + message(WARNING "vcpkg: Could not find PowerShell; using static string 'powershell.exe'") + set(Z_VCPKG_POWERSHELL_PATH "powershell.exe" CACHE INTERNAL "The path to the PowerShell implementation to use.") + endif() + endif() + endif() # Z_VCPKG_POWERSHELL_PATH +endfunction() + + +# Determine whether the toolchain is loaded during a try-compile configuration +get_property(Z_VCPKG_CMAKE_IN_TRY_COMPILE GLOBAL PROPERTY IN_TRY_COMPILE) + +if(CMAKE_VERSION VERSION_LESS "3.6.0") + set(Z_VCPKG_CMAKE_EMULATE_TRY_COMPILE_PLATFORM_VARIABLES ON) +else() + set(Z_VCPKG_CMAKE_EMULATE_TRY_COMPILE_PLATFORM_VARIABLES OFF) +endif() + +if(Z_VCPKG_CMAKE_IN_TRY_COMPILE AND Z_VCPKG_CMAKE_EMULATE_TRY_COMPILE_PLATFORM_VARIABLES) + include("${CMAKE_CURRENT_SOURCE_DIR}/../vcpkg.config.cmake" OPTIONAL) +endif() + +if(VCPKG_CHAINLOAD_TOOLCHAIN_FILE) + include("${VCPKG_CHAINLOAD_TOOLCHAIN_FILE}") +endif() + +if(VCPKG_TOOLCHAIN) + cmake_policy(POP) + return() +endif() + +#If CMake does not have a mapping for MinSizeRel and RelWithDebInfo in imported targets +#it will map those configuration to the first valid configuration in CMAKE_CONFIGURATION_TYPES or the targets IMPORTED_CONFIGURATIONS. +#In most cases this is the debug configuration which is wrong. +if(NOT DEFINED CMAKE_MAP_IMPORTED_CONFIG_MINSIZEREL) + set(CMAKE_MAP_IMPORTED_CONFIG_MINSIZEREL "MinSizeRel;Release;") + if(VCPKG_VERBOSE) + message(STATUS "VCPKG-Info: CMAKE_MAP_IMPORTED_CONFIG_MINSIZEREL set to MinSizeRel;Release;") + endif() +endif() +if(NOT DEFINED CMAKE_MAP_IMPORTED_CONFIG_RELWITHDEBINFO) + set(CMAKE_MAP_IMPORTED_CONFIG_RELWITHDEBINFO "RelWithDebInfo;Release;") + if(VCPKG_VERBOSE) + message(STATUS "VCPKG-Info: CMAKE_MAP_IMPORTED_CONFIG_RELWITHDEBINFO set to RelWithDebInfo;Release;") + endif() +endif() + +if(VCPKG_TARGET_TRIPLET) + # This is required since a user might do: 'set(VCPKG_TARGET_TRIPLET somevalue)' [no CACHE] before the first project() call + # Latter within the toolchain file we do: 'set(VCPKG_TARGET_TRIPLET somevalue CACHE STRING "")' which + # will otherwise override the user setting of VCPKG_TARGET_TRIPLET in the current scope of the toolchain since the CACHE value + # did not exist previously. Since the value is newly created CMake will use the CACHE value within this scope since it is the more + # recently created value in directory scope. This 'strange' behaviour only happens on the very first configure call since subsequent + # configure call will see the user value as the more recent value. The same logic must be applied to all cache values within this file! + # The FORCE keyword is required to ALWAYS lift the user provided/previously set value into a CACHE value. + set(VCPKG_TARGET_TRIPLET "${VCPKG_TARGET_TRIPLET}" CACHE STRING "Vcpkg target triplet (ex. x86-windows)" FORCE) +elseif(CMAKE_GENERATOR_PLATFORM MATCHES "^[Ww][Ii][Nn]32$") + set(Z_VCPKG_TARGET_TRIPLET_ARCH x86) +elseif(CMAKE_GENERATOR_PLATFORM MATCHES "^[Xx]64$") + set(Z_VCPKG_TARGET_TRIPLET_ARCH x64) +elseif(CMAKE_GENERATOR_PLATFORM MATCHES "^[Aa][Rr][Mm]$") + set(Z_VCPKG_TARGET_TRIPLET_ARCH arm) +elseif(CMAKE_GENERATOR_PLATFORM MATCHES "^[Aa][Rr][Mm]64$") + set(Z_VCPKG_TARGET_TRIPLET_ARCH arm64) +else() + if(CMAKE_GENERATOR MATCHES "^Visual Studio 14 2015 Win64$") + set(Z_VCPKG_TARGET_TRIPLET_ARCH x64) + elseif(CMAKE_GENERATOR MATCHES "^Visual Studio 14 2015 ARM$") + set(Z_VCPKG_TARGET_TRIPLET_ARCH arm) + elseif(CMAKE_GENERATOR MATCHES "^Visual Studio 14 2015$") + set(Z_VCPKG_TARGET_TRIPLET_ARCH x86) + elseif(CMAKE_GENERATOR MATCHES "^Visual Studio 15 2017 Win64$") + set(Z_VCPKG_TARGET_TRIPLET_ARCH x64) + elseif(CMAKE_GENERATOR MATCHES "^Visual Studio 15 2017 ARM$") + set(Z_VCPKG_TARGET_TRIPLET_ARCH arm) + elseif(CMAKE_GENERATOR MATCHES "^Visual Studio 15 2017$") + set(Z_VCPKG_TARGET_TRIPLET_ARCH x86) + elseif(CMAKE_GENERATOR MATCHES "^Visual Studio 16 2019$") + set(Z_VCPKG_TARGET_TRIPLET_ARCH x64) + else() + find_program(Z_VCPKG_CL cl) + if(Z_VCPKG_CL MATCHES "amd64/cl.exe$" OR Z_VCPKG_CL MATCHES "x64/cl.exe$") + set(Z_VCPKG_TARGET_TRIPLET_ARCH x64) + elseif(Z_VCPKG_CL MATCHES "arm/cl.exe$") + set(Z_VCPKG_TARGET_TRIPLET_ARCH arm) + elseif(Z_VCPKG_CL MATCHES "arm64/cl.exe$") + set(Z_VCPKG_TARGET_TRIPLET_ARCH arm64) + elseif(Z_VCPKG_CL MATCHES "bin/cl.exe$" OR Z_VCPKG_CL MATCHES "x86/cl.exe$") + set(Z_VCPKG_TARGET_TRIPLET_ARCH x86) + elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin" AND DEFINED CMAKE_SYSTEM_NAME AND NOT CMAKE_SYSTEM_NAME STREQUAL "Darwin") + list(LENGTH CMAKE_OSX_ARCHITECTURES Z_VCPKG_OSX_ARCH_COUNT) + if(Z_VCPKG_OSX_ARCH_COUNT EQUAL 0) + message(WARNING "Unable to determine target architecture. " + "Consider providing a value for the CMAKE_OSX_ARCHITECTURES cache variable. " + "Continuing without vcpkg.") + set(VCPKG_TOOLCHAIN ON) + cmake_policy(POP) + return() + endif() + + if(Z_VCPKG_OSX_ARCH_COUNT GREATER 1) + message(WARNING "Detected more than one target architecture. Using the first one.") + endif() + list(GET CMAKE_OSX_ARCHITECTURES 0 Z_VCPKG_OSX_TARGET_ARCH) + if(Z_VCPKG_OSX_TARGET_ARCH STREQUAL "arm64") + set(Z_VCPKG_TARGET_TRIPLET_ARCH arm64) + elseif(Z_VCPKG_OSX_TARGET_ARCH STREQUAL "arm64s") + set(Z_VCPKG_TARGET_TRIPLET_ARCH arm64s) + elseif(Z_VCPKG_OSX_TARGET_ARCH STREQUAL "armv7s") + set(Z_VCPKG_TARGET_TRIPLET_ARCH armv7s) + elseif(Z_VCPKG_OSX_TARGET_ARCH STREQUAL "armv7") + set(Z_VCPKG_TARGET_TRIPLET_ARCH arm) + elseif(Z_VCPKG_OSX_TARGET_ARCH STREQUAL "x86_64") + set(Z_VCPKG_TARGET_TRIPLET_ARCH x64) + elseif(Z_VCPKG_OSX_TARGET_ARCH STREQUAL "i386") + set(Z_VCPKG_TARGET_TRIPLET_ARCH x86) + else() + message(WARNING "Unable to determine target architecture, continuing without vcpkg.") + set(VCPKG_TOOLCHAIN ON) + cmake_policy(POP) + return() + endif() + elseif(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "x86_64" OR CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "AMD64") + set(Z_VCPKG_TARGET_TRIPLET_ARCH x64) + elseif(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "s390x") + set(Z_VCPKG_TARGET_TRIPLET_ARCH s390x) + elseif(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "ppc64le") + set(Z_VCPKG_TARGET_TRIPLET_ARCH ppc64le) + elseif(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "armv7l") + set(Z_VCPKG_TARGET_TRIPLET_ARCH arm) + elseif(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "aarch64") + set(Z_VCPKG_TARGET_TRIPLET_ARCH arm64) + else() + if(Z_VCPKG_CMAKE_IN_TRY_COMPILE) + message(STATUS "Unable to determine target architecture, continuing without vcpkg.") + else() + message(WARNING "Unable to determine target architecture, continuing without vcpkg.") + endif() + set(VCPKG_TOOLCHAIN ON) + cmake_policy(POP) + return() + endif() + endif() +endif() + +if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" OR CMAKE_SYSTEM_NAME STREQUAL "WindowsPhone") + set(Z_VCPKG_TARGET_TRIPLET_PLAT uwp) +elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR (NOT CMAKE_SYSTEM_NAME AND CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux")) + set(Z_VCPKG_TARGET_TRIPLET_PLAT linux) +elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin" OR (NOT CMAKE_SYSTEM_NAME AND CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin")) + set(Z_VCPKG_TARGET_TRIPLET_PLAT osx) +elseif(CMAKE_SYSTEM_NAME STREQUAL "iOS") + set(Z_VCPKG_TARGET_TRIPLET_PLAT ios) +elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows" OR (NOT CMAKE_SYSTEM_NAME AND CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")) + set(Z_VCPKG_TARGET_TRIPLET_PLAT windows) +elseif(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR (NOT CMAKE_SYSTEM_NAME AND CMAKE_HOST_SYSTEM_NAME STREQUAL "FreeBSD")) + set(Z_VCPKG_TARGET_TRIPLET_PLAT freebsd) +endif() + +set(VCPKG_TARGET_TRIPLET "${Z_VCPKG_TARGET_TRIPLET_ARCH}-${Z_VCPKG_TARGET_TRIPLET_PLAT}" CACHE STRING "Vcpkg target triplet (ex. x86-windows)") +set(Z_VCPKG_TOOLCHAIN_DIR "${CMAKE_CURRENT_LIST_DIR}") + +if(NOT DEFINED Z_VCPKG_ROOT_DIR) + # Detect .vcpkg-root to figure VCPKG_ROOT_DIR + set(Z_VCPKG_ROOT_DIR_CANDIDATE "${CMAKE_CURRENT_LIST_DIR}") + while(IS_DIRECTORY "${Z_VCPKG_ROOT_DIR_CANDIDATE}" AND NOT EXISTS "${Z_VCPKG_ROOT_DIR_CANDIDATE}/.vcpkg-root") + get_filename_component(Z_VCPKG_ROOT_DIR_TEMP "${Z_VCPKG_ROOT_DIR_CANDIDATE}" DIRECTORY) + if(Z_VCPKG_ROOT_DIR_TEMP STREQUAL Z_VCPKG_ROOT_DIR_CANDIDATE) # If unchanged, we have reached the root of the drive + else() + SET(Z_VCPKG_ROOT_DIR_CANDIDATE "${Z_VCPKG_ROOT_DIR_TEMP}") + endif() + endwhile() + set(Z_VCPKG_ROOT_DIR "${Z_VCPKG_ROOT_DIR_CANDIDATE}" CACHE INTERNAL "Vcpkg root directory") +endif() + +if(NOT Z_VCPKG_ROOT_DIR) + z_vcpkg_add_fatal_error("Could not find .vcpkg-root") +endif() + +if(NOT DEFINED _VCPKG_INSTALLED_DIR) + if(VCPKG_MANIFEST_MODE) + set(_VCPKG_INSTALLED_DIR "${CMAKE_BINARY_DIR}/vcpkg_installed") + else() + set(_VCPKG_INSTALLED_DIR "${Z_VCPKG_ROOT_DIR}/installed") + endif() +set(_VCPKG_INSTALLED_DIR "${_VCPKG_INSTALLED_DIR}" + CACHE PATH + "The directory which contains the installed libraries for each triplet" FORCE) +endif() + +if(CMAKE_BUILD_TYPE MATCHES "^[Dd][Ee][Bb][Uu][Gg]$" OR NOT DEFINED CMAKE_BUILD_TYPE) #Debug build: Put Debug paths before Release paths. + list(APPEND CMAKE_PREFIX_PATH + "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug" + "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}" + ) + list(APPEND CMAKE_LIBRARY_PATH + "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/lib/manual-link" + "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib/manual-link" + ) + list(APPEND CMAKE_FIND_ROOT_PATH + "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug" + "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}" + ) +else() #Release build: Put Release paths before Debug paths. Debug Paths are required so that CMake generates correct info in autogenerated target files. + list(APPEND CMAKE_PREFIX_PATH + "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}" + "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug" + ) + list(APPEND CMAKE_LIBRARY_PATH + "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib/manual-link" + "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/lib/manual-link" + ) + list(APPEND CMAKE_FIND_ROOT_PATH + "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}" + "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug" + ) +endif() + +# If one CMAKE_FIND_ROOT_PATH_MODE_* variables is set to ONLY, to make sure that ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET} +# and ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug are searched, it is not sufficient to just add them to CMAKE_FIND_ROOT_PATH, +# as CMAKE_FIND_ROOT_PATH specify "one or more directories to be prepended to all other search directories", so to make sure that +# the libraries are searched as they are, it is necessary to add "/" to the CMAKE_PREFIX_PATH +if(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE STREQUAL "ONLY" OR + CMAKE_FIND_ROOT_PATH_MODE_LIBRARY STREQUAL "ONLY" OR + CMAKE_FIND_ROOT_PATH_MODE_PACKAGE STREQUAL "ONLY") + list(APPEND CMAKE_PREFIX_PATH "/") +endif() + +set(VCPKG_CMAKE_FIND_ROOT_PATH "${CMAKE_FIND_ROOT_PATH}") + +file(TO_CMAKE_PATH "$ENV{PROGRAMFILES}" Z_VCPKG_PROGRAMFILES) +set(Z_VCPKG_PROGRAMFILESX86_NAME "PROGRAMFILES(x86)") +file(TO_CMAKE_PATH "$ENV{${Z_VCPKG_PROGRAMFILESX86_NAME}}" Z_VCPKG_PROGRAMFILESX86) +set(CMAKE_SYSTEM_IGNORE_PATH + "${Z_VCPKG_PROGRAMFILES}/OpenSSL" + "${Z_VCPKG_PROGRAMFILES}/OpenSSL-Win32" + "${Z_VCPKG_PROGRAMFILES}/OpenSSL-Win64" + "${Z_VCPKG_PROGRAMFILES}/OpenSSL-Win32/lib/VC" + "${Z_VCPKG_PROGRAMFILES}/OpenSSL-Win64/lib/VC" + "${Z_VCPKG_PROGRAMFILES}/OpenSSL-Win32/lib/VC/static" + "${Z_VCPKG_PROGRAMFILES}/OpenSSL-Win64/lib/VC/static" + "${Z_VCPKG_PROGRAMFILESX86}/OpenSSL" + "${Z_VCPKG_PROGRAMFILESX86}/OpenSSL-Win32" + "${Z_VCPKG_PROGRAMFILESX86}/OpenSSL-Win64" + "${Z_VCPKG_PROGRAMFILESX86}/OpenSSL-Win32/lib/VC" + "${Z_VCPKG_PROGRAMFILESX86}/OpenSSL-Win64/lib/VC" + "${Z_VCPKG_PROGRAMFILESX86}/OpenSSL-Win32/lib/VC/static" + "${Z_VCPKG_PROGRAMFILESX86}/OpenSSL-Win64/lib/VC/static" + "C:/OpenSSL/" + "C:/OpenSSL-Win32/" + "C:/OpenSSL-Win64/" + "C:/OpenSSL-Win32/lib/VC" + "C:/OpenSSL-Win64/lib/VC" + "C:/OpenSSL-Win32/lib/VC/static" + "C:/OpenSSL-Win64/lib/VC/static" +) + +# CMAKE_EXECUTABLE_SUFFIX is not yet defined +if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows") + set(Z_VCPKG_EXECUTABLE "${Z_VCPKG_ROOT_DIR}/vcpkg.exe") + set(Z_VCPKG_BOOTSTRAP_SCRIPT "${Z_VCPKG_ROOT_DIR}/bootstrap-vcpkg.bat") +else() + set(Z_VCPKG_EXECUTABLE "${Z_VCPKG_ROOT_DIR}/vcpkg") + set(Z_VCPKG_BOOTSTRAP_SCRIPT "${Z_VCPKG_ROOT_DIR}/bootstrap-vcpkg.sh") +endif() + +if(VCPKG_MANIFEST_MODE AND VCPKG_MANIFEST_INSTALL AND NOT Z_VCPKG_CMAKE_IN_TRY_COMPILE AND NOT Z_VCPKG_HAS_FATAL_ERROR) + if(NOT EXISTS "${Z_VCPKG_EXECUTABLE}" AND NOT Z_VCPKG_HAS_FATAL_ERROR) + message(STATUS "Bootstrapping vcpkg before install") + + file(TO_NATIVE_PATH "${CMAKE_BINARY_DIR}/vcpkg-bootstrap.log" Z_VCPKG_BOOTSTRAP_LOG) + execute_process( + COMMAND "${Z_VCPKG_BOOTSTRAP_SCRIPT}" ${VCPKG_BOOTSTRAP_OPTIONS} + OUTPUT_FILE "${Z_VCPKG_BOOTSTRAP_LOG}" + ERROR_FILE "${Z_VCPKG_BOOTSTRAP_LOG}" + RESULT_VARIABLE Z_VCPKG_BOOTSTRAP_RESULT) + + if(Z_VCPKG_BOOTSTRAP_RESULT EQUAL 0) + message(STATUS "Bootstrapping vcpkg before install - done") + else() + message(STATUS "Bootstrapping vcpkg before install - failed") + z_vcpkg_add_fatal_error("vcpkg install failed. See logs for more information: ${Z_VCPKG_BOOTSTRAP_LOG}") + endif() + endif() + + if(NOT Z_VCPKG_HAS_FATAL_ERROR) + message(STATUS "Running vcpkg install") + + set(Z_VCPKG_ADDITIONAL_MANIFEST_PARAMS) + + if(DEFINED VCPKG_HOST_TRIPLET AND NOT VCPKG_HOST_TRIPLET STREQUAL "") + list(APPEND Z_VCPKG_ADDITIONAL_MANIFEST_PARAMS "--host-triplet=${VCPKG_HOST_TRIPLET}") + endif() + + if(VCPKG_OVERLAY_PORTS) + foreach(Z_VCPKG_OVERLAY_PORT IN LISTS VCPKG_OVERLAY_PORTS) + list(APPEND Z_VCPKG_ADDITIONAL_MANIFEST_PARAMS "--overlay-ports=${Z_VCPKG_OVERLAY_PORT}") + endforeach() + endif() + if(VCPKG_OVERLAY_TRIPLETS) + foreach(Z_VCPKG_OVERLAY_TRIPLET IN LISTS VCPKG_OVERLAY_TRIPLETS) + list(APPEND Z_VCPKG_ADDITIONAL_MANIFEST_PARAMS "--overlay-triplets=${Z_VCPKG_OVERLAY_TRIPLET}") + endforeach() + endif() + + if(DEFINED VCPKG_FEATURE_FLAGS OR DEFINED CACHE{VCPKG_FEATURE_FLAGS}) + list(JOIN VCPKG_FEATURE_FLAGS "," Z_VCPKG_FEATURE_FLAGS) + set(Z_VCPKG_FEATURE_FLAGS "--feature-flags=${Z_VCPKG_FEATURE_FLAGS}") + endif() + + foreach(Z_VCPKG_FEATURE IN LISTS VCPKG_MANIFEST_FEATURES) + list(APPEND Z_VCPKG_ADDITIONAL_MANIFEST_PARAMS "--x-feature=${Z_VCPKG_FEATURE}") + endforeach() + + if(VCPKG_MANIFEST_NO_DEFAULT_FEATURES) + list(APPEND Z_VCPKG_ADDITIONAL_MANIFEST_PARAMS "--x-no-default-features") + endif() + + if(NOT CMAKE_VERSION VERSION_LESS "3.18") # == GREATER_EQUAL, but that was added in CMake 3.7 + set(Z_VCPKG_MANIFEST_INSTALL_ECHO_PARAMS ECHO_OUTPUT_VARIABLE ECHO_ERROR_VARIABLE) + else() + set(Z_VCPKG_MANIFEST_INSTALL_ECHO_PARAMS) + endif() + + execute_process( + COMMAND "${Z_VCPKG_EXECUTABLE}" install + --triplet "${VCPKG_TARGET_TRIPLET}" + --vcpkg-root "${Z_VCPKG_ROOT_DIR}" + "--x-wait-for-lock" + "--x-manifest-root=${VCPKG_MANIFEST_DIR}" + "--x-install-root=${_VCPKG_INSTALLED_DIR}" + "${Z_VCPKG_FEATURE_FLAGS}" + ${Z_VCPKG_ADDITIONAL_MANIFEST_PARAMS} + ${VCPKG_INSTALL_OPTIONS} + OUTPUT_VARIABLE Z_VCPKG_MANIFEST_INSTALL_LOGTEXT + ERROR_VARIABLE Z_VCPKG_MANIFEST_INSTALL_LOGTEXT + RESULT_VARIABLE Z_VCPKG_MANIFEST_INSTALL_RESULT + ${Z_VCPKG_MANIFEST_INSTALL_ECHO_PARAMS} + ) + + file(TO_NATIVE_PATH "${CMAKE_BINARY_DIR}/vcpkg-manifest-install.log" Z_VCPKG_MANIFEST_INSTALL_LOGFILE) + file(WRITE "${Z_VCPKG_MANIFEST_INSTALL_LOGFILE}" "${Z_VCPKG_MANIFEST_INSTALL_LOGTEXT}") + + if(Z_VCPKG_MANIFEST_INSTALL_RESULT EQUAL 0) + message(STATUS "Running vcpkg install - done") + + # file(TOUCH) added in CMake 3.12 + file(WRITE "${_VCPKG_INSTALLED_DIR}/.cmakestamp" "") + set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS + "${VCPKG_MANIFEST_DIR}/vcpkg.json" + "${_VCPKG_INSTALLED_DIR}/.cmakestamp") + if(EXISTS "${VCPKG_MANIFEST_DIR}/vcpkg-configuration.json") + set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS + "${VCPKG_MANIFEST_DIR}/vcpkg-configuration.json") + endif() + else() + message(STATUS "Running vcpkg install - failed") + z_vcpkg_add_fatal_error("vcpkg install failed. See logs for more information: ${Z_VCPKG_MANIFEST_INSTALL_LOGFILE}") + endif() + endif() +endif() + +list(APPEND CMAKE_PROGRAM_PATH "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/tools") +file(GLOB Z_VCPKG_TOOLS_DIRS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/tools/*") +foreach(Z_VCPKG_TOOLS_DIR IN LISTS Z_VCPKG_TOOLS_DIRS) + if(IS_DIRECTORY "${Z_VCPKG_TOOLS_DIR}") + list(APPEND CMAKE_PROGRAM_PATH "${Z_VCPKG_TOOLS_DIR}") + endif() +endforeach() + +function(add_executable) + z_vcpkg_function_arguments(ARGS) + _add_executable(${ARGS}) + set(target_name "${ARGV0}") + + list(FIND ARGV "IMPORTED" IMPORTED_IDX) + list(FIND ARGV "ALIAS" ALIAS_IDX) + list(FIND ARGV "MACOSX_BUNDLE" MACOSX_BUNDLE_IDX) + if(IMPORTED_IDX EQUAL -1 AND ALIAS_IDX EQUAL -1) + if(VCPKG_APPLOCAL_DEPS) + if(Z_VCPKG_TARGET_TRIPLET_PLAT MATCHES "windows|uwp") + z_vcpkg_set_powershell_path() + set(EXTRA_OPTIONS "") + if(X_VCPKG_APPLOCAL_DEPS_SERIALIZED) + set(EXTRA_OPTIONS USES_TERMINAL) + endif() + add_custom_command(TARGET "${target_name}" POST_BUILD + COMMAND "${Z_VCPKG_POWERSHELL_PATH}" -noprofile -executionpolicy Bypass -file "${Z_VCPKG_TOOLCHAIN_DIR}/msbuild/applocal.ps1" + -targetBinary "$<TARGET_FILE:${target_name}>" + -installedDir "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}$<$<CONFIG:Debug>:/debug>/bin" + -OutVariable out + ${EXTRA_OPTIONS} + ) + elseif(Z_VCPKG_TARGET_TRIPLET_PLAT MATCHES "osx") + if(NOT MACOSX_BUNDLE_IDX EQUAL -1) + add_custom_command(TARGET "${target_name}" POST_BUILD + COMMAND python "${Z_VCPKG_TOOLCHAIN_DIR}/osx/applocal.py" + "$<TARGET_FILE:${target_name}>" + "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}$<$<CONFIG:Debug>:/debug>" + ) + endif() + endif() + endif() + set_target_properties("${target_name}" PROPERTIES VS_USER_PROPS do_not_import_user.props) + set_target_properties("${target_name}" PROPERTIES VS_GLOBAL_VcpkgEnabled false) + endif() +endfunction() + +function(add_library) + z_vcpkg_function_arguments(ARGS) + _add_library(${ARGS}) + set(target_name "${ARGV0}") + + list(FIND ARGS "IMPORTED" IMPORTED_IDX) + list(FIND ARGS "INTERFACE" INTERFACE_IDX) + list(FIND ARGS "ALIAS" ALIAS_IDX) + if(IMPORTED_IDX EQUAL -1 AND INTERFACE_IDX EQUAL -1 AND ALIAS_IDX EQUAL -1) + get_target_property(IS_LIBRARY_SHARED "${target_name}" TYPE) + if(VCPKG_APPLOCAL_DEPS AND Z_VCPKG_TARGET_TRIPLET_PLAT MATCHES "windows|uwp" AND (IS_LIBRARY_SHARED STREQUAL "SHARED_LIBRARY" OR IS_LIBRARY_SHARED STREQUAL "MODULE_LIBRARY")) + z_vcpkg_set_powershell_path() + add_custom_command(TARGET "${target_name}" POST_BUILD + COMMAND "${Z_VCPKG_POWERSHELL_PATH}" -noprofile -executionpolicy Bypass -file "${Z_VCPKG_TOOLCHAIN_DIR}/msbuild/applocal.ps1" + -targetBinary "$<TARGET_FILE:${target_name}>" + -installedDir "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}$<$<CONFIG:Debug>:/debug>/bin" + -OutVariable out + ) + endif() + set_target_properties("${target_name}" PROPERTIES VS_USER_PROPS do_not_import_user.props) + set_target_properties("${target_name}" PROPERTIES VS_GLOBAL_VcpkgEnabled false) + endif() +endfunction() + +# This is an experimental function to enable applocal install of dependencies as part of the `make install` process +# Arguments: +# TARGETS - a list of installed targets to have dependencies copied for +# DESTINATION - the runtime directory for those targets (usually `bin`) +# +# Note that this function requires CMake 3.14 for policy CMP0087 +function(x_vcpkg_install_local_dependencies) + if(Z_VCPKG_TARGET_TRIPLET_PLAT MATCHES "windows|uwp") + cmake_parse_arguments(PARSE_ARGV 0 __VCPKG_APPINSTALL "" "DESTINATION" "TARGETS") + z_vcpkg_set_powershell_path() + if(NOT IS_ABSOLUTE "${__VCPKG_APPINSTALL_DESTINATION}") + set(__VCPKG_APPINSTALL_DESTINATION "\${CMAKE_INSTALL_PREFIX}/${__VCPKG_APPINSTALL_DESTINATION}") + endif() + foreach(TARGET IN LISTS __VCPKG_APPINSTALL_TARGETS) + get_target_property(TARGETTYPE "${TARGET}" TYPE) + if(NOT TARGETTYPE STREQUAL "INTERFACE_LIBRARY") + # Install CODE|SCRIPT allow the use of generator expressions + if(POLICY CMP0087) + cmake_policy(SET CMP0087 NEW) + endif() + install(CODE "message(\"-- Installing app dependencies for ${TARGET}...\") + execute_process(COMMAND \"${Z_VCPKG_POWERSHELL_PATH}\" -noprofile -executionpolicy Bypass -file \"${Z_VCPKG_TOOLCHAIN_DIR}/msbuild/applocal.ps1\" + -targetBinary \"${__VCPKG_APPINSTALL_DESTINATION}/$<TARGET_FILE_NAME:${TARGET}>\" + -installedDir \"${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}$<$<CONFIG:Debug>:/debug>/bin\" + -OutVariable out)") + endif() + endforeach() + endif() +endfunction() + +if(X_VCPKG_APPLOCAL_DEPS_INSTALL) + function(install) + z_vcpkg_function_arguments(ARGS) + _install(${ARGS}) + + if(ARGV0 STREQUAL "TARGETS") + # Will contain the list of targets + set(PARSED_TARGETS "") + + # Destination - [RUNTIME] DESTINATION argument overrides this + set(DESTINATION "bin") + + # Parse arguments given to the install function to find targets and (runtime) destination + set(MODIFIER "") # Modifier for the command in the argument + set(LAST_COMMAND "") # Last command we found to process + foreach(ARG IN LISTS ARGS) + if(ARG MATCHES "ARCHIVE|LIBRARY|RUNTIME|OBJECTS|FRAMEWORK|BUNDLE|PRIVATE_HEADER|PUBLIC_HEADER|RESOURCE|INCLUDES") + set(MODIFIER "${ARG}") + continue() + endif() + if(ARG MATCHES "TARGETS|DESTINATION|PERMISSIONS|CONFIGURATIONS|COMPONENT|NAMELINK_COMPONENT|OPTIONAL|EXCLUDE_FROM_ALL|NAMELINK_ONLY|NAMELINK_SKIP|EXPORT") + set(LAST_COMMAND "${ARG}") + continue() + endif() + + if(LAST_COMMAND STREQUAL "TARGETS") + list(APPEND PARSED_TARGETS "${ARG}") + endif() + + if(LAST_COMMAND STREQUAL "DESTINATION" AND (MODIFIER STREQUAL "" OR MODIFIER STREQUAL "RUNTIME")) + set(DESTINATION "${ARG}") + endif() + endforeach() + + x_vcpkg_install_local_dependencies(TARGETS "${PARSED_TARGETS}" DESTINATION "${DESTINATION}") + endif() + endfunction() +endif() + +if(NOT DEFINED VCPKG_OVERRIDE_FIND_PACKAGE_NAME) + set(VCPKG_OVERRIDE_FIND_PACKAGE_NAME find_package) +endif() +function("${VCPKG_OVERRIDE_FIND_PACKAGE_NAME}") + # Workaround to set the ROOT_PATH until upstream CMake stops overriding + # the ROOT_PATH at apple OS initialization phase. + # See https://gitlab.kitware.com/cmake/cmake/merge_requests/3273 + if(CMAKE_SYSTEM_NAME STREQUAL iOS) + # this is not a mutating operation, + # this just creates a new variable named CMAKE_FIND_ROOT_PATH with value + # "${CMAKE_FIND_ROOT_PATH};${VCPKG_CMAKE_FIND_ROOT_PATH}" + # therefore, we don't have to worry about restoring its old value + list(APPEND CMAKE_FIND_ROOT_PATH "${VCPKG_CMAKE_FIND_ROOT_PATH}") + endif() + z_vcpkg_function_arguments(ARGS) + set(PACKAGE_NAME "${ARGV0}") + string(TOLOWER "${PACKAGE_NAME}" LOWERCASE_PACKAGE_NAME) + + set(VCPKG_CMAKE_WRAPPER_PATH "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/share/${LOWERCASE_PACKAGE_NAME}/vcpkg-cmake-wrapper.cmake") + + z_vcpkg_start_parent_scope_export() + if(EXISTS "${VCPKG_CMAKE_WRAPPER_PATH}") + include("${VCPKG_CMAKE_WRAPPER_PATH}") + elseif("${PACKAGE_NAME}" STREQUAL "Boost" AND EXISTS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include/boost") + # Checking for the boost headers disables this wrapper unless the user has installed at least one boost library + set(Boost_USE_STATIC_LIBS OFF) + set(Boost_USE_MULTITHREADED ON) + unset(Boost_USE_STATIC_RUNTIME) + set(Boost_NO_BOOST_CMAKE ON) + unset(Boost_USE_STATIC_RUNTIME CACHE) + if("${CMAKE_VS_PLATFORM_TOOLSET}" STREQUAL "v120") + set(Boost_COMPILER "-vc120") + else() + set(Boost_COMPILER "-vc140") + endif() + _find_package(${ARGS}) + elseif("${PACKAGE_NAME}" STREQUAL "ICU" AND EXISTS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include/unicode/utf.h") + list(FIND ARGS "COMPONENTS" COMPONENTS_IDX) + if(NOT COMPONENTS_IDX EQUAL -1) + _find_package(${ARGS} COMPONENTS data) + else() + _find_package(${ARGS}) + endif() + elseif("${PACKAGE_NAME}" STREQUAL "GSL" AND EXISTS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include/gsl") + _find_package(${ARGS}) + if(GSL_FOUND AND TARGET GSL::gsl) + set_property( TARGET GSL::gslcblas APPEND PROPERTY IMPORTED_CONFIGURATIONS Release ) + set_property( TARGET GSL::gsl APPEND PROPERTY IMPORTED_CONFIGURATIONS Release ) + if( EXISTS "${GSL_LIBRARY_DEBUG}" AND EXISTS "${GSL_CBLAS_LIBRARY_DEBUG}") + set_property( TARGET GSL::gsl APPEND PROPERTY IMPORTED_CONFIGURATIONS Debug ) + set_target_properties( GSL::gsl PROPERTIES IMPORTED_LOCATION_DEBUG "${GSL_LIBRARY_DEBUG}" ) + set_property( TARGET GSL::gslcblas APPEND PROPERTY IMPORTED_CONFIGURATIONS Debug ) + set_target_properties( GSL::gslcblas PROPERTIES IMPORTED_LOCATION_DEBUG "${GSL_CBLAS_LIBRARY_DEBUG}" ) + endif() + endif() + elseif("${PACKAGE_NAME}" STREQUAL "CURL" AND EXISTS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include/curl") + _find_package(${ARGS}) + if(CURL_FOUND) + if(EXISTS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib/nghttp2.lib") + list(APPEND CURL_LIBRARIES + "debug" "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/lib/nghttp2.lib" + "optimized" "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib/nghttp2.lib") + endif() + endif() + elseif("${LOWERCASE_PACKAGE_NAME}" STREQUAL "grpc" AND EXISTS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/share/grpc") + list(REMOVE_AT ARGS 0) + _find_package(gRPC ${ARGS}) + else() + _find_package(${ARGS}) + endif() + + z_vcpkg_complete_parent_scope_export(IGNORE_REGEX "(^Z_VCPKG_)|(^ARGS$)|(^COMPONENTS_IDX$)") +endfunction() + +set(VCPKG_TOOLCHAIN ON) +set(Z_VCPKG_UNUSED "${CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION}") +set(Z_VCPKG_UNUSED "${CMAKE_EXPORT_NO_PACKAGE_REGISTRY}") +set(Z_VCPKG_UNUSED "${CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY}") +set(Z_VCPKG_UNUSED "${CMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY}") +set(Z_VCPKG_UNUSED "${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP}") + +# Propogate these values to try-compile configurations so the triplet and toolchain load +if(NOT Z_VCPKG_CMAKE_IN_TRY_COMPILE) + if(Z_VCPKG_CMAKE_EMULATE_TRY_COMPILE_PLATFORM_VARIABLES) + file(TO_CMAKE_PATH "${VCPKG_CHAINLOAD_TOOLCHAIN_FILE}" Z_VCPKG_CHAINLOAD_FILE_CMAKE) + file(TO_CMAKE_PATH "${Z_VCPKG_ROOT_DIR}" Z_VCPKG_ROOT_DIR_CMAKE) + file(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/vcpkg.config.cmake" + "set(VCPKG_TARGET_TRIPLET \"${VCPKG_TARGET_TRIPLET}\" CACHE STRING \"\")\n" + "set(VCPKG_TARGET_ARCHITECTURE \"${VCPKG_TARGET_ARCHITECTURE}\" CACHE STRING \"\")\n" + "set(VCPKG_APPLOCAL_DEPS \"${VCPKG_APPLOCAL_DEPS}\" CACHE STRING \"\")\n" + "set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE \"${Z_VCPKG_CHAINLOAD_FILE_CMAKE}\" CACHE STRING \"\")\n" + "set(Z_VCPKG_ROOT_DIR \"${Z_VCPKG_ROOT_DIR_CMAKE}\" CACHE STRING \"\")\n" + ) + else() + list(APPEND CMAKE_TRY_COMPILE_PLATFORM_VARIABLES + VCPKG_TARGET_TRIPLET + VCPKG_TARGET_ARCHITECTURE + VCPKG_APPLOCAL_DEPS + VCPKG_CHAINLOAD_TOOLCHAIN_FILE + Z_VCPKG_ROOT_DIR + ) + endif() +endif() + +if(Z_VCPKG_HAS_FATAL_ERROR) + message(FATAL_ERROR "${Z_VCPKG_FATAL_ERROR}") +endif() + +cmake_policy(POP) diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/ci.baseline.txt b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/ci.baseline.txt new file mode 100644 index 000000000..166bebb11 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/ci.baseline.txt @@ -0,0 +1,1812 @@ +########################################################################### +## This file defines the current expected build state of ports in CI. +## +## States +## pass - (default) the port builds in the CI system. If a port is +## missing from this file then it is assumed to build. +## fail - the port does not build in the CI system. +## This is not necessarily the same as if a port is expected to build +## on a developers machine because it may fail due to the machine +## configuration. When set to fail the CI system will still attempt +## to build the port and will report a CI failure until this file is updated. +## skip - Do not build this port in the CI system. +## This is added to ports that may be flaky or conflict with other +## ports. Please comment for why a port is skipped so it can be +## removed when the issue is resolved. +## +## +## CI tested triplets: +## arm64-windows +## arm-uwp +## x64-linux +## x64-osx +## x64-uwp +## x64-windows +## x64-windows-static +## x64-windows-static-md +## x86-windows +## + +# Add new items alphabetically + +# script ports +#vcpkg-cmake:arm64-windows=fail +#vcpkg-cmake:arm-uwp=fail +#vcpkg-cmake:x64-uwp=fail +#vcpkg-cmake:x64-windows-static=fail +#vcpkg-cmake:x64-windows-static-md=fail +#vcpkg-cmake:x86-windows=fail + +#vcpkg-cmake-config:arm64-windows=fail +#vcpkg-cmake-config:arm-uwp=fail +#vcpkg-cmake-config:x64-uwp=fail +#vcpkg-cmake-config:x64-windows-static=fail +#vcpkg-cmake-config:x64-windows-static-md=fail +#vcpkg-cmake-config:x86-windows=fail + +# other ports +# Cross compiling CI machine cannot run gen_test_char to generate apr_escape_test_char.h +apr:arm64-windows=fail +# Requires ATL for ARM64 to be installed in CI +azure-storage-cpp:arm64-windows=fail + +blend2d:arm64-windows=fail +blend2d:arm-uwp=fail +blend2d:x64-uwp=fail +blitz:x64-uwp=fail +blitz:arm64-windows=fail +blitz:arm-uwp=fail +blosc:arm64-windows=fail +blosc:arm-uwp=fail +blosc:x64-uwp=fail +bond:arm-uwp=fail +bond:x64-osx=fail +bond:x64-uwp=fail +botan:x64-uwp=fail +breakpad:arm64-windows=fail +bullet3:arm64-windows=fail +bullet3:arm-uwp=fail +bullet3:x64-uwp=fail +caf:arm-uwp=fail +caf:arm64-windows=fail +caf:x64-uwp=fail +caffe2:x86-windows=fail +caffe2:arm64-windows=fail +# Requires VM update for gtk-doc +cairo:x64-osx=fail +c-ares:arm-uwp=fail +c-ares:x64-uwp=fail +cartographer:x64-osx=fail +casclib:arm-uwp=fail +casclib:x64-uwp=fail +catch-classic:arm64-windows = skip +catch-classic:arm-uwp = skip +catch-classic:x64-linux = skip +catch-classic:x64-osx = skip +catch-classic:x64-uwp = skip +catch-classic:x64-windows = skip +catch-classic:x64-windows-static = skip +catch-classic:x64-windows-static-md=skip +catch-classic:x86-windows = skip +ccd:arm-uwp=fail +ccd:x64-uwp=fail +cello:arm-uwp=fail +cello:x64-uwp=fail +cfitsio:arm-uwp=fail +cfitsio:x64-uwp=fail +cgicc:arm-uwp=fail +cgicc:x64-uwp=fail +# DCMTK currently has a vendored copy of libcharls.a, which causes conflicts with charls (TODO: use charls' copy) +charls:arm64-windows=skip +charls:arm-uwp=skip +charls:x64-linux=skip +charls:x64-osx=skip +charls:x64-uwp=skip +charls:x64-windows=skip +charls:x64-windows-static=skip +charls:x64-windows-static-md=skip +charls:x86-windows=skip +chartdir:arm64-windows=fail +chartdir:arm-uwp=fail +chartdir:x64-uwp=fail +chartdir:x64-windows-static=fail +chmlib:arm-uwp=fail +chmlib:x64-uwp=fail +# Chromium Base requires a recent version of Clang to be installed. +chromium-base:x64-linux=skip +civetweb:arm64-windows = skip +civetweb:arm-uwp = skip +civetweb:x64-uwp = skip +clamav:arm64-windows=fail +clblas:arm64-windows=fail +clblast:x64-linux=fail +clblast:x64-windows-static=fail +clblast:x64-windows-static-md=fail +clockutils:x64-linux=fail +clockutils:x64-osx=fail +cmark:x64-windows-static=fail +cmcstl2:arm64-windows = skip +cmcstl2:arm-uwp = skip +cmcstl2:x64-linux = skip +cmcstl2:x64-osx = skip +cmcstl2:x64-uwp = skip +cmcstl2:x64-windows = skip +cmcstl2:x64-windows-static = skip +cmcstl2:x64-windows-static-md=skip +cmcstl2:x86-windows = skip +coin:arm64-windows=fail +coin:arm-uwp=fail +coin:x64-uwp=fail +constexpr-contracts:x64-linux=fail +coolprop:arm-uwp=fail +coolprop:x64-linux=fail +coolprop:x64-osx=fail +coolprop:x64-uwp=fail +coroutine:arm-uwp=fail +coroutine:x64-linux=fail +coroutine:x64-uwp=fail +corrade:arm-uwp=fail +corrade:x64-uwp=fail +cppcms:x64-linux=fail +cppcms:x64-osx=fail +cppcms:x64-windows-static=fail +cppfs:arm-uwp=fail +cppfs:x64-uwp=fail +cppmicroservices:arm64-windows=fail +cppmicroservices:arm-uwp=fail +cppmicroservices:x64-uwp=fail +cpp-netlib:arm-uwp=fail +cpp-netlib:x64-uwp=fail +cppcoro:x64-linux=fail +cppcoro:arm-uwp=fail +cppcoro:x64-uwp=fail +cpuinfo:arm64-windows=fail +crashpad:arm64-windows=fail +crashpad:arm-uwp=fail +crashpad:x64-linux=fail +crashpad:x64-uwp=fail +crashpad:x86-windows=fail +crossguid:x64-osx=fail +ctemplate:arm64-windows=fail +ctemplate:arm-uwp=fail +ctemplate:x64-linux=fail +ctemplate:x64-osx=fail +cuda:x64-osx=fail +cudnn:arm64-windows=fail +cudnn:arm-uwp=fail +cudnn:x64-uwp=fail +cudnn:x64-windows-static=fail +cudnn:x86-windows=fail +# Since pipeline cannot automatically install dbghelp dependency, skip this detection +dbghelp:arm-uwp=skip +dbghelp:arm64-windows=skip +dbghelp:x64-linux=fail +dbghelp:x64-osx=fail +dbghelp:x64-uwp=skip +dbghelp:x64-windows-static=skip +dbghelp:x64-windows-static-md=skip +dbghelp:x64-windows=skip +dbghelp:x86-windows=skip +dcmtk:arm-uwp=fail +dcmtk:arm64-windows=fail +dcmtk:x64-uwp=fail +detours:x64-linux=fail +detours:x64-osx=fail +devicenameresolver:arm-uwp=fail +devicenameresolver:x64-linux=fail +devicenameresolver:x64-osx=fail +devicenameresolver:x64-uwp=fail +devicenameresolver:x64-windows-static=fail +dimcli:arm-uwp=fail +dimcli:x64-osx=fail +dimcli:x64-uwp=fail +# directxtex requires GCC 9 or later for linux support +directxtex:x64-linux=fail +discord-game-sdk:x64-windows-static=fail +discord-game-sdk:x64-windows-static-md=fail +discord-rpc:arm-uwp=fail +discord-rpc:x64-uwp=fail +dlfcn-win32:arm-uwp=fail +dlfcn-win32:x64-linux=fail +dlfcn-win32:x64-osx=fail +dlfcn-win32:x64-uwp=fail +dmlc:arm-uwp=fail +dmlc:x64-uwp=fail +dpdk:arm-uwp=fail +dpdk:arm64-windows=fail +dpdk:x64-linux=fail +dpdk:x64-osx=fail +dpdk:x64-uwp=fail +dpdk:x64-windows-static=fail +dpdk:x64-windows-static-md=fail +dpdk:x64-windows=fail +dpdk:x86-windows=fail +duckx:arm64-windows = skip +duckx:arm-uwp = skip +duckx:x64-linux = skip +duckx:x64-osx = skip +duckx:x64-uwp = skip +duckx:x64-windows = skip +duckx:x64-windows-static = skip +duckx:x64-windows-static-md=skip +duckx:x86-windows = skip +duilib:arm-uwp=fail +duilib:x64-linux=fail +duilib:x64-osx=fail +duilib:x64-uwp=fail + +# requires python@2 from brew, but that no longer exists +# python2 EOL yay! +duktape:x64-osx=skip + +eastl:arm-uwp=fail +easyhook:arm64-windows=fail +easyhook:arm-uwp=fail +easyhook:x64-linux=fail +easyhook:x64-osx=fail +easyhook:x64-uwp=fail +easyhook:x64-windows-static=fail +easyhook:x64-windows-static-md=fail +easyloggingpp:arm-uwp=fail +easyloggingpp:x64-uwp=fail +eathread:arm64-windows=fail +eathread:arm-uwp=fail +eathread:x64-uwp=fail +eathread:x86-windows=fail +ebml:arm-uwp=fail +ebml:x64-uwp=fail +ecsutil:arm64-windows=fail +ecsutil:arm-uwp=fail +ecsutil:x64-linux=fail +ecsutil:x64-osx=fail +ecsutil:x64-uwp=fail +# Checks for gnu extension so only works with gcc. +elfutils:x64-osx=fail +embree2:x64-linux=fail +embree2:x64-osx=fail +embree2:x64-windows-static=fail +embree2:x64-windows-static-md=fail +enet:arm-uwp=fail +enet:x64-uwp=fail +epsilon:arm-uwp=fail +epsilon:x64-linux=fail +epsilon:x64-osx=fail +epsilon:x64-uwp=fail +epsilon:x64-windows-static=fail +faad2:x64-linux=fail +faad2:x64-osx=fail +fann:x64-windows-static=fail +farmhash:arm64-windows=fail +farmhash:arm-uwp=fail +farmhash:x64-uwp=fail +farmhash:x64-windows=fail +farmhash:x64-windows-static=fail +farmhash:x64-windows-static-md=fail +farmhash:x86-windows=fail +fastrtps:arm-uwp=fail +fastrtps:x64-uwp=fail +fastrtps:x64-windows-static=fail +fastrtps:x64-windows-static-md=fail +fdk-aac:arm64-windows=fail +fdk-aac:arm-uwp=fail +fdk-aac:x64-uwp=fail +fdlibm:arm-uwp=fail +fdlibm:x64-uwp=fail +fftw3:arm-uwp=fail +fftw3:x64-uwp=fail +flint:x64-linux=fail +flint:x64-osx=fail +fltk:arm-uwp=fail +fltk:x64-uwp=fail +fluidsynth:x64-osx=fail +fluidsynth:x64-windows-static-md=fail +# fluidlite conflicts with fluidsynth; we test fluidsynth rather than fluidlite because +# fluidlite has no dependencies and thus is less likely to be broken by another package. +fluidlite:arm-uwp=skip +fluidlite:arm64-windows=skip +fluidlite:x64-linux=skip +fluidlite:x64-osx=skip +fluidlite:x64-uwp=skip +fluidlite:x64-windows-static=skip +fluidlite:x64-windows-static-md=skip +fluidlite:x64-windows=skip +fluidlite:x86-windows=skip +fmem:arm-uwp=fail +fmem:x64-uwp=fail +fmi4cpp:arm-uwp=fail +fmi4cpp:x64-uwp=fail +fmilib:arm64-windows=fail +fmilib:arm-uwp=fail +fmilib:x64-linux=fail +fmilib:x64-uwp=fail +fontconfig:x64-uwp=fail +fontconfig:arm-uwp=fail +fontconfig:arm64-windows=fail +foonathan-memory:arm64-windows=fail +foonathan-memory:arm-uwp=fail +foonathan-memory:x64-uwp=fail +# forest is removed by upstream, see https://github.com/microsoft/vcpkg/pull/16836 +forest:arm-uwp=fail +forest:arm64-windows=fail +forest:x64-linux=fail +forest:x64-uwp=fail +forest:x64-windows-static-md=fail +forest:x64-windows-static=fail +forest:x64-windows=fail +forest:x86-windows=fail +forest:x64-osx=fail +forge:x86-windows=fail +freeglut:arm64-windows=fail +freeglut:arm-uwp=fail +freeglut:x64-uwp=fail +freeglut:x64-osx=fail +# Needs /bigobj +freeopcua:arm64-windows=fail +freetype-gl:x64-uwp=fail +freexl:arm-uwp=fail +freexl:x64-uwp=fail +fribidi:arm64-windows=fail +fribidi:arm-uwp=fail +fribidi:x64-uwp=fail +ftgl:x64-uwp=fail +# https://github.com/GoogleCloudPlatform/functions-framework-cpp/issues/207 +functions-framework-cpp:x64-uwp=fail +fuzzylite:arm-uwp=fail +fuzzylite:x64-linux=fail +fuzzylite:x64-osx=fail +fuzzylite:x64-uwp=fail +gainput:arm-uwp=fail +gainput:x64-linux=fail +gainput:x64-uwp=fail + +# Requires a more recent gcc than we have in the test lab +gamedev-framework:x64-linux=fail +gasol:arm64-windows=fail +gasol:arm-uwp=fail +gasol:x64-uwp=fail +geos:arm-uwp=fail +geos:x64-uwp=fail + +# gsoap does not offer stable public source downloads +gsoap:x64-windows = skip +gsoap:x86-windows = skip +gsoap:x64-windows-static = skip +gsoap:x64-windows-static-md = skip + +# Port geotrans source ftp://ftp.nga.mil server +# extremely slow may take several hours to download +geotrans:x64-linux = skip +geotrans:x64-windows = skip +geotrans:x86-windows = skip +getopt:arm-uwp=fail +getopt:x64-uwp=fail +getopt-win32:arm64-windows=fail +getopt-win32:arm-uwp=fail +getopt-win32:x64-linux=fail +getopt-win32:x64-osx=fail +getopt-win32:x64-uwp=fail +getopt-win32:x64-windows-static=fail +gflags:arm-uwp=fail +gflags:x64-uwp=fail + +# Conflicts with libevent +gherkin-c:arm64-windows = skip +gherkin-c:arm-uwp = skip +gherkin-c:x64-linux=fail +gherkin-c:x64-osx=fail +gherkin-c:x64-uwp = skip +gherkin-c:x64-windows = skip +gherkin-c:x64-windows-static = skip +gherkin-c:x64-windows-static-md=skip +gherkin-c:x86-windows = skip +gl3w:arm64-windows=fail +gl3w:arm-uwp=fail +glew:arm64-windows=fail +glew:arm-uwp=fail +glfw3:arm-uwp=fail +glfw3:x64-uwp=fail +glib:x64-uwp=fail +glib:x64-windows-static=fail +gmmlib:arm64-windows=fail +gmmlib:arm-uwp=fail +gmmlib:x64-osx=fail +gmmlib:x64-uwp=fail +gmmlib:x64-windows=fail +gmmlib:x64-windows-static=fail +gmmlib:x64-windows-static-md=fail +gmmlib:x86-windows=fail +google-cloud-cpp:arm64-windows=fail +google-cloud-cpp:arm-uwp=fail +google-cloud-cpp:x64-uwp=fail +gppanel:x64-osx=fail +gperf:x64-uwp=fail +gperf:arm-uwp=fail +gperftools:arm64-windows=fail +gperftools:x64-uwp=fail +gperftools:arm-uwp=fail +graphicsmagick:arm-uwp=fail +graphicsmagick:x64-uwp=fail +graphite2:arm-uwp=fail +graphite2:x64-uwp=fail +graphqlparser:arm-uwp=fail +graphqlparser:x64-uwp=fail +gsl:arm-uwp=fail +gsl:x64-uwp=fail +gtkmm:x64-linux=fail +gts:x64-osx=fail +guetzli:x64-osx=fail +h3:arm64-windows=fail +h3:arm-uwp=fail +h3:x64-uwp=fail +halide:x64-windows-static=fail +hdf5:arm64-windows=fail +hdf5:arm-uwp=fail +hdf5:x64-uwp=fail +healpix:x86-windows=fail +healpix:x64-windows=fail +healpix:x64-windows-static=fail +healpix:x64-windows-static-md=fail +healpix:x64-uwp=fail +healpix:arm64-windows=fail +healpix:arm-uwp=fail +healpix:x64-osx=fail +hiredis:arm-uwp=fail +hiredis:x64-uwp=fail +hpx:x64-windows-static=fail +hpx:x64-linux=fail +libhsplasma:x64-windows-static=fail +ideviceinstaller:x64-windows-static-md=fail +idevicerestore:x64-linux=fail +idevicerestore:x64-osx=fail +ignition-common1:x64-linux=fail +ignition-msgs1:arm64-windows=fail +ignition-msgs1:arm-uwp=fail +ignition-msgs1:x64-uwp=fail +ignition-msgs5:arm64-windows=fail +ignition-msgs5:arm-uwp=fail +ignition-msgs5:x64-uwp=fail +ignition-msgs5:x64-osx=skip +# Conflicts with libjpeg-turbo, mozjpeg +ijg-libjpeg:arm64-windows = skip +ijg-libjpeg:arm-uwp = skip +ijg-libjpeg:x64-linux = skip +ijg-libjpeg:x64-osx = skip +ijg-libjpeg:x64-uwp = skip +ijg-libjpeg:x64-windows = skip +ijg-libjpeg:x64-windows-static = skip +ijg-libjpeg:x86-windows = skip +intel-ipsec:arm64-windows=fail +intel-ipsec:arm-uwp=fail +intel-ipsec:x64-osx=fail +intel-ipsec:x64-uwp=fail +intel-ipsec:x64-windows=fail +intel-ipsec:x64-windows-static=fail +intel-ipsec:x64-windows-static-md=fail +intel-ipsec:x86-windows=fail +intel-mkl:arm64-windows=fail +intel-mkl:arm-uwp=fail +intel-mkl:x64-linux=fail +intel-mkl:x64-osx=fail +intel-mkl:x64-uwp=fail +intel-mkl:x64-windows=fail +intel-mkl:x64-windows-static=fail +intel-mkl:x64-windows-static-md=fail +intel-mkl:x86-windows=fail +intelrdfpmathlib:arm-uwp=fail +intelrdfpmathlib:x64-linux=fail +intelrdfpmathlib:x64-uwp=fail +irrlicht:arm64-windows=fail +irrlicht:arm-uwp=fail +irrlicht:x64-osx=fail +irrlicht:x64-uwp=fail +isal:arm64-windows=fail +isal:arm-uwp=fail +isal:x64-osx=fail +isal:x64-uwp=fail +isal:x64-windows=fail +isal:x64-windows-static=fail +isal:x64-windows-static-md=fail +isal:x86-windows=fail +jaeger-client-cpp:arm64-windows=fail +jbig2dec:arm-uwp=fail +jbig2dec:x64-uwp=fail +jemalloc:arm64-windows=fail +jemalloc:arm-uwp=fail +jemalloc:x64-linux=fail +jemalloc:x64-osx=fail +jemalloc:x64-uwp=fail +jemalloc:x64-windows-static=fail +jinja2cpplight:arm-uwp=fail +jinja2cpplight:x64-uwp=fail +keystone:arm-uwp=fail +keystone:x64-uwp=fail +kfr:arm64-windows=fail +kfr:arm-uwp=fail +kfr:x64-linux=fail +kinectsdk1:arm64-windows=fail +kinectsdk1:arm-uwp=fail +kinectsdk1:x64-linux=fail +kinectsdk1:x64-osx=fail +kinectsdk2:arm64-windows=fail +kinectsdk2:arm-uwp=fail +kinectsdk2:x64-linux=fail +kinectsdk2:x64-osx=fail +lastools:arm-uwp=fail +lastools:x64-uwp=fail +laszip:arm-uwp=fail +laszip:x64-uwp=fail +lcm:x64-osx=fail +leptonica:x64-uwp=fail +leptonica:arm-uwp=fail +leveldb:arm-uwp=fail +leveldb:x64-uwp=fail +libbacktrace:arm64-windows=fail +libbacktrace:arm-uwp=fail +libbacktrace:x64-uwp=fail +libbacktrace:x64-windows=fail +libbacktrace:x64-windows-static=fail +libbacktrace:x64-windows-static-md=fail +libbacktrace:x86-windows=fail +libaiff:x64-linux=fail +libarchive:arm-uwp=fail +libbf:arm64-windows=fail +libbf:arm-uwp=fail +libbf:x64-uwp=fail +libbf:x64-windows=fail +libbf:x64-windows-static=fail +libbf:x64-windows-static-md=fail +libbf:x86-windows=fail +libbson:arm-uwp=fail +libbson:x64-uwp=fail +libcds:arm64-windows=fail +libcds:arm-uwp=fail +libcds:x64-uwp=fail +libconfig:x64-osx=fail +libcopp:arm64-windows=fail +libcopp:arm-uwp=fail +libcrafter:x86-windows=fail +libcrafter:x64-windows=fail +# Missing system libraries on linux to run/prepare autoconf +libgpod:x64-linux=fail +libgpod:x64-osx=fail +libcrafter:x64-windows-static-md=fail +cpuid:arm-uwp=fail +cpuid:x64-uwp=fail +cpuid:arm64-windows=fail +libdatrie:x64-linux=fail +libdatrie:x64-osx=fail +libdisasm:arm-uwp=fail +libdisasm:x64-uwp=fail +libdshowcapture:arm-uwp=fail +libdshowcapture:x64-linux=fail +libdshowcapture:x64-osx=fail +libdshowcapture:x64-uwp=fail +libepoxy:arm-uwp=fail +libepoxy:x64-uwp=fail +libepoxy:x64-windows-static=fail +libevent:arm-uwp=fail +libevent:x64-uwp=fail +libevhtp:x86-windows=fail +libevhtp:x64-windows=fail +libevhtp:x64-windows-static=fail +libevhtp:x64-windows-static-md=fail +libevhtp:x64-uwp=fail +libevhtp:arm64-windows=fail +libevhtp:arm-uwp=fail +libexif:arm-uwp=fail +libexif:x64-uwp=fail +libfabric:arm-uwp=fail +libfabric:x64-linux=fail +libfabric:x64-osx=fail +libfabric:x64-uwp=fail +libfabric:x64-windows-static=fail +libfabric:x64-windows-static-md=fail +libfreenect2:arm64-windows=fail +libfreenect2:x64-linux=fail +libfreenect2:x64-osx=fail +libgit2:arm-uwp=fail +libgit2:x64-uwp=fail +libgo:arm-uwp=fail +libgo:x64-uwp=fail +libgo:arm64-windows=fail +libgo:x64-windows=fail +libgo:x86-windows=fail +libgpod:arm64-windows=fail +libgpod:arm-uwp=fail +libgpod:x64-uwp=fail +libgpod:x64-windows=fail +libgpod:x64-windows-static=fail +libgpod:x64-windows-static-md=fail +libgpod:x86-windows=fail +libhdfs3:arm64-windows=fail +libhdfs3:arm-uwp=fail +libhdfs3:x64-uwp=fail +libhdfs3:x64-windows=fail +libhdfs3:x64-windows-static=fail +libhdfs3:x64-windows-static-md=fail +libhdfs3:x86-windows=fail +libhdfs3:x64-linux=fail +libhydrogen:arm64-windows=fail +libics:arm-uwp=fail +libics:x64-uwp=fail +libigl:arm64-windows=fail +libigl:arm-uwp=fail +libigl:x64-uwp=fail +libirecovery:x64-windows-static-md=fail +liblemon:arm-uwp=fail +liblemon:x64-uwp=fail +liblo:arm-uwp=fail +liblo:x64-linux=fail +liblo:x64-osx=fail +liblo:x64-uwp=fail +liblsl:arm64-windows=fail +liblsl:arm-uwp=fail +liblsl:x64-uwp=fail +libmad:arm-uwp=fail +libmad:x64-uwp=fail +libmagic:x86-windows=fail +libmagic:x64-windows=fail +libmagic:x64-windows-static=fail +libmagic:x64-windows-static-md=fail +libmagic:x64-uwp=fail +libmagic:arm64-windows=fail +libmagic:arm-uwp=fail +libmariadb:arm64-windows = skip +libmariadb:arm-uwp = skip +libmariadb:x64-linux = skip +libmariadb:x64-osx = skip +libmariadb:x64-uwp = skip +libmariadb:x64-windows = skip +libmariadb:x64-windows-static = skip +libmariadb:x64-windows-static-md=skip +libmariadb:x86-windows = skip +# libmesh installs tons of problematic files that conflict with other ports (boost, eigen, etc) +libmesh:arm64-windows=skip +libmesh:arm-uwp=skip +libmesh:x64-uwp=skip +libmesh:x64-windows=skip +libmesh:x64-windows-static=skip +libmesh:x64-windows-static-md=skip +libmesh:x86-windows=skip +libmesh:x64-osx=skip +libmesh:x64-linux=skip +libmodman:arm-uwp=fail +libmodman:x64-uwp=fail +libmodman:x64-windows-static=fail +libmodplug:arm-uwp=fail +libmodplug:x64-uwp=fail +libmpeg2:arm-uwp=fail +libmpeg2:x64-linux=fail +libmpeg2:x64-osx=fail +libmpeg2:x64-uwp=fail +libmupdf:x64-osx=fail +libmysql:x86-windows=fail +libmysql:arm64-windows=fail +#The official website of libnice https://nice.freedesktop.org cannot be accessed +libnice:x86-windows=skip +libnice:x64-windows=skip +libnice:x64-windows-static=skip +libnice:x64-uwp=skip +libnice:arm64-windows=skip +libnice:x64-linux=skip +libnice:x64-osx=skip +libopenmpt:x64-linux=fail +libopenmpt:x64-osx=fail +libopusenc:arm-uwp=fail +libopusenc:x64-linux=fail +libopusenc:x64-osx=fail +libopusenc:x64-uwp=fail +libosip2:x64-windows-static-md=fail +libpcap:arm64-windows=fail +libpcap:arm-uwp=fail +libpcap:x64-osx=fail +libpcap:x64-uwp=fail +libpcap:x64-windows-static=fail +libpff:arm-uwp=fail +libpff:x64-linux=fail +libpff:x64-osx=fail +libpff:x64-uwp=fail +libpff:x64-windows-static=fail +libpff:x64-windows-static-md=fail +libplist:x64-windows-static=fail +libpng-apng:arm64-windows = skip +libpng-apng:arm-uwp = skip +libpng-apng:x64-linux = skip +libpng-apng:x64-osx = skip +libpng-apng:x64-uwp = skip +libpng-apng:x64-windows = skip +libpng-apng:x64-windows-static = skip +libpng-apng:x64-windows-static-md=skip +libpng-apng:x86-windows = skip +libpq:arm-uwp=fail +libpq:x64-uwp=fail +# The developer of libqcow does not offer stable release archives +libqcow:arm-uwp=skip +libqcow:x64-uwp=skip +libqcow:x64-windows-static=skip +libqcow:x64-windows-static-md=skip +libqcow:x64-osx=skip +libqcow:x64-windows=skip +libqcow:x64-linux=skip +libqcow:x86-windows=skip +libqcow:arm64-windows=skip +librdkafka:arm-uwp=fail +librdkafka:x64-uwp=fail +# Conflicts with openssl +boringssl:arm64-windows = skip +boringssl:arm-uwp = skip +boringssl:x64-linux = skip +boringssl:x64-osx = skip +boringssl:x64-uwp = skip +boringssl:x64-windows = skip +boringssl:x64-windows-static = skip +boringssl:x64-windows-static-md=skip +boringssl:x86-windows = skip +libressl:arm64-windows = skip +libressl:arm-uwp = skip +libressl:x64-linux = skip +libressl:x64-osx = skip +libressl:x64-uwp = skip +libressl:x64-windows = skip +libressl:x64-windows-static = skip +libressl:x64-windows-static-md=skip +libressl:x86-windows = skip +libsamplerate:x64-osx=fail +libsoundio:arm64-windows=fail +libsoundio:arm-uwp=fail +libsoundio:x64-uwp=fail +libsrt:arm-uwp=fail +libsrt:x64-uwp=fail +libssh:arm64-windows=fail +libssh:arm-uwp=fail +libssh:x64-uwp=fail +libstk:arm-uwp=fail +libstk:x64-uwp=fail +libtins:arm-uwp=fail +libtins:x64-uwp=fail +libtomcrypt:arm64-windows=fail +libtomcrypt:arm-uwp=fail +libudis86:arm-uwp=fail +libudis86:x64-linux=fail +libudis86:x64-osx=fail +libudis86:x64-uwp=fail +libudns:arm64-windows=fail +libudns:arm-uwp=fail +libudns:x64-uwp=fail +libudns:x64-windows=fail +libudns:x64-windows-static=fail +libudns:x64-windows-static-md=fail +libudns:x86-windows=fail +libudns:x64-osx=fail +libui:arm-uwp=fail +libui:x64-linux=fail +libui:x64-uwp=fail +libusb:arm-uwp=fail +libusb:x64-uwp=fail +libusbmuxd:arm-uwp=fail +libusbmuxd:x64-uwp=fail +libusbmuxd:x64-linux=fail +libusbmuxd:x64-osx=fail +libusb-win32:arm-uwp=fail +libusb-win32:x64-linux=fail +libusb-win32:x64-osx=fail +libusb-win32:x64-uwp=fail +libuuid:arm64-windows=fail +libuuid:arm-uwp=fail + +# Causes build failures in vxl and podofo on osx +# Conflicts with Darwin kernel sdk uuid.h (has missing definitions) +libuuid:x64-osx = skip +libuuid:x64-uwp=fail +libuuid:x64-windows=fail +libuuid:x64-windows-static=fail +libuuid:x64-windows-static-md=fail +libuuid:x86-windows=fail +libuv:arm-uwp=fail +libuv:x64-uwp=fail +libvmdk:arm-uwp=fail +libvmdk:x64-uwp=fail +#Skip detection to avoid upstream remove older releases +libvmdk:x86-windows=skip +libvmdk:x64-windows=skip +libvmdk:x64-windows-static=skip +libvmdk:x64-windows-static-md=skip +libvmdk:arm64=skip +libvmdk:x64-linux=skip +libvmdk:x64-osx=skip +libwandio:x86-windows=fail +libwandio:x64-windows=fail +libwandio:x64-windows-static=fail +libwandio:x64-windows-static-md=fail +libwandio:x64-uwp=fail +libwandio:arm64-windows=fail +libwandio:arm-uwp=fail +libxmp-lite:x64-linux=fail +libxmp-lite:x64-osx=fail +libyuv:arm-uwp=fail +libyuv:x64-uwp=fail +licensepp:arm-uwp=fail +licensepp:x64-uwp=fail +linenoise-ng:arm-uwp=fail +linenoise-ng:x64-uwp=fail +live555:arm64-windows=fail +live555:arm-uwp=fail +live555:x64-linux=fail +live555:x64-osx=fail +live555:x64-uwp=fail +live555:x64-windows=fail +live555:x64-windows-static=fail +live555:x64-windows-static-md=fail +live555:x86-windows=fail +llgl:arm-uwp=fail +llgl:x64-uwp=fail +llvm:arm-uwp=fail +llvm:arm64-windows=fail +llvm:x64-uwp=fail +lmdb:arm-uwp=fail +lmdb:x64-uwp=fail +# Conflict with loadpng-c +lodepng:arm64-windows = skip +lodepng:arm-uwp = skip +lodepng:x64-linux = skip +lodepng:x64-osx = skip +lodepng:x64-uwp = skip +lodepng:x64-windows = skip +lodepng:x64-windows-static = skip +lodepng:x64-windows-static-md=skip +lodepng:x86-windows = skip +log4cplus:arm-uwp=fail +log4cplus:x64-uwp=fail +log4cxx:arm-uwp=fail +log4cxx:x64-uwp=fail +lua:arm-uwp=fail +lua:x64-uwp=fail +luajit:arm64-windows = skip +luajit:arm-uwp = skip +luajit:x64-linux = skip +luajit:x64-osx = skip +luajit:x64-uwp = skip +luajit:x64-windows = skip +luajit:x64-windows-static = skip +luajit:x64-windows-static-md=skip +luajit:x86-windows = skip +luasocket:x64-linux=fail +luasocket:x64-osx=fail +lzfse:arm-uwp=fail +magnum:arm64-windows=skip +marble:x64-windows-static=fail +marble:x64-windows-static-md=fail +marble:arm64-windows=fail +marble:arm-uwp=fail +marble:x64-linux=fail +marble:x64-osx=fail +marble:x86-windows=fail +marl:arm-uwp=fail +marl:x64-uwp=fail +mathgl:x64-osx=fail +mathgl:x64-uwp=fail +matio:x64-linux=fail +matio:x64-osx=fail +mdnsresponder:arm64-windows=fail +mdnsresponder:arm-uwp=fail +mdnsresponder:x64-linux=fail +mdnsresponder:x64-osx=fail +mdnsresponder:x64-uwp=fail +mecab:arm64-windows = skip +mecab:arm-uwp = skip +mecab:x64-linux = skip +mecab:x64-uwp = skip +mecab:x64-windows = skip +mecab:x64-windows-static = skip +mecab:x64-windows-static-md=skip +mecab:x86-windows = skip +memorymodule:arm-uwp=fail +memorymodule:x64-linux=fail +memorymodule:x64-osx=fail +memorymodule:x64-uwp=fail +# Due to static crt. +mesa:x64-windows-static=fail +# Missing dependent libraries. +mesa:x64-linux=fail +mesa:x64-osx=fail +meschach:arm-uwp=fail +meschach:x64-linux=fail +meschach:x64-osx=fail +meschach:x64-uwp=fail +metis:arm-uwp=fail +metis:x64-uwp=fail +mfl:x64-linux=skip +mhook:arm64-windows=fail +mhook:arm-uwp=fail +mhook:x64-linux=fail +mhook:x64-osx=fail +mhook:x64-uwp=fail +milerius-sfml-imgui:x64-osx=fail +milerius-sfml-imgui:x64-windows-static=fail +minhook:arm64-windows=fail +minhook:arm-uwp=fail +minhook:x64-linux=fail +minhook:x64-osx=fail +minhook:x64-uwp=fail +minifb:arm-uwp=fail +minifb:x64-uwp=fail +minisat-master-keying:arm-uwp=fail +minisat-master-keying:x64-uwp=fail +miniupnpc:arm-uwp=fail +miniupnpc:x64-uwp=fail +minizip:arm-uwp=fail +minizip:x64-uwp=fail +# Conflicts with signalrclient +microsoft-signalr:arm64-windows=skip +microsoft-signalr:arm-uwp=skip +microsoft-signalr:x64-linux=skip +microsoft-signalr:x64-osx=skip +microsoft-signalr:x64-uwp=skip +microsoft-signalr:x64-windows=skip +microsoft-signalr:x64-windows-static=skip +microsoft-signalr:x64-windows-static-md=skip +microsoft-signalr:x86-windows=skip +mman:x64-linux=fail +mman:x64-osx=fail +mmloader:arm64-windows=fail +mmloader:arm-uwp=fail +mmloader:x64-linux=fail +mmloader:x64-osx=fail +mmloader:x64-uwp=fail +mmloader:x64-windows=fail +mmloader:x86-windows=fail +# mmx installs many problematic headers, such as `json.h` and `sched.h` +mmx:x64-windows=skip +mmx:x64-windows-static=skip +mmx:x64-windows-static-md=skip +mmx:x86-windows=skip +mmx:x64-linux=skip +mmx:x64-osx=skip +mmx:arm-uwp=skip +mmx:x64-uwp=skip +mmx:arm64-windows=skip +# Flaky strange linker error +mongo-c-driver:x64-osx=skip +mongoose:arm-uwp=fail +mongoose:x64-uwp=fail +monkeys-audio:arm64-windows=fail +monkeys-audio:arm-uwp=fail +monkeys-audio:x64-linux=fail +monkeys-audio:x64-osx=fail +monkeys-audio:x64-uwp=fail +monkeys-audio:x64-windows-static=fail +moos-core:arm-uwp=fail +moos-core:x64-uwp=fail +moos-core:x64-windows-static=fail +moos-essential:arm64-windows=fail +moos-essential:x64-windows-static-md=fail +moos-essential:x64-windows=fail +moos-essential:x86-windows=fail +# Conflicts with libjpeg-turbo +mozjpeg:arm64-windows = skip +mozjpeg:arm-uwp = skip +mozjpeg:x64-linux = skip +mozjpeg:x64-osx = skip +mozjpeg:x64-uwp = skip +mozjpeg:x64-windows = skip +mozjpeg:x64-windows-static = skip +mozjpeg:x64-windows-static-md=skip +mozjpeg:x86-windows = skip +# mpir conflicts with gmp +# see https://github.com/microsoft/vcpkg/issues/11756 +mpir:x86-windows=skip +mpir:x64-windows=skip +mpir:x64-windows-static=skip +mpir:x64-windows-static-md=skip +mpir:arm64-windows=skip +mpir:x64-osx=skip +mpir:x64-linux=skip +mpfr:x64-osx=fail +mpfr:x64-linux=fail +msix:x64-linux=fail +msix:x64-osx=fail +msix:x64-windows-static=fail +msmpi:arm64-windows=fail +msmpi:arm-uwp=fail +msmpi:x64-linux=fail +msmpi:x64-osx=fail +msmpi:x64-uwp=fail +munit:arm-uwp=fail +munit:arm64-windows=fail +munit:x64-uwp=fail +murmurhash:arm-uwp=fail +murmurhash:x64-uwp=fail +murmurhash:arm64-windows=fail +nana:arm-uwp=fail +nana:x64-linux=fail +nana:x64-osx=fail +nana:x64-uwp=fail +nanodbc:arm-uwp=fail +nanodbc:x64-uwp=fail +nanodbc:x64-linux=skip +nanorange:arm64-windows=fail +nanorange:arm-uwp=fail +nanorange:x64-linux=fail +nanorange:x64-osx=fail +nanorange:x64-uwp=fail +nanorange:x64-windows=fail +nanorange:x64-windows-static=fail +nanorange:x64-windows-static-md=fail +nanorange:x86-windows=fail +nanovg:arm-uwp=fail +nanovg:x64-uwp=fail +nativefiledialog:arm-uwp=fail +nativefiledialog:x64-uwp=fail +nethost:x64-uwp=fail +nethost:arm-uwp=fail +nettle:x64-windows-static=skip +nettle:x64-windows-static-md=skip +nettle:x64-windows=skip +ngspice:x64-windows-static=fail +nng:arm-uwp=fail +nng:x64-uwp=fail +nrf-ble-driver:arm-uwp=fail +nrf-ble-driver:x64-uwp=fail +numactl:arm64-windows=fail +numactl:arm-uwp=fail +numactl:x64-osx=fail +numactl:x64-uwp=fail +numactl:x64-windows=fail +numactl:x64-windows-static=fail +numactl:x64-windows-static-md=fail +numactl:x86-windows=fail +nvtt:arm64-windows=fail +nvtt:arm-uwp=fail +nvtt:x64-uwp=fail +ocilib:arm-uwp=fail +ocilib:arm64-windows=fail +ocilib:x64-uwp=fail +ocilib:x64-windows-static=fail +ocilib:x64-windows-static-md=fail +octomap:arm-uwp=fail +octomap:x64-uwp=fail +ode:arm64-windows=fail +ode:arm-uwp=fail +ode:x64-uwp=fail +offscale-libetcd-cpp:arm64-windows=fail +offscale-libetcd-cpp:arm-uwp=fail +offscale-libetcd-cpp:x64-uwp=fail +ogdf:arm64-windows = skip +ogdf:arm-uwp = skip +ogdf:x64-osx=fail +ogdf:x64-uwp = skip +ogdf:x64-windows = skip +ogdf:x64-windows-static = skip +ogdf:x64-windows-static-md=skip +ogdf:x86-windows = skip +ogre:x64-osx=fail +# Conflicts with ogre +ogre-next:arm64-windows = skip +ogre-next:arm-uwp = skip +ogre-next:x64-osx = skip +ogre-next:x64-linux = skip +ogre-next:x64-uwp = skip +ogre-next:x64-windows = skip +ogre-next:x64-windows-static = skip +ogre-next:x64-windows-static-md=skip +ogre-next:x86-windows = skip +ois:arm64-windows=fail +ois:arm-uwp=fail +ois:x64-uwp=fail +# ompl is vulnerable to some form of race in its dependent ports, and adding 'ode' as a dependency +# does not resolve the issue +# src/ompl/CMakeFiles/ompl.dir/extensions/ode/src/OpenDEStateValidityChecker.cpp.o +# -L/mnt/vcpkg-ci/packages/flann_x64-linux/debug/lib -L/mnt/vcpkg-ci/packages/ode_x64-linux/debug/lib +# -Wl,-rpath,/mnt/vcpkg-ci/packages/flann_x64-linux/debug/lib:/mnt/vcpkg-ci/packages/ode_x64-linux/debug/lib:::::::::::::::::::::::::::::::::::::::::::::::: +# -lode /mnt/vcpkg-ci/installed/x64-linux/debug/lib/libboost_serialization.a +# /mnt/vcpkg-ci/installed/x64-linux/debug/lib/libboost_filesystem.a +# /mnt/vcpkg-ci/installed/x64-linux/debug/lib/libboost_system.a -lpthread && : +# /usr/bin/ld: cannot find -lode +ompl:x64-osx=fail +ompl:x64-linux=fail +open62541:arm-uwp=fail +open62541:x64-uwp=fail +openal-soft:arm-uwp=fail +openal-soft:x64-uwp=fail +openblas:arm64-windows=fail +openblas:arm-uwp=fail +# opencc/deps/rapidjson-1.1.0/rapidjson.h: Unknown machine endianess detected +opencc:arm64-windows=fail +# opencc/deps/marisa-0.2.5/lib/marisa/grimoire/io/mapper.cc currently doesn't support UWP. +opencc:arm-uwp=fail +opencc:x64-uwp=fail +opencensus-cpp:arm64-windows=fail +opencensus-cpp:x64-windows=fail +opencensus-cpp:x64-windows-static=fail +opencensus-cpp:x64-windows-static-md=fail +opencensus-cpp:x86-windows=fail +opencensus-cpp:x64-uwp=fail +opencl:arm-uwp=fail +opencl:x64-uwp=fail +opencsg:x64-uwp=fail +opencv2:arm64-windows = skip +opencv2:arm-uwp = skip +opencv2:x64-linux = skip +opencv2:x64-osx = skip +opencv2:x64-uwp = skip +opencv2:x64-windows = skip +opencv2:x64-windows-static = skip +opencv2:x64-windows-static-md=skip +opencv2:x86-windows = skip +opencv3:arm64-windows = skip +opencv3:arm-uwp = skip +opencv3:x64-linux = skip +opencv3:x64-osx = skip +opencv3:x64-uwp = skip +opencv3:x64-windows = skip +opencv3:x64-windows-static = skip +opencv3:x64-windows-static-md=skip +opencv3:x86-windows = skip +opendnp3:x64-uwp=fail +opendnp3:arm-uwp=fail +openexr:arm64-windows=fail +openexr:arm-uwp=fail +openexr:x64-uwp=fail +opengl:arm64-windows=fail +opengl:arm-uwp=fail +openmama:x64-windows-static-md=fail +openmesh:arm64-windows=fail +openmesh:arm-uwp=fail +openmesh:x64-uwp=fail +openmpi:arm64-windows=fail +openmpi:arm-uwp=fail +openmpi:x64-uwp=fail +openmpi:x64-windows=fail +openmpi:x64-windows-static=fail +openmpi:x64-windows-static-md=fail +openmpi:x86-windows=fail +openni2:x64-uwp=fail +openni2:x64-windows-static=fail +openscap:x64-linux=fail +openscap:x64-osx=fail +openssl-unix:arm64-windows=fail +openssl-unix:arm-uwp=fail +openssl-unix:x64-uwp=fail +openssl-unix:x64-windows=fail +openssl-unix:x64-windows-static=fail +openssl-unix:x64-windows-static-md=fail +openssl-unix:x86-windows=fail +openssl-uwp:arm64-windows=fail +openssl-uwp:x64-linux=fail +openssl-uwp:x64-osx=fail +openssl-uwp:x64-windows=fail +openssl-uwp:x64-windows-static=fail +openssl-uwp:x64-windows-static-md=fail +openssl-uwp:x86-windows=fail +opentracing:arm-uwp=fail +opentracing:x64-uwp=fail +openvpn3:x64-osx=fail +openvr:arm64-windows=fail +openvr:arm-uwp=fail +openvr:x64-osx=fail +openvr:x64-uwp=fail +openvr:x64-windows-static=fail +openxr-loader:arm64-windows=fail +openxr-loader:arm-uwp=fail +openxr-loader:x64-osx=fail +openxr-loader:x64-uwp=fail +optional-bare:arm64-windows = skip +optional-bare:arm-uwp = skip +optional-bare:x64-linux = skip +optional-bare:x64-osx = skip +optional-bare:x64-uwp = skip +optional-bare:x64-windows = skip +optional-bare:x64-windows-static = skip +optional-bare:x64-windows-static-md=skip +optional-bare:x86-windows = skip +opusfile:arm-uwp=fail +opusfile:x64-uwp=fail +orocos-kdl:arm-uwp=fail +orocos-kdl:x64-uwp=fail +paho-mqtt:arm-uwp=fail +paho-mqtt:x64-uwp=fail +pangomm:arm64-windows=fail +pdal:x64-linux=fail +pdal:x64-osx=fail +pdal-c:x64-windows-static=fail +pdal-c:x64-windows-static-md=fail +pdcurses:arm-uwp=fail +pdcurses:x64-linux=fail +pdcurses:x64-osx=fail +pdcurses:x64-uwp=fail +pdcurses:x64-windows-static=fail +pdcurses:x64-windows-static-md=fail +pfring:arm64-windows=fail +pfring:arm-uwp=fail +pfring:x64-uwp=fail +pfring:x64-windows=fail +pfring:x64-windows-static=fail +pfring:x64-windows-static-md=fail +pfring:x86-windows=fail +pfring:x64-osx=fail +# pfring on Linux currently fails because its build scripts enable warnings as +# errors, and warnings trigger with the Linux kernel headers in the Azure images. +pfring:x64-linux=fail +physx:arm64-windows=fail +piex:x64-osx=fail +pistache:arm64-windows=fail +pistache:arm-uwp=fail +pistache:x64-osx=fail +pistache:x64-uwp=fail +pistache:x64-windows=fail +pistache:x64-windows-static=fail +pistache:x64-windows-static-md=fail +pistache:x86-windows=fail +pixel:x64-uwp=fail +pixel:x64-windows=fail +pixel:x64-windows-static=fail +pixel:x64-windows-static-md=fail +pixel:x86-windows=fail +pixman:arm-uwp=fail +platform-folders:arm-uwp=fail +platform-folders:x64-uwp=fail +plib:arm-uwp=fail +plib:x64-osx=fail +plib:x64-uwp=fail +plibsys:arm-uwp=fail +plibsys:x64-uwp=fail +plplot:arm64-windows=fail +plplot:arm-uwp=fail +plplot:x64-uwp=fail +pmdk:arm-uwp=fail +pmdk:arm64-windows=fail +pmdk:x64-linux=fail +pmdk:x64-osx=fail +pmdk:x64-uwp=fail +pmdk:x64-windows-static=fail +pmdk:x86-windows=fail +pngwriter:arm-uwp=fail +pngwriter:x64-uwp=fail +popsift:x64-windows-static-md=fail +portable-snippets:arm-uwp=fail +pqp:arm-uwp=fail +pqp:x64-uwp=fail +proj4:arm64-windows=fail +proj4:arm-uwp=fail +proj4:x64-uwp=fail +protobuf-c:x86-windows=fail +protobuf-c:x64-windows=fail +protobuf-c:x64-windows-static=fail +protobuf-c:x64-windows-static-md=fail +protobuf-c:x64-uwp=fail +protobuf-c:arm64-windows=fail +protobuf-c:arm-uwp=fail +python2:arm64-windows=fail +python2:arm-uwp=fail +python2:x64-linux=fail +python2:x64-osx=fail +python2:x64-uwp=fail +qhull:x64-uwp=fail +qhull:arm-uwp=fail +qpid-proton:arm-uwp=fail +qpid-proton:x64-uwp=fail +qpid-proton:x64-windows-static=fail +qt5-activeqt:x64-linux=fail +qt5-activeqt:x64-osx=fail +qt5-base:arm64-windows=fail +# Skip deprecated Qt module +# (remnove after 1 year or longer due to vcpkg upgrade not handling removed ports correctly) +qt5-canvas3d:x64-linux=skip +qt5-canvas3d:x64-osx=skip +qt5-canvas3d:x64-windows=skip +qt5-canvas3d:x64-windows-static=skip +qt5-canvas3d:x64-windows-static-md=skip +qt5-canvas3d:x86-windows=skip +qt5-macextras:x64-linux=fail +qt5-macextras:x64-windows=fail +qt5-macextras:x64-windows-static=fail +qt5-macextras:x64-windows-static-md=fail +qt5-macextras:x86-windows=fail +# Missing system libraries +qt5-wayland:x64-osx=fail +# Missing libraries +qt5-wayland:x86-windows=fail +qt5-wayland:x64-windows=fail +qt5-wayland:x64-windows-static=fail +qt5-wayland:x64-windows-static-md=fail +qt5-winextras:x64-linux=fail +qt5-winextras:x64-osx=fail +# Missing prerequisites for CI success +qt5-webengine:x64-linux=fail +qt5-webengine:x64-osx=fail +# Fail due to outdated protoc headers. +# D:\buildtrees\qt5-webengine\x64-windows-dbg\src\core\debug\gen\net/third_party/quiche/src/quic/core/proto/cached_network_parameters.pb.h(17): +# fatal error C1189: #error: This file was generated by an older version of protoc which is +# Succesful built requires protobuf to be installed after qt5-webengine not before. Otherwise the build picks up the wrong headers from inside vcpkg. +qt5-webengine:x64-windows=skip +qt5-webengine:x86-windows=skip +# Static builds of qt5-webengine are not supported by the port itself +qt5-webengine:x64-windows-static=skip +qt5-webengine:x64-windows-static-md=skip +# Missing system libraries +qt5-x11extras:x64-osx=fail +# Missing libraries +qt5-x11extras:x86-windows=fail +qt5-x11extras:x64-windows=fail +qt5-x11extras:x64-windows-static=fail +qt5-x11extras:x64-windows-static-md=fail +quickfix:arm-uwp=fail +quickfix:arm64-windows=fail +quickfix:x64-uwp=fail +quickfix:x64-windows-static=fail +quickfix:x64-windows-static-md=fail +quickfix:x64-windows=fail +quickfix:x86-windows=fail +qwt:x64-osx=fail +rabit:x64-osx=fail +ragel:arm-uwp=fail +ragel:x64-uwp=fail +range-v3-vs2015:arm64-windows = skip +range-v3-vs2015:arm-uwp = skip +range-v3-vs2015:x64-linux = skip +range-v3-vs2015:x64-osx = skip +range-v3-vs2015:x64-uwp = skip +range-v3-vs2015:x64-windows = skip +range-v3-vs2015:x64-windows-static = skip +range-v3-vs2015:x64-windows-static-md=skip +range-v3-vs2015:x86-windows = skip +rapidstring:arm64-windows=fail +rapidstring:arm-uwp=fail +rapidstring:x64-linux=fail +rapidstring:x64-uwp=fail +rapidstring:x64-windows=fail +rapidstring:x64-windows-static=fail +rapidstring:x64-windows-static-md=fail +rapidstring:x86-windows=fail +raylib:arm64-windows=fail +raylib:arm-uwp=fail +raylib:x64-uwp=fail +readline:arm-uwp=fail +readline:x64-uwp=fail +readline-win32:arm-uwp=fail +readline-win32:x64-linux=fail +readline-win32:x64-osx=fail +readline-win32:x64-uwp=fail +realsense2:arm64-windows=fail +realsense2:arm-uwp=fail +realsense2:x64-uwp=fail +replxx:arm-uwp=fail +replxx:x64-uwp=fail +reproc:arm-uwp=fail +reproc:x64-uwp=fail +restbed:arm-uwp=fail +restbed:x64-uwp=fail +# file conflicts with msgpack +rest-rpc:x86-windows=skip +rest-rpc:x64-windows=skip +rest-rpc:x64-windows-static=skip +rest-rpc:x64-windows-static-md=skip +rest-rpc:x64-uwp=skip +rest-rpc:arm-uwp=skip +rest-rpc:arm64-windows=skip +rest-rpc:x64-linux=skip +rest-rpc:x64-osx=skip +rhash:arm64-windows=fail +rocksdb:arm-uwp=fail +rocksdb:x64-uwp=fail +rpclib:arm64-windows=fail +rpclib:arm-uwp=fail +rpclib:x64-uwp=fail +rsasynccpp:arm64-windows=fail +rsasynccpp:arm-uwp=fail +rsasynccpp:x64-linux=fail +rsasynccpp:x64-osx=fail +rsocket:x64-windows=fail +rsocket:x64-windows-static=fail +rsocket:x64-windows-static-md=fail +rtlsdr:x64-uwp=fail +rtlsdr:arm64-windows=fail +rtlsdr:arm-uwp=fail +rtlsdr:x64-linux=fail +rtlsdr:x64-osx=fail +rttr:arm-uwp=fail +rttr:x64-uwp=fail +rxspencer:x64-uwp=fail +rxspencer:arm-uwp=fail +ryml:arm-uwp=fail +ryml:arm64-windows=fail +ryml:x64-osx=fail +ryu:arm-uwp=fail +ryu:x64-uwp=fail +ryu:x64-windows-static=fail +ryu:x64-windows-static-md=fail +ryu:x86-windows=fail +ryu::arm64-windows=fail +sciter:arm64-windows=fail +sciter:arm-uwp=fail +sciter:x64-uwp=fail +sciter:x64-windows-static=fail +scnlib:arm-uwp=fail +scnlib:x64-uwp=fail +scylla-wrapper:arm-uwp=fail +scylla-wrapper:x64-linux=fail +scylla-wrapper:x64-osx=fail +scylla-wrapper:x64-uwp=fail +scylla-wrapper:x64-windows-static=fail +sdformat10:x64-windows-static-md=fail +sdformat6:arm-uwp=fail +sdformat6:arm64-windows=fail +sdformat6:x64-uwp=fail +sdformat6:x64-windows-static-md=fail +sdformat9:arm-uwp=fail +sdformat9:x64-linux=fail +sdformat9:x64-uwp=fail +sdformat9:x64-windows-static-md=fail +sdl1:arm-uwp=fail +sdl1:x64-uwp=fail +sdl1:x64-osx=fail +sdl2-image:arm-uwp=fail +sdl2-image:x64-uwp=fail +sdl2-mixer:arm-uwp=fail +sdl2-mixer:x64-uwp=fail +sdl2-net:arm-uwp=fail +sdl2-net:x64-uwp=fail +# https://github.com/microsoft/vcpkg/issues/10918 +seal:arm-uwp=fail +seal:x64-uwp=fail +sentencepiece:arm64-windows=fail +sentencepiece:arm-uwp=fail +sentencepiece:x64-uwp=fail +sentencepiece:x64-windows=fail +sentencepiece:x86-windows=fail +septag-sx:arm64-windows=fail +septag-sx:arm-uwp=fail +septag-sx:x64-uwp=fail +sfml:arm64-windows=fail +shapelib:arm-uwp=fail +shapelib:x64-uwp=fail +shiva:x64-windows-static=fail +shiva:x64-windows-static-md=fail +shiva-sfml:x64-linux=fail +shiva-sfml:x64-osx=fail +shiva-sfml:x86-windows=fail +shiva-sfml:x64-windows=fail +shogun:arm64-windows = skip +shogun:arm-uwp = skip +shogun:x64-osx = skip +shogun:x64-uwp = skip +shogun:x64-windows = skip +shogun:x64-windows-static = skip +shogun:x64-windows-static-md=skip +shogun:x86-windows = skip +signalrclient:x64-uwp=fail +signalrclient:arm-uwp=fail +skia:arm64-windows=fail +skia:arm-uwp=fail +skia:x64-linux=fail +skia:x64-uwp=fail +skia:x86-windows=fail +slikenet:arm-uwp=fail +slikenet:x64-uwp=fail +smpeg2:arm-uwp=fail +smpeg2:x64-linux=fail +smpeg2:x64-uwp=fail +soci:arm-uwp=fail +soci:x64-uwp=fail +sockpp:arm-uwp=fail +sockpp:x64-uwp=fail +soem:x64-uwp=fail +soem:arm-uwp=fail +soil2:arm-uwp=fail +soil2:x64-uwp=fail +soqt:arm64-windows=fail +soqt:arm-uwp=fail +soqt:x64-uwp=fail +soundtouch:arm-uwp=fail +soundtouch:x64-uwp=fail +soundtouch:x64-windows-static=fail +spaceland:arm64-windows=fail +spaceland:arm-uwp=fail +spaceland:x64-uwp=fail +spdk:x64-linux=fail +spdk-dpdk:arm64-windows=fail +spdk-dpdk:arm-uwp=fail +spdk-dpdk:x64-osx=fail +spdk-dpdk:x64-uwp=fail +spdk-dpdk:x64-windows=fail +spdk-dpdk:x64-windows-static=fail +spdk-dpdk:x64-windows-static-md=fail +spdk-dpdk:x86-windows=fail +spdk-ipsec:arm64-windows=fail +spdk-ipsec:arm-uwp=fail +spdk-ipsec:x64-osx=fail +spdk-ipsec:x64-uwp=fail +spdk-ipsec:x64-windows=fail +spdk-ipsec:x64-windows-static=fail +spdk-ipsec:x64-windows-static-md=fail +spdk-ipsec:x86-windows=fail +spdk-isal:arm64-windows=fail +spdk-isal:arm-uwp=fail +spdk-isal:x64-osx=fail +spdk-isal:x64-uwp=fail +spdk-isal:x64-windows=fail +spdk-isal:x64-windows-static=fail +spdk-isal:x64-windows-static-md=fail +spdk-isal:x86-windows=fail +spirv-tools:arm-uwp=fail +spirv-tools:x64-uwp=fail +stormlib:arm-uwp=fail +stormlib:x64-uwp=fail +stxxl:arm-uwp=fail +stxxl:x64-uwp=fail +# upstream issue https://github.com/stxxl/stxxl/issues/99 +stxxl:x86-windows=skip +stxxl:x64-windows=skip +stxxl:x64-windows-static=skip +stxxl:x64-windows-static-md=skip +symengine:arm64-windows=fail +symengine:arm-uwp=fail +systemc:arm64-windows=fail +systemc:arm-uwp=fail +systemc:x64-uwp=fail +tbb:arm64-windows=fail +tbb:arm-uwp=fail +tbb:x64-uwp=fail +tcl:arm-uwp=fail +tcl:arm64-windows=fail +tcl:x64-uwp=fail +teemo:x64-uwp=fail +teemo:arm-uwp=fail +teemo:arm64-windows=fail +teemo:x64-osx=fail +telnetpp:arm-uwp=fail +telnetpp:x64-uwp=fail +tfhe:x86-windows=fail +tfhe:x64-windows=fail +tfhe:x64-windows-static=fail +tfhe:x64-windows-static-md=fail +tfhe:x64-uwp=fail +tfhe:arm64-windows=fail +tfhe:arm-uwp=fail +theia:arm64-windows = skip +theia:arm-uwp = skip +theia:x64-uwp = skip +theia:x64-windows = skip +theia:x64-windows-static = skip +theia:x64-windows-static-md=skip +theia:x86-windows = skip +thor:x64-linux=fail +thor:x64-osx=fail +tidy-html5:arm-uwp=fail +tidy-html5:x64-uwp=fail +tinkerforge:arm-uwp=fail +tinkerforge:x64-uwp=fail +tinyexif:arm-uwp=fail +tinyexif:x64-uwp=fail +tinyfiledialogs:arm-uwp=fail +tinyfiledialogs:x64-uwp=fail +tiny-process-library:arm-uwp=fail +tiny-process-library:x64-uwp=fail +tmxlite:arm-uwp=fail +tmxlite:x64-uwp=fail +tmxparser:arm64-windows=fail +tmxparser:arm-uwp=fail +tmxparser:x64-uwp=fail +tmxparser:x64-windows=fail +tmxparser:x64-windows-static=fail +tmxparser:x64-windows-static-md=fail +tmxparser:x86-windows=fail +torch-th:arm64-windows=fail +torch-th:arm-uwp=fail +torch-th:x64-uwp=fail +torch-th:x64-windows-static=fail +tre:x64-osx=fail +treehopper:x64-windows-static=fail +treehopper:x64-linux=fail +turbobase64:arm64-windows=fail +turbobase64:arm-uwp=fail +turbobase64:x64-uwp=fail +turbobase64:x64-windows=fail +turbobase64:x64-windows-static=fail +turbobase64:x64-windows-static-md=fail +turbobase64:x86-windows=fail +unicorn:arm64-windows=fail +unicorn:arm-uwp=fail +unicorn:x64-linux=fail +unicorn:x64-osx=fail +unicorn:x64-uwp=fail +unicorn-lib:arm-uwp=fail +unicorn-lib:x64-uwp=fail +unittest-cpp:arm64-windows=fail +unittest-cpp:arm-uwp=fail +unittest-cpp:x64-uwp=fail +unixodbc:arm64-windows=fail +unixodbc:arm-uwp=fail +unixodbc:x64-uwp=fail +unixodbc:x64-windows=fail +unixodbc:x64-windows-static=fail +unixodbc:x64-windows-static-md=fail +unixodbc:x86-windows=fail +unrar:arm64-windows=fail +unrar:arm-uwp=fail +unrar:x64-linux=fail +unrar:x64-osx=fail +unrar:x64-uwp=fail +unrar:x64-windows-static=fail +urdfdom:x64-windows-static=fail +usd:x86-windows=fail +uthenticode:arm-uwp=fail +uthenticode:x64-uwp=fail +v8:arm64-windows=fail +v8:arm-uwp=fail +v8:x64-osx=fail +v8:x64-uwp=fail +vectorclass:arm64-windows=fail +vectorclass:arm-uwp=fail +vlpp:x64-osx=fail +vulkan:arm64-windows=fail +vulkan:arm-uwp=fail +vulkan:x64-linux=fail +vulkan:x64-osx=fail +vulkan:x64-uwp=fail +vulkan:x64-windows=fail +vulkan:x64-windows-static=fail +vulkan:x64-windows-static-md=fail +vulkan:x86-windows=fail +# Conflicts with latest openjpeg port (vxl ships with an old version of openjpeg) +# conflicts with qt5-location +vxl:arm64-windows = skip +vxl:arm-uwp = skip +vxl:x64-linux = skip +vxl:x64-osx = skip +vxl:x64-uwp = skip +vxl:x64-windows = skip +vxl:x64-windows-static = skip +vxl:x64-windows-static-md=skip +vxl:x86-windows = skip +wampcc:arm64-windows=fail +wildmidi:x64-osx=fail +wincrypt:x64-linux=fail +wincrypt:x64-osx=fail +winpcap:arm64-windows = skip +winpcap:arm-uwp = skip +winpcap:x64-linux=fail +winpcap:x64-osx=fail +winpcap:x64-uwp = skip +winpcap:x64-windows = skip +winpcap:x64-windows-static = skip +winpcap:x64-windows-static-md=skip +winpcap:x86-windows = skip +winreg:x64-linux=fail +winreg:x64-osx=fail +winsock2:x64-linux=fail +winsock2:x64-osx=fail +wintoast:arm-uwp=fail +wintoast:x64-linux=fail +wintoast:x64-osx=fail +wintoast:x64-uwp=fail +wpilib:arm64-windows=fail +wpilib:x64-osx=fail +wxchartdir:x64-osx=fail +wxwidgets:x64-linux=fail +x265:arm64-windows=fail +x265:arm-uwp=fail +x265:x64-uwp=fail +xalan-c:x64-windows-static=fail +xalan-c:arm64-windows=fail +xbyak:arm64-windows=fail +xbyak:arm-uwp=fail +xbyak:x64-uwp=fail +xerces-c:arm-uwp=fail +xerces-c:x64-uwp=fail +xmlsec:arm-uwp=fail +xmlsec:x64-uwp=fail +# The xmsh upstream repository is gone, if we find no replacement before +# 2021-01-01 we will remove the port outright. +xmsh:arm-uwp=skip +xmsh:arm64-windows=skip +xmsh:x64-linux=skip +xmsh:x64-osx=skip +xmsh:x64-uwp=skip +xmsh:x64-windows-static=skip +xmsh:x64-windows-static-md=skip +xmsh:x64-windows=skip +xmsh:x86-windows=skip +yajl:arm-uwp=fail +yajl:x64-uwp=fail +yara:arm-uwp=fail +yara:x64-uwp=fail +yasm:arm64-windows=fail +yasm:arm-uwp=fail +yasm:x64-linux=fail +yasm:x64-osx=fail +yasm:x64-uwp=fail +yato:arm64-windows=fail +yato:arm-uwp=fail +yato:x64-uwp=fail +z3:arm64-windows=fail +z3:arm-uwp=fail +z3:x64-uwp=fail +zeromq:arm64-windows=fail +zeromq:arm-uwp=fail +zeromq:x64-uwp=fail +zkpp:x86-windows=fail +zkpp:x64-windows=fail +zkpp:x64-windows-static=fail +zkpp:x64-windows-static-md=fail +zkpp:arm64-windows=fail +zkpp:x64-uwp=fail +zkpp:arm-uwp=fail +c4core:arm-uwp=fail +c4core:arm64-windows=fail +c4core:x64-osx=fail + +# Official downloading server of CTP library is only guaranteed to be available during trading hours of China futures market +# Skip CI to avoid random failures +ctp:arm64-windows=skip +ctp:arm-uwp=skip +ctp:x64-linux=skip +ctp:x64-osx=skip +ctp:x64-uwp=skip +ctp:x64-windows=skip +ctp:x64-windows-static=skip +ctp:x64-windows-static-md=skip +ctp:x86-windows=skip +protozero:arm-uwp=fail +protozero:x64-uwp=fail + +# clapack is replaced by lapack-reference on the platforms lapack-reference supports +clapack:x64-linux=skip +clapack:x64-osx=skip +clapack:x64-windows-static=skip +clapack:x64-windows-static-md=skip +clapack:x64-windows=skip +clapack:x86-windows=skip +clapack:x64-uwp=skip +lapack-reference:arm64-windows=skip +lapack-reference:arm-uwp=skip + +# failures for x64-windows-static-md +ace:x64-windows-static-md=fail +activemq-cpp:x64-windows-static-md=fail +akali:x64-windows-static-md=fail +chromium-base:x64-windows-static-md=fail +clockutils:x64-windows-static-md=fail +fastcgi:x64-windows-static-md=fail +fontconfig:x64-windows-static-md=fail +gmp:x64-windows-static-md=fail +ijg-libjpeg:x64-windows-static-md=fail +keystone:x64-windows-static-md=fail +libcerf:x64-windows-static-md=fail +libgo:x64-windows-static-md=fail +libmicrohttpd:x64-windows-static-md=fail +libspatialite:x64-windows-static-md=fail +linenoise-ng:x64-windows-static-md=fail +mmloader:x64-windows-static-md=fail +mpg123:x64-windows-static-md=fail +netcdf-cxx4:x64-windows-static-md=fail +open62541:x64-windows-static-md=fail +openscap:x64-windows-static-md=fail +portmidi:x64-windows-static-md=fail +quantlib:x64-windows-static-md=fail +readosm:x64-windows-static-md=fail +sentencepiece:x64-windows-static-md=fail +symengine:x64-windows-static-md=fail +teemo:x64-windows-static-md=fail +unicorn:x64-windows-static-md=fail +v8:x64-windows-static-md=fail +yato:x64-windows-static-md=fail +zyre:x64-windows-static-md=fail +usbmuxd:x64-windows-static-md=fail +workflow:x64-uwp=fail +workflow:arm-uwp=fail + +# wangle triggers an internal compiler error +# https://devdiv.visualstudio.com/DefaultCollection/DevDiv/_workitems/edit/1269468 +wangle:x64-windows=fail +wangle:x64-windows-static=fail +wangle:x64-windows-static-md=fail + +# VS2019 version 16.9.4's project system changes where PDBs are placed in a way that breaks the +# upstream build script of this port. +# See https://developercommunity.visualstudio.com/t/Toolset-169-regression-vcxproj-producin/1356639 +dimcli:x64-windows-static-md=fail +dimcli:x64-windows-static=fail + +# cppgraphqlgen triggers an ICE on Apple Clang that comes with MacOS 11. +cppgraphqlgen:x64-osx=fail diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/execute_process.cmake b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/execute_process.cmake new file mode 100644 index 000000000..206bd95b1 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/execute_process.cmake @@ -0,0 +1,18 @@ +#[===[.md:
+# execute_process
+
+Intercepts all calls to execute_process() inside portfiles and fails when Download Mode
+is enabled.
+
+In order to execute a process in Download Mode call `vcpkg_execute_in_download_mode()` instead.
+#]===]
+
+if (NOT DEFINED Z_VCPKG_OVERRIDEN_EXECUTE_PROCESS)
+ set(Z_VCPKG_OVERRIDEN_EXECUTE_PROCESS ON)
+
+ if (DEFINED VCPKG_DOWNLOAD_MODE)
+ function(execute_process)
+ message(FATAL_ERROR "This command cannot be executed in Download Mode.\nHalting portfile execution.\n")
+ endfunction()
+ endif()
+endif()
diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_acquire_msys.cmake b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_acquire_msys.cmake new file mode 100644 index 000000000..2d7084a36 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_acquire_msys.cmake @@ -0,0 +1,542 @@ +#[===[.md: +# vcpkg_acquire_msys + +Download and prepare an MSYS2 instance. + +## Usage +```cmake +vcpkg_acquire_msys(<MSYS_ROOT_VAR> + PACKAGES <package>... + [NO_DEFAULT_PACKAGES] + [DIRECT_PACKAGES <URL> <SHA512> <URL> <SHA512> ...] +) +``` + +## Parameters +### MSYS_ROOT_VAR +An out-variable that will be set to the path to MSYS2. + +### PACKAGES +A list of packages to acquire in msys. + +To ensure a package is available: `vcpkg_acquire_msys(MSYS_ROOT PACKAGES make automake1.16)` + +### NO_DEFAULT_PACKAGES +Exclude the normal base packages. + +The list of base packages includes: bash, coreutils, sed, grep, gawk, diffutils, make, and pkg-config + +### DIRECT_PACKAGES +A list of URL/SHA512 pairs to acquire in msys. + +This parameter can be used by a port to privately extend the list of msys packages to be acquired. +The URLs can be found on the msys2 website[1] and should be a direct archive link: + + https://repo.msys2.org/mingw/i686/mingw-w64-i686-gettext-0.19.8.1-9-any.pkg.tar.zst + +[1] https://packages.msys2.org/search + +## Notes +A call to `vcpkg_acquire_msys` will usually be followed by a call to `bash.exe`: +```cmake +vcpkg_acquire_msys(MSYS_ROOT) +set(BASH ${MSYS_ROOT}/usr/bin/bash.exe) + +vcpkg_execute_required_process( + COMMAND ${BASH} --noprofile --norc "${CMAKE_CURRENT_LIST_DIR}\\build.sh" + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel + LOGNAME build-${TARGET_TRIPLET}-rel +) +``` + +## Examples + +* [ffmpeg](https://github.com/Microsoft/vcpkg/blob/master/ports/ffmpeg/portfile.cmake) +* [icu](https://github.com/Microsoft/vcpkg/blob/master/ports/icu/portfile.cmake) +* [libvpx](https://github.com/Microsoft/vcpkg/blob/master/ports/libvpx/portfile.cmake) +#]===] + +function(vcpkg_acquire_msys PATH_TO_ROOT_OUT) + # parse parameters such that semicolons in options arguments to COMMAND don't get erased + cmake_parse_arguments(PARSE_ARGV 0 _am "NO_DEFAULT_PACKAGES;Z_ALL_PACKAGES" "" "PACKAGES;DIRECT_PACKAGES") + + set(TOTAL_HASH 0) + set(ARCHIVES) + + set(PACKAGES ${_am_PACKAGES}) + + if(NOT _am_NO_DEFAULT_PACKAGES) + list(APPEND PACKAGES bash coreutils sed grep gawk diffutils make pkg-config) + endif() + + macro(msys_package_download URL SHA FILENAME) + set(URLS "${URL}") + # Mirror list from https://github.com/msys2/MSYS2-packages/blob/master/pacman-mirrors/mirrorlist.msys + # Sourceforge is not used because it does not keep older package versions + set(MIRRORS + "https://www2.futureware.at/~nickoe/msys2-mirror/" + "https://mirror.yandex.ru/mirrors/msys2/" + "https://mirrors.tuna.tsinghua.edu.cn/msys2/" + "https://mirrors.ustc.edu.cn/msys2/" + "https://mirror.bit.edu.cn/msys2/" + "https://mirror.selfnet.de/msys2/" + "https://mirrors.sjtug.sjtu.edu.cn/msys2/" + ) + + foreach(MIRROR IN LISTS MIRRORS) + string(REPLACE "https://repo.msys2.org/" "${MIRROR}" MIRROR_URL "${URL}") + list(APPEND URLS "${MIRROR_URL}") + endforeach() + vcpkg_download_distfile(MSYS_ARCHIVE + URLS ${URLS} + SHA512 "${SHA}" + FILENAME "msys-${FILENAME}" + QUIET + ) + string(APPEND TOTAL_HASH "${SHA}") + list(APPEND ARCHIVES "${MSYS_ARCHIVE}") + endmacro() + + macro(msys_package) + cmake_parse_arguments(p "ZST;ANY" "URL;NAME;SHA512;VERSION;REPO" "DEPS" ${ARGN}) + if(p_URL AND NOT p_NAME) + if(NOT p_URL MATCHES "^https://repo\\.msys2\\.org/.*/(([^-]+(-[^0-9][^-]*)*)-.+\\.pkg\\.tar\\.(xz|zst))\$") + message(FATAL_ERROR "Regex does not match supplied URL to vcpkg_acquire_msys: ${p_URL}") + endif() + set(FILENAME "${CMAKE_MATCH_1}") + set(p_NAME "${CMAKE_MATCH_2}") + else() + if(p_ZST) + set(EXT zst) + else() + set(EXT xz) + endif() + if(p_ANY) + set(ARCH any) + else() + set(ARCH x86_64) + endif() + if(NOT p_REPO) + set(p_REPO msys/x86_64) + endif() + set(FILENAME "${p_NAME}-${p_VERSION}-${ARCH}.pkg.tar.${EXT}") + set(p_URL "https://repo.msys2.org/${p_REPO}/${FILENAME}") + endif() + if("${p_NAME}" IN_LIST PACKAGES OR _am_Z_ALL_PACKAGES) + list(REMOVE_ITEM PACKAGES "${p_NAME}") + list(APPEND PACKAGES ${p_DEPS}) + msys_package_download("${p_URL}" "${p_SHA512}" "${FILENAME}") + endif() + endmacro() + + unset(N) + foreach(P IN LISTS _am_DIRECT_PACKAGES) + if(NOT DEFINED N) + set(N "${P}") + else() + get_filename_component(FILENAME "${N}" NAME) + msys_package_download("${N}" "${P}" "${FILENAME}") + unset(N) + endif() + endforeach() + if(DEFINED N) + message(FATAL_ERROR "vcpkg_acquire_msys(... DIRECT_PACKAGES ...) requires exactly pairs of URL/SHA512") + endif() + + # To add new entries, use https://packages.msys2.org/package/$PACKAGE?repo=msys + msys_package( + URL "https://repo.msys2.org/msys/x86_64/unzip-6.0-2-x86_64.pkg.tar.xz" + SHA512 b8a1e0ce6deff26939cb46267f80ada0a623b7d782e80873cea3d388b4dc3a1053b14d7565b31f70bc904bf66f66ab58ccc1cd6bfa677065de1f279dd331afb9 + DEPS libbz2 + ) + msys_package( + URL "https://repo.msys2.org/msys/x86_64/libbz2-1.0.8-2-x86_64.pkg.tar.xz" + SHA512 d128bd1792d0f5750e6a63a24db86a791e7ee457db8c0bef68d217099be4a6eef27c85caf6ad09b0bcd5b3cdac6fc0a2b9842cc58d381a4035505906cc4803ec + ) + msys_package( + URL "https://repo.msys2.org/msys/x86_64/patch-2.7.6-1-x86_64.pkg.tar.xz" + SHA512 04d06b9d5479f129f56e8290e0afe25217ffa457ec7bed3e576df08d4a85effd80d6e0ad82bd7541043100799b608a64da3c8f535f8ea173d326da6194902e8c + ) + msys_package( + URL "https://repo.msys2.org/msys/x86_64/gzip-1.10-1-x86_64.pkg.tar.xz" + SHA512 2d0a60f2c384e3b9e2bed2212867c85333545e51ee0f583a33914e488e43c265ed0017cd4430a6e3dafdca99c0414b3756a4b9cc92a6f04d5566eff8b68def75 + DEPS msys2-runtime + ) + msys_package( + URL "https://repo.msys2.org/msys/x86_64/texinfo-6.7-3-x86_64.pkg.tar.zst" + SHA512 d8bcce1a338d45a8c2350af3edee1d021a76524b767d465d3f7fd9cb03c8799d9cd3454526c10e4a2b4d58f75ae26a1a8177c50079dfdb4299129e0d45b093bc + DEPS bash perl + ) + msys_package( + URL "https://repo.msys2.org/msys/x86_64/bash-4.4.023-2-x86_64.pkg.tar.xz" + SHA512 1cf2a07022113010e00e150e7004732013a793d49e7a6ac7c2be27a0b2c0ce3366150584b9974e30df042f8876a84d6a77c1a46f0607e38ebe18f8a25f51c32d + DEPS msys2-runtime + ) + msys_package( + URL "https://repo.msys2.org/msys/x86_64/autoconf-2.69-5-any.pkg.tar.xz" + SHA512 66b9c97bd3d1dfe2a2ab576235b6b8c204a9e4c099ba14cf5d0139e564bba1e735e3b1083354b4cac8c6c42233cbdd5e1e277e32cadfe24017b94d2fbdeb5617 + DEPS m4 + ) + msys_package( + URL "https://repo.msys2.org/msys/x86_64/autoconf-archive-2019.01.06-1-any.pkg.tar.xz" + SHA512 77540d3d3644d94a52ade1f5db27b7b4b5910bbcd6995195d511378ca6d394a1dd8d606d57161c744699e6c63c5e55dfe6e8664d032cc8c650af9fdbb2db08b0 + DEPS m4 + ) + msys_package( + URL "https://repo.msys2.org/msys/x86_64/diffutils-3.7-1-x86_64.pkg.tar.xz" + SHA512 0c39837a26b2111bb6310cdfe0bc14656e3d57456ad8023f59c9386634a8f1f236915c79a57348b64c508897c73ed88d8abce2b9ac512a427e9a3956939f2040 + DEPS msys2-runtime + ) + msys_package( + URL "https://repo.msys2.org/msys/x86_64/binutils-2.34-4-x86_64.pkg.tar.zst" + SHA512 5271288d11489879082bc1f2298bb8bedbcfcf6ee19f8a9b3b552b6a4395543d9385bb833e3c32b1560bff1b411d2be503e2c12a7201bf37b85cfacc5f5baba3 + DEPS libiconv libintl + ) + msys_package( + URL "https://repo.msys2.org/msys/x86_64/libtool-2.4.6-9-x86_64.pkg.tar.xz" + SHA512 b309799e5a9d248ef66eaf11a0bd21bf4e8b9bd5c677c627ec83fa760ce9f0b54ddf1b62cbb436e641fbbde71e3b61cb71ff541d866f8ca7717a3a0dbeb00ebf + DEPS grep sed coreutils file findutils + ) + msys_package( + URL "https://repo.msys2.org/msys/x86_64/file-5.39-1-x86_64.pkg.tar.zst" + SHA512 be51dd0f6143a2f34f2a3e7d412866eb12511f25daaf3a5478240537733a67d7797a3a55a8893e5638589c06bca5af20aed5ded7db0bf19fbf52b30fae08cadd + DEPS gcc-libs zlib libbz2 + ) + msys_package( + URL "https://repo.msys2.org/msys/x86_64/zlib-1.2.11-1-x86_64.pkg.tar.xz" + SHA512 b607da40d3388b440f2a09e154f21966cd55ad77e02d47805f78a9dee5de40226225bf0b8335fdfd4b83f25ead3098e9cb974d4f202f28827f8468e30e3b790d + DEPS gcc-libs + ) + msys_package( + URL "https://repo.msys2.org/msys/x86_64/bzip2-1.0.8-2-x86_64.pkg.tar.xz" + SHA512 336f5b59eb9cf4e93b537a212509d84f72cd9b8a97bf8ac0596eff298f3c0979bdea6c605244d5913670b9d20b017e5ee327f1e606f546a88e177a03c589a636 + DEPS gcc-libs + ) + msys_package( + URL "https://repo.msys2.org/msys/x86_64/libbz2-1.0.8-2-x86_64.pkg.tar.xz" + SHA512 d128bd1792d0f5750e6a63a24db86a791e7ee457db8c0bef68d217099be4a6eef27c85caf6ad09b0bcd5b3cdac6fc0a2b9842cc58d381a4035505906cc4803ec + DEPS gcc-libs + ) + msys_package( + URL "https://repo.msys2.org/msys/x86_64/coreutils-8.32-1-x86_64.pkg.tar.xz" + SHA512 1a2ae4f296954421ce36f764b9b1c77ca72fc8583c46060b817677d0ad6adc7d7e3c2bbe1ae0179afd116a3d62f28e59eae2f7c84c1c8ffb7d22d2f2b40c0cdc + DEPS libiconv libintl gmp + ) + msys_package( + URL "https://repo.msys2.org/msys/x86_64/grep-3.0-2-x86_64.pkg.tar.xz" + SHA512 c784d5f8a929ae251f2ffaccf7ab0b3936ae9f012041e8f074826dd6077ad0a859abba19feade1e71b3289cc640626dfe827afe91c272b38a1808f228f2fdd00 + DEPS libiconv libintl libpcre + ) + msys_package( + URL "https://repo.msys2.org/msys/x86_64/sed-4.8-1-x86_64.pkg.tar.xz" + SHA512 b6e7ed0af9e04aba4992ee26d8616f7ac675c8137bb28558c049d50709afb571b33695ce21d01e5b7fe8e188c008dd2e8cbafc72a7e2a919c2d678506095132b + DEPS libintl + ) + msys_package( + URL "https://repo.msys2.org/msys/x86_64/libpcre-8.44-1-x86_64.pkg.tar.xz" + SHA512 e9e56386fc5cca0f3c36cee21eda91300d9a13a962ec2f52eeea00f131915daea1cfeb0e1b30704bf3cc4357d941d356e0d72192bab3006c2548e18cd96dad77 + DEPS gcc-libs + ) + msys_package( + URL "https://repo.msys2.org/msys/x86_64/m4-1.4.18-2-x86_64.pkg.tar.xz" + SHA512 061e9243c1e013aa093546e3872984ad47b7fc9d64d4c39dcce62e750ed632645df00be3fe382a2f55f3bf623dd0d649e2092be23e8f22f921f582e41893e36a + DEPS msys2-runtime + ) + msys_package( + URL "https://repo.msys2.org/msys/x86_64/automake-wrapper-11-1-any.pkg.tar.xz" + SHA512 0fcfc80c31fd0bda5a46c55e9100a86d2fc788a92c7e2ca4fd281e551375c62eb5b9cc9ad9338bb44a815bf0b1d1b60b882c8e68ca3ea529b442f2d03d1d3e1f + DEPS gawk + ) + msys_package( + URL "https://repo.msys2.org/msys/x86_64/gawk-5.1.0-1-x86_64.pkg.tar.xz" + SHA512 4e2be747b184f27945df6fb37d52d56fd8117d2fe4b289370bcdb5b15a4cf90cbeaea98cf9e64bcbfa2c13db50d8bd14cbd719c5f31b420842da903006dbc959 + DEPS libintl libreadline mpfr + ) + msys_package( + URL "https://repo.msys2.org/msys/x86_64/mpfr-4.1.0-1-x86_64.pkg.tar.zst" + SHA512 d64fa60e188124591d41fc097d7eb51d7ea4940bac05cdcf5eafde951ed1eaa174468f5ede03e61106e1633e3428964b34c96de76321ed8853b398fbe8c4d072 + DEPS gmp gcc-libs + ) + msys_package( + URL "https://repo.msys2.org/msys/x86_64/gmp-6.2.0-1-x86_64.pkg.tar.xz" + SHA512 1389a443e775bb255d905665dd577bef7ed71d51a8c24d118097f8119c08c4dfe67505e88ddd1e9a3764dd1d50ed8b84fa34abefa797d257e90586f0cbf54de8 + ) + msys_package( + URL "https://repo.msys2.org/msys/x86_64/xz-5.2.5-1-x86_64.pkg.tar.xz" # this seems to require immediate updating on version bumps. + SHA512 99d092c3398277e47586cead103b41e023e9432911fb7bdeafb967b826f6a57d32e58afc94c8230dad5b5ec2aef4f10d61362a6d9e410a6645cf23f076736bba + DEPS liblzma libiconv gettext + ) + msys_package( + URL "https://repo.msys2.org/msys/x86_64/liblzma-5.2.5-1-x86_64.pkg.tar.xz" + SHA512 8d5c04354fdc7309e73abce679a4369c0be3dc342de51cef9d2a932b7df6a961c8cb1f7e373b1b8b2be40343a95fbd57ac29ebef63d4a2074be1d865e28ca6ad + ) + msys_package( + URL "https://repo.msys2.org/msys/x86_64/libreadline-8.0.004-1-x86_64.pkg.tar.xz" + SHA512 42760bddedccc8d93507c1e3a7a81595dc6392b5e4319d24a85275eb04c30eb79078e4247eb2cdd00ff3884d932639130c89bf1b559310a17fa4858062491f97 + DEPS ncurses + ) + msys_package( + URL "https://repo.msys2.org/msys/x86_64/ncurses-6.2-1-x86_64.pkg.tar.xz" + SHA512 d4dc566d3dbd32e7646e328cb350689ede7eaa7008c8ed971072f8869a2986fe3935e7df1700851b52716af7ef20c49f9e6628d3163a5e9208a8872b5014eaea + DEPS msys2-runtime + ) + msys_package( + URL "https://repo.msys2.org/msys/x86_64/automake1.16-1.16.2-2-any.pkg.tar.zst" + SHA512 b837ec70fce700fc6415f1e73287911cbdf665628b63dcffac4cad1b3a3a23efeabacd950d6757567cbcc4c9cedb120e06d2a7dd5cad028434063cab936e03ae + DEPS perl + ) + msys_package( + URL "https://repo.msys2.org/msys/x86_64/automake1.15-1.15.1-2-any.pkg.tar.zst" + SHA512 aed269720344948d50965354e35d640a8db1589bb9e98d21427a3cc47a8e8dfd2a6e4828b1ca109a4010eb808bdf9a627383c302a0713efcb6ab3be1f887d930 + DEPS perl + ) + msys_package( + URL "https://repo.msys2.org/msys/x86_64/perl-5.32.0-2-x86_64.pkg.tar.zst" + SHA512 d8397c64cf9d8deb43904f705e6263b8086773a64c2feb4eb8f36921e4115fc1230267a18c0ef2ca9726fbcce6ed22125f3c7c2472042bf1279b423b2088d3df + DEPS libcrypt + ) + msys_package( + URL "https://repo.msys2.org/msys/x86_64/libcrypt-2.1-2-x86_64.pkg.tar.xz" + SHA512 59a13f79f560934f880d68209a58a3c39ee4a1d24500035bde90d7a6f6ab0d4f72fe14edea6f19a8eb54d4d53b0b6ad4589b388f1521a07ab24a0f8307619cab + DEPS gcc-libs + ) + msys_package( + URL "https://repo.msys2.org/msys/x86_64/pkg-config-0.29.2-4-x86_64.pkg.tar.zst" + SHA512 9f72c81d8095ca1c341998bc80788f7ce125770ec4252f1eb6445b9cba74db5614caf9a6cc7c0fcc2ac18d4a0f972c49b9f245c3c9c8e588126be6c72a8c1818 + DEPS libiconv + ) + msys_package( + URL "https://repo.msys2.org/msys/x86_64/make-4.3-1-x86_64.pkg.tar.xz" + SHA512 7306dec7859edc27d70a24ab4b396728481484a426c5aa2f7e9fed2635b3b25548b05b7d37a161a86a8edaa5922948bee8c99b1e8a078606e69ca48a433fe321 + DEPS libintl msys2-runtime + ) + msys_package( + URL "https://repo.msys2.org/msys/x86_64/gettext-devel-0.19.8.1-1-x86_64.pkg.tar.xz" + SHA512 648f74c23e4f92145cdd0d45ff5285c2df34e855a9e75e5463dd6646967f8cf34a18ce357c6f498a4680e6d7b84e2d1697ba9deee84da8ea6bb14bbdb594ee22 + DEPS gettext + ) + msys_package( + URL "https://repo.msys2.org/msys/x86_64/gettext-0.19.8.1-1-x86_64.pkg.tar.xz" + SHA512 c8c42d084c297746548963f7ec7a7df46241886f3e637e779811ee4a8fee6058f892082bb2658f6777cbffba2de4bcdfd68e846ba63c6a6552c9efb0c8c1de50 + DEPS libintl libgettextpo libasprintf tar + ) + msys_package( + URL "https://repo.msys2.org/msys/x86_64/tar-1.32-1-x86_64.pkg.tar.xz" + SHA512 379525f4b8a3f21d67d6506647aec8367724e1b4c896039f46845d9e834298280381e7261a87440925ee712794d43074f4ffb5e09e67a5195af810bbc107ad9a + DEPS libiconv libintl + ) + msys_package( + URL "https://repo.msys2.org/msys/x86_64/libgettextpo-0.19.8.1-1-x86_64.pkg.tar.xz" + SHA512 480b782a79b0ce71ed9939ae3a6821fc2f5a63358733965c62cee027d0e6c88e255df1d62379ee47f5a7f8ffe163e554e318dba22c67dc67469b10aa3248edf7 + DEPS gcc-libs + ) + msys_package( + URL "https://repo.msys2.org/msys/x86_64/libasprintf-0.19.8.1-1-x86_64.pkg.tar.xz" + SHA512 a2e8027b9bbee20f8cf60851130ca2af436641b1fb66054f8deba118da7ebecb1cd188224dcf08e4c5b7cde85b412efab058afef2358e843c9de8eb128ca448c + DEPS gcc-libs + ) + msys_package( + URL "https://repo.msys2.org/msys/x86_64/findutils-4.7.0-1-x86_64.pkg.tar.xz" + SHA512 fd09a24562b196ff252f4b5de86ed977280306a8c628792930812f146fcf7355f9d87434bbabe25e6cc17d8bd028f6bc68fc02e5bea83137a49cf5cc6f509e10 + DEPS libintl libiconv + ) + msys_package( + URL "https://repo.msys2.org/msys/x86_64/libintl-0.19.8.1-1-x86_64.pkg.tar.xz" + SHA512 4e54c252b828c862f376d8f5a2410ee623a43d70cbb07d0b8ac20c25096f59fb3ae8dcd011d1792bec76f0b0b9411d0e184ee23707995761dc50eb76f9fc6b92 + DEPS libiconv + ) + msys_package( + URL "https://repo.msys2.org/msys/x86_64/libiconv-1.16-2-x86_64.pkg.tar.zst" + SHA512 3ab569eca9887ef85e7dd5dbca3143d8a60f7103f370a7ecc979a58a56b0c8dcf1f54ac3df4495bc306bd44bf36ee285aaebbb221c4eebfc912cf47d347d45fc + DEPS gcc-libs + ) + msys_package( + URL "https://repo.msys2.org/msys/x86_64/gcc-libs-9.3.0-1-x86_64.pkg.tar.xz" + SHA512 2816afbf45aa0ff47f94a623ad083d9421bca5284dc55683c2f1bc09ea0eadfe720afb75aafef60c2ff6384d051c4fbe2a744bb16a20acf34c04dc59b17c3d8c + DEPS msys2-runtime + ) + msys_package( + URL "https://repo.msys2.org/msys/x86_64/msys2-runtime-3.1.6-3-x86_64.pkg.tar.xz" + SHA512 f094a7f4926195ef7ba015f0c5c56587b1faa94d85530f07aaaa5557a1494c3bd75257d4687c8401cbf1328d23e5586a92b05f0a872caebb1a7e941a07829776 + ) + + msys_package( + URL "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-python-numpy-1.19.0-1-any.pkg.tar.zst" + SHA512 15791fff23deda17a4452c9ca3f23210ed77ee20dcdd6e0c31d0e626a63aeb93d15ed814078729101f1cce96129b4b5e3c898396b003d794a52d7169dd027465 + DEPS mingw-w64-x86_64-openblas mingw-w64-x86_64-python + ) + msys_package( + URL "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-openblas-0.3.10-2-any.pkg.tar.zst" + SHA512 3cf15ef191ceb303a7e40ad98aca94c56211b245617c17682379b5606a1a76e12d04fa1a83c6109e89620200a74917bcd981380c7749dda12fa8e79f0b923877 + DEPS mingw-w64-x86_64-gcc-libgfortran mingw-w64-x86_64-gcc-libs mingw-w64-x86_64-libwinpthread + ) + msys_package( + URL "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-gcc-libgfortran-10.2.0-1-any.pkg.tar.zst" + SHA512 c2dee2957356fa51aae39d907d0cc07f966028b418f74a1ea7ea551ff001c175d86781f980c0cf994207794322dcd369fa122ab78b6c6d0f0ab01e39a754e780 + DEPS mingw-w64-x86_64-gcc-libs + ) + msys_package( + URL "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-python-3.8.5-1-any.pkg.tar.zst" + SHA512 49bbcaa9479ff95fd21b473a1bc286886b204ec3e2e0d9466322e96a9ee07ccd8116024b54b967a87e4752057004475cac5060605e87bd5057de45efe5122a25 + DEPS mingw-w64-x86_64-bzip2 mingw-w64-x86_64-expat mingw-w64-x86_64-gcc-libs mingw-w64-x86_64-libffi mingw-w64-x86_64-mpdecimal mingw-w64-x86_64-ncurses mingw-w64-x86_64-openssl mingw-w64-x86_64-sqlite3 mingw-w64-x86_64-tcl mingw-w64-x86_64-tk mingw-w64-x86_64-xz mingw-w64-x86_64-zlib + ) + msys_package( + URL "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-bzip2-1.0.8-1-any.pkg.tar.xz" + SHA512 6e01b26a2144f99ca00406dbce5b8c3e928ec8a3ff77e0b741b26aaf9c927e9bea8cb1b5f38cd59118307e10dd4523a0ea2a1ea61f798f99e6d605ef1d100503 + DEPS mingw-w64-x86_64-gcc-libs + ) + msys_package( + URL "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-mpdecimal-2.5.0-1-any.pkg.tar.zst" + SHA512 48130ff676c0235bad4648527021e597ee00aa49a4443740a134005877e2ff2ca27b30a0ac86b923192a65348b36de4e8d3f9c57d76ab42b2e21d1a92dbf7ccf + DEPS mingw-w64-x86_64-gcc-libs + ) + msys_package( + URL "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-ncurses-6.2-1-any.pkg.tar.xz" + SHA512 1cbffe0e181a3d4ceaa8f39b2a649584b2c7d689e6a057d85cb9f84edece2cf60eddc220127c7fa4f29e4aa6e8fb4f568ef9d73582d08168607135af977407e0 + DEPS mingw-w64-x86_64-libsystre + ) + msys_package( + URL "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-libsystre-1.0.1-4-any.pkg.tar.xz" + SHA512 6540e896636d00d1ea4782965b3fe4d4ef1e32e689a98d25e2987191295b319eb1de2e56be3a4b524ff94f522a6c3e55f8159c1a6f58c8739e90f8e24e2d40d8 + DEPS mingw-w64-x86_64-libtre + ) + msys_package( + URL "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-libtre-git-r128.6fb7206-2-any.pkg.tar.xz" + NAME mingw-w64-x86_64-libtre + VERSION git-r128.6fb7206-2 + ANY + REPO mingw/x86_64 + SHA512 d595dbcf3a3b6ed098e46f370533ab86433efcd6b4d3dcf00bbe944ab8c17db7a20f6535b523da43b061f071a3b8aa651700b443ae14ec752ae87500ccc0332d + DEPS mingw-w64-x86_64-gcc-libs mingw-w64-x86_64-gettext + ) + msys_package( + URL "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-openssl-1.1.1.g-1-any.pkg.tar.xz" + SHA512 81681089a19cae7dbdee1bc9d3148f03458fa7a1d2fd105be39299b3a0c91b34450bcfe2ad86622bc6819da1558d7217deb0807b4a7bed942a9a7a786fcd54a3 + DEPS mingw-w64-x86_64-ca-certificates mingw-w64-x86_64-gcc-libs mingw-w64-x86_64-zlib + ) + msys_package( + URL "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-ca-certificates-20200601-1-any.pkg.tar.zst" + SHA512 21a81e1529a3ad4f6eceb3b7d4e36400712d3a690d3991131573d4aae8364965757f9b02054d93c853eb75fbb7f6173a278b122450c800b2c9a1e8017dd35e28 + DEPS mingw-w64-x86_64-p11-kit + ) + msys_package( + URL "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-p11-kit-0.23.20-2-any.pkg.tar.xz" + SHA512 c441c4928465a98aa53917df737b728275bc0f6e9b41e13de7c665a37d2111b46f057bb652a1d5a6c7cdf8a74ea15e365a727671b698f5bbb5a7cfd0b889935e + DEPS mingw-w64-x86_64-gettext mingw-w64-x86_64-libffi mingw-w64-x86_64-libtasn1 + ) + msys_package( + URL "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-libtasn1-4.16.0-1-any.pkg.tar.xz" + SHA512 c450cd49391b46af552a89f2f6e2c21dd5da7d40e7456b380290c514a0f06bcbd63f0f972b3c173c4237bec7b652ff22d2d330e8fdf5c888558380bd2667be64 + DEPS mingw-w64-x86_64-gcc-libs + ) + msys_package( + URL "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-sqlite3-3.33.0-1-any.pkg.tar.zst" + SHA512 eae319f87c9849049347f132efc2ecc46e9ac1ead55542e31a3ea216932a4fa5c5bae8d468d2f050e1e22068ac9fbe9d8e1aa7612cc0110cafe6605032adeb0f + DEPS mingw-w64-x86_64-gcc-libs mingw-w64-x86_64-readline mingw-w64-x86_64-tcl + ) + msys_package( + URL "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-readline-8.0.004-1-any.pkg.tar.xz" + SHA512 e3fb3030a50f677697bec0da39ba2eb979dc28991ad0e29012cbf1bda82723176148510bf924b7fce7a0b79e7b078232d69e07f3fbb7d657b8ee631841730120 + DEPS mingw-w64-x86_64-gcc-libs mingw-w64-x86_64-termcap + ) + msys_package( + URL "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-termcap-1.3.1-6-any.pkg.tar.zst" + SHA512 602d182ba0f1e20c4c51ae09b327c345bd736e6e4f22cd7d58374ac68c705dd0af97663b9b94d41870457f46bb9110abb29186d182196133618fc460f71d1300 + DEPS mingw-w64-x86_64-gcc-libs + ) + msys_package( + URL "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-tk-8.6.10-2-any.pkg.tar.zst" + SHA512 a2d05ce3070d3a3bdf823fa5c790b124aa7493e60758e2911d3f9651899cf58328044f9b06edd82060d8a4b5efb5c4cb32085d827aecd796dbb5e42441da305f + DEPS mingw-w64-x86_64-tcl + ) + msys_package( + URL "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-tcl-8.6.10-1-any.pkg.tar.xz" + SHA512 c3f21588e19725598878ef13145fbe7a995c2a0c678ef0a4782e28fd64d65fe3271178369bf0c54e92123eba82f2d3da6ae2fc34acd3b20150d1e173be1c0f8f + DEPS mingw-w64-x86_64-gcc-libs mingw-w64-x86_64-zlib + ) + msys_package( + URL "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-xz-5.2.5-2-any.pkg.tar.zst" + SHA512 94fcf8b9f9fbc2cfdb2ed53dbe72797806aa3399c4dcfea9c6204702c4504eb4d4204000accd965fcd0680d994bf947eae308bc576e629bbaa3a4cefda3aea52 + DEPS mingw-w64-x86_64-gcc-libs mingw-w64-x86_64-gettext + ) + msys_package( + URL "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-gettext-0.19.8.1-10-any.pkg.tar.zst" + SHA512 ebe948028942738918930b1f3b7aa0314ce0fb617dbd36dcfaf3980958555c7c476f2b50c21d272d01fd3b0bb87ac4f800e485a5b7f8fcc7b30aacdf76740348 + DEPS mingw-w64-x86_64-expat mingw-w64-x86_64-gcc-libs mingw-w64-x86_64-libiconv + ) + msys_package( + URL "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-gcc-libs-10.2.0-9-any.pkg.tar.zst" + SHA512 b2952015e0b27c51219fe15d7550a349e6d73032bbe328f00d6654008c4bda28766d75ce8898d765879ec5f4815695d0f047d01811d8253ed2d433cd5c77d5a9 + DEPS mingw-w64-x86_64-gmp mingw-w64-x86_64-libwinpthread mingw-w64-x86_64-mpc mingw-w64-x86_64-mpfr + ) + msys_package( + URL "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-mpc-1.2.0-2-any.pkg.tar.zst" + SHA512 f094b3ec407382018b3454afa07ea82b94acf3b92c094c46ab6d27e56cd2647cf5bc4986ecb18f8a5da721fd267dceba25353822e7cac33d9107604ac5d429bc + DEPS mingw-w64-x86_64-mpfr + ) + msys_package( + URL "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-mpfr-4.1.0-3-any.pkg.tar.zst" + SHA512 be8ad04e53804f18cfeec5b9cba1877af1516762de60891e115826fcfe95166751a68e24cdf351a021294e3189c31ce3c2db0ebf9c1d4d4ab6fea1468f73ced5 + DEPS mingw-w64-x86_64-gmp + ) + msys_package( + URL "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-gmp-6.2.0-3-any.pkg.tar.zst" + SHA512 2736ba40bd7cac4ed12aae3d677aa0b788b161d2488976fbbae0fc6cff9ab154a09c903c1eec38ffe408a41abc62fd6106b55e17d7826b6dc10e720053685b1f + ) + msys_package( + URL "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-expat-2.2.10-1-any.pkg.tar.zst" + SHA512 ea3069abd7b9809186d1204479a49d605797535e5d618c5c4fc068511134ef9a277facd67fc47fa9a00da2018db90291190fdb2187cb6a7bd99331a1c0c7e119 + ) + msys_package( + URL "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-libffi-3.3-3-any.pkg.tar.zst" + SHA512 6d7700e218018454e406737108c40328038deb8d159b147b4159192d01fb72f8df90a81cf769c0b452fdab1f2ff110ead2e1894e3804f7e827fa2770349c63f8 + ) + msys_package( + URL "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-libiconv-1.16-2-any.pkg.tar.zst" + SHA512 542ed5d898a57a79d3523458f8f3409669b411f87d0852bb566d66f75c96422433f70628314338993461bcb19d4bfac4dadd9d21390cb4d95ef0445669288658 + ) + msys_package( + URL "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-zlib-1.2.11-9-any.pkg.tar.zst" + SHA512 f386d3a8d8c169a62a4580af074b7fdc0760ef0fde22ef7020a349382dd374a9e946606c757d12da1c1fe68baf5e2eaf459446e653477035a63e0e20df8f4aa0 + ) + msys_package( + URL "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-libwinpthread-git-8.0.0.5906.c9a21571-1-any.pkg.tar.zst" + NAME mingw-w64-x86_64-libwinpthread + VERSION git-8.0.0.5906.c9a21571-1 + ANY + ZST + REPO mingw/x86_64 + SHA512 a6969a5db1c55ba458c1a047d0a2a9d2db6cc24266ea47f740598b149a601995d2de734a0984ac5e57ee611d5982cbc03fd6fc0f498435e8d6401bf15724caad + ) + + if(PACKAGES) + message(FATAL_ERROR "Unknown packages were required for vcpkg_acquire_msys(${_am_PACKAGES}): ${PACKAGES}\nThis can be resolved by explicitly passing URL/SHA pairs to DIRECT_PACKAGES.") + endif() + + string(SHA512 TOTAL_HASH "${TOTAL_HASH}") + string(SUBSTRING "${TOTAL_HASH}" 0 16 TOTAL_HASH) + set(PATH_TO_ROOT ${DOWNLOADS}/tools/msys2/${TOTAL_HASH}) + if(NOT EXISTS "${PATH_TO_ROOT}") + file(REMOVE_RECURSE ${PATH_TO_ROOT}.tmp) + file(MAKE_DIRECTORY ${PATH_TO_ROOT}.tmp/tmp) + set(I 0) + foreach(ARCHIVE IN LISTS ARCHIVES) + vcpkg_execute_required_process( + ALLOW_IN_DOWNLOAD_MODE + COMMAND ${CMAKE_COMMAND} -E tar xzf ${ARCHIVE} + LOGNAME msys-${TARGET_TRIPLET}-${I} + WORKING_DIRECTORY ${PATH_TO_ROOT}.tmp + ) + math(EXPR I "${I} + 1") + endforeach() + file(RENAME ${PATH_TO_ROOT}.tmp ${PATH_TO_ROOT}) + endif() + # Due to skipping the regular MSYS2 installer, + # some config files need to be established explicitly. + if(NOT EXISTS "${PATH_TO_ROOT}/etc/fstab") + # This fstab entry removes the cygdrive prefix from paths. + file(WRITE "${PATH_TO_ROOT}/etc/fstab" "none / cygdrive binary,posix=0,noacl,user 0 0") + endif() + message(STATUS "Using msys root at ${PATH_TO_ROOT}") + set(${PATH_TO_ROOT_OUT} ${PATH_TO_ROOT} PARENT_SCOPE) +endfunction() diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_add_to_path.cmake b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_add_to_path.cmake new file mode 100644 index 000000000..fe780c72a --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_add_to_path.cmake @@ -0,0 +1,37 @@ +#[===[
+# vcpkg_add_to_path
+
+Add a directory or directories to the PATH environment variable
+
+```cmake
+vcpkg_add_to_path([PREPEND] [<path>...])
+```
+
+`vcpkg_add_to_path` adds all of the paths passed to it to the PATH environment variable.
+If PREPEND is passed, then those paths are prepended to the PATH environment variable,
+so that they are searched first; otherwise, those paths are appended, so they are
+searched after the paths which are already in the environment variable.
+
+The paths are added in the order received, so that the first path is always searched
+before a later path.
+
+If no paths are passed, then nothing will be done.
+
+## Examples:
+* [curl](https://github.com/Microsoft/vcpkg/blob/master/ports/curl/portfile.cmake#L75)
+* [folly](https://github.com/Microsoft/vcpkg/blob/master/ports/folly/portfile.cmake#L15)
+* [z3](https://github.com/Microsoft/vcpkg/blob/master/ports/z3/portfile.cmake#L13)
+#]===]
+function(vcpkg_add_to_path)
+ cmake_parse_arguments(PARSE_ARGV 0 "arg" "PREPEND" "" "")
+ if(NOT DEFINED arg_UNPARSED_ARGUMENTS)
+ return()
+ endif()
+
+ list(JOIN arg_UNPARSED_ARGUMENTS "${VCPKG_HOST_PATH_SEPARATOR}" add_to_path)
+ if(arg_PREPEND)
+ set(ENV{PATH} "${add_to_path}${VCPKG_HOST_PATH_SEPARATOR}$ENV{PATH}")
+ else()
+ set(ENV{PATH} "$ENV{PATH}${VCPKG_HOST_PATH_SEPARATOR}${add_to_path}")
+ endif()
+endfunction()
diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_apply_patches.cmake b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_apply_patches.cmake new file mode 100644 index 000000000..dae9e6018 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_apply_patches.cmake @@ -0,0 +1,33 @@ +# DEPRECATED: in favor of the `PATCHES` argument to [`vcpkg_from_github()`](vcpkg_from_github.md) et al. + +#[===[.md +# vcpkg_apply_patches + +Apply a set of patches to a source tree. + +```cmake +vcpkg_apply_patches( + SOURCE_PATH <${SOURCE_PATH}> + [QUIET] + PATCHES <patch1.patch>... +) +``` +#]===] + +function(vcpkg_apply_patches) + z_vcpkg_deprecation_message("vcpkg_apply_patches has been deprecated in favor of the `PATCHES` argument to `vcpkg_from_*`.") + + cmake_parse_arguments(PARSE_ARGV 0 "arg" "QUIET" "SOURCE_PATH" "PATCHES") + + if(arg_QUIET) + set(quiet "QUIET") + else() + set(quiet) + endif() + + z_vcpkg_apply_patches( + SOURCE_PATH "${arg_SOURCE_PATH}" + ${quiet} + PATCHES ${arg_PATCHES} + ) +endfunction() diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_build_cmake.cmake b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_build_cmake.cmake new file mode 100644 index 000000000..637e4a160 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_build_cmake.cmake @@ -0,0 +1,117 @@ +# DEPRECATED BY ports/vcpkg-cmake/vcpkg_cmake_build +#[===[.md: +# vcpkg_build_cmake + +Build a cmake project. + +## Usage: +```cmake +vcpkg_build_cmake([DISABLE_PARALLEL] [TARGET <target>]) +``` + +## Parameters: +### DISABLE_PARALLEL +The underlying buildsystem will be instructed to not parallelize + +### TARGET +The target passed to the cmake build command (`cmake --build . --target <target>`). If not specified, no target will +be passed. + +### ADD_BIN_TO_PATH +Adds the appropriate Release and Debug `bin\` directories to the path during the build such that executables can run against the in-tree DLLs. + +## Notes: +This command should be preceded by a call to [`vcpkg_configure_cmake()`](vcpkg_configure_cmake.md). +You can use the alias [`vcpkg_install_cmake()`](vcpkg_configure_cmake.md) function if your CMake script supports the +"install" target + +## Examples: + +* [zlib](https://github.com/Microsoft/vcpkg/blob/master/ports/zlib/portfile.cmake) +* [cpprestsdk](https://github.com/Microsoft/vcpkg/blob/master/ports/cpprestsdk/portfile.cmake) +* [poco](https://github.com/Microsoft/vcpkg/blob/master/ports/poco/portfile.cmake) +* [opencv](https://github.com/Microsoft/vcpkg/blob/master/ports/opencv/portfile.cmake) +#]===] + +function(vcpkg_build_cmake) + cmake_parse_arguments(PARSE_ARGV 0 "arg" + "DISABLE_PARALLEL;ADD_BIN_TO_PATH" + "TARGET;LOGFILE_ROOT" + "" + ) + + if(Z_VCPKG_CMAKE_BUILD_GUARD) + message(FATAL_ERROR "The ${PORT} port already depends on vcpkg-cmake; using both vcpkg-cmake and vcpkg_build_cmake in the same port is unsupported.") + endif() + + if(NOT arg_LOGFILE_ROOT) + set(arg_LOGFILE_ROOT "build") + endif() + + set(PARALLEL_ARG) + set(NO_PARALLEL_ARG) + + if(Z_VCPKG_CMAKE_GENERATOR MATCHES "Ninja") + set(BUILD_ARGS "-v") # verbose output + set(PARALLEL_ARG "-j${VCPKG_CONCURRENCY}") + set(NO_PARALLEL_ARG "-j1") + elseif(Z_VCPKG_CMAKE_GENERATOR MATCHES "Visual Studio") + set(BUILD_ARGS + "/p:VCPkgLocalAppDataDisabled=true" + "/p:UseIntelMKL=No" + ) + set(PARALLEL_ARG "/m") + elseif(Z_VCPKG_CMAKE_GENERATOR MATCHES "NMake") + # No options are currently added for nmake builds + else() + message(FATAL_ERROR "Unrecognized GENERATOR setting from vcpkg_configure_cmake(). Valid generators are: Ninja, Visual Studio, and NMake Makefiles") + endif() + + if(arg_TARGET) + set(TARGET_PARAM "--target" ${arg_TARGET}) + else() + set(TARGET_PARAM) + endif() + + foreach(BUILDTYPE "debug" "release") + if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL BUILDTYPE) + if(BUILDTYPE STREQUAL "debug") + set(SHORT_BUILDTYPE "dbg") + set(CONFIG "Debug") + else() + set(SHORT_BUILDTYPE "rel") + set(CONFIG "Release") + endif() + + message(STATUS "Building ${TARGET_TRIPLET}-${SHORT_BUILDTYPE}") + + if(arg_ADD_BIN_TO_PATH) + set(_BACKUP_ENV_PATH "$ENV{PATH}") + if(BUILDTYPE STREQUAL "debug") + vcpkg_add_to_path(PREPEND "${CURRENT_INSTALLED_DIR}/debug/bin") + else() + vcpkg_add_to_path(PREPEND "${CURRENT_INSTALLED_DIR}/bin") + endif() + endif() + + if (arg_DISABLE_PARALLEL) + vcpkg_execute_build_process( + COMMAND ${CMAKE_COMMAND} --build . --config ${CONFIG} ${TARGET_PARAM} -- ${BUILD_ARGS} ${NO_PARALLEL_ARG} + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${SHORT_BUILDTYPE} + LOGNAME "${arg_LOGFILE_ROOT}-${TARGET_TRIPLET}-${SHORT_BUILDTYPE}" + ) + else() + vcpkg_execute_build_process( + COMMAND ${CMAKE_COMMAND} --build . --config ${CONFIG} ${TARGET_PARAM} -- ${BUILD_ARGS} ${PARALLEL_ARG} + NO_PARALLEL_COMMAND ${CMAKE_COMMAND} --build . --config ${CONFIG} ${TARGET_PARAM} -- ${BUILD_ARGS} ${NO_PARALLEL_ARG} + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${SHORT_BUILDTYPE} + LOGNAME "${arg_LOGFILE_ROOT}-${TARGET_TRIPLET}-${SHORT_BUILDTYPE}" + ) + endif() + + if(arg_ADD_BIN_TO_PATH) + set(ENV{PATH} "${_BACKUP_ENV_PATH}") + endif() + endif() + endforeach() +endfunction() diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_build_gn.cmake b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_build_gn.cmake new file mode 100644 index 000000000..3952e7eed --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_build_gn.cmake @@ -0,0 +1,20 @@ +#[===[.md: +# vcpkg_build_gn + +Build a GN project + +## Usage: +```cmake +vcpkg_build_gn( + [TARGETS <target>...] +) +``` + +## Parameters: +### TARGETS +Only build the specified targets. +#]===] + +function(vcpkg_build_gn) + vcpkg_build_ninja(${ARGN}) +endfunction() diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_build_make.cmake b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_build_make.cmake new file mode 100755 index 000000000..5f3974371 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_build_make.cmake @@ -0,0 +1,251 @@ +#[===[.md:
+# vcpkg_build_make
+
+Build a linux makefile project.
+
+## Usage:
+```cmake
+vcpkg_build_make([BUILD_TARGET <target>]
+ [ADD_BIN_TO_PATH]
+ [ENABLE_INSTALL]
+ [MAKEFILE <makefileName>]
+ [LOGFILE_ROOT <logfileroot>])
+```
+
+### BUILD_TARGET
+The target passed to the make build command (`./make <target>`). If not specified, the 'all' target will
+be passed.
+
+### ADD_BIN_TO_PATH
+Adds the appropriate Release and Debug `bin\` directories to the path during the build such that executables can run against the in-tree DLLs.
+
+### ENABLE_INSTALL
+IF the port supports the install target use vcpkg_install_make() instead of vcpkg_build_make()
+
+### MAKEFILE
+Specifies the Makefile as a relative path from the root of the sources passed to `vcpkg_configure_make()`
+
+### BUILD_TARGET
+The target passed to the make build command (`./make <target>`). Defaults to 'all'.
+
+### INSTALL_TARGET
+The target passed to the make build command (`./make <target>`) if `ENABLE_INSTALL` is used. Defaults to 'install'.
+
+### DISABLE_PARALLEL
+The underlying buildsystem will be instructed to not parallelize
+
+### SUBPATH
+Additional subdir to invoke make in. Useful if only parts of a port should be built.
+
+## Notes:
+This command should be preceded by a call to [`vcpkg_configure_make()`](vcpkg_configure_make.md).
+You can use the alias [`vcpkg_install_make()`](vcpkg_install_make.md) function if your makefile supports the
+"install" target
+
+## Examples
+
+* [x264](https://github.com/Microsoft/vcpkg/blob/master/ports/x264/portfile.cmake)
+* [tcl](https://github.com/Microsoft/vcpkg/blob/master/ports/tcl/portfile.cmake)
+* [freexl](https://github.com/Microsoft/vcpkg/blob/master/ports/freexl/portfile.cmake)
+* [libosip2](https://github.com/Microsoft/vcpkg/blob/master/ports/libosip2/portfile.cmake)
+#]===]
+
+function(vcpkg_build_make)
+ if(NOT _VCPKG_CMAKE_VARS_FILE)
+ # vcpkg_build_make called without using vcpkg_configure_make before
+ vcpkg_internal_get_cmake_vars(OUTPUT_FILE _VCPKG_CMAKE_VARS_FILE)
+ endif()
+ include("${_VCPKG_CMAKE_VARS_FILE}")
+
+ # parse parameters such that semicolons in options arguments to COMMAND don't get erased
+ cmake_parse_arguments(PARSE_ARGV 0 _bc "ADD_BIN_TO_PATH;ENABLE_INSTALL;DISABLE_PARALLEL" "LOGFILE_ROOT;BUILD_TARGET;SUBPATH;MAKEFILE;INSTALL_TARGET" "")
+
+ if(NOT _bc_LOGFILE_ROOT)
+ set(_bc_LOGFILE_ROOT "build")
+ endif()
+
+ if(NOT _bc_BUILD_TARGET)
+ set(_bc_BUILD_TARGET "all")
+ endif()
+
+ if (NOT _bc_MAKEFILE)
+ set(_bc_MAKEFILE Makefile)
+ endif()
+
+ if(NOT _bc_INSTALL_TARGET)
+ set(_bc_INSTALL_TARGET "install")
+ endif()
+
+ if(WIN32)
+ set(_VCPKG_PREFIX ${CURRENT_PACKAGES_DIR})
+ set(_VCPKG_INSTALLED ${CURRENT_INSTALLED_DIR})
+ else()
+ string(REPLACE " " "\ " _VCPKG_PREFIX "${CURRENT_PACKAGES_DIR}")
+ string(REPLACE " " "\ " _VCPKG_INSTALLED "${CURRENT_INSTALLED_DIR}")
+ endif()
+
+ set(MAKE )
+ set(MAKE_OPTS )
+ set(INSTALL_OPTS )
+ if (CMAKE_HOST_WIN32)
+ set(PATH_GLOBAL "$ENV{PATH}")
+ vcpkg_add_to_path(PREPEND "${SCRIPTS}/buildsystems/make_wrapper")
+ vcpkg_acquire_msys(MSYS_ROOT)
+ find_program(MAKE make REQUIRED)
+ set(MAKE_COMMAND "${MAKE}")
+ set(MAKE_OPTS ${_bc_MAKE_OPTIONS} -j ${VCPKG_CONCURRENCY} --trace -f ${_bc_MAKEFILE} ${_bc_BUILD_TARGET})
+ set(NO_PARALLEL_MAKE_OPTS ${_bc_MAKE_OPTIONS} -j 1 --trace -f ${_bc_MAKEFILE} ${_bc_BUILD_TARGET})
+
+ string(REPLACE " " "\\\ " _VCPKG_PACKAGE_PREFIX ${CURRENT_PACKAGES_DIR})
+ string(REGEX REPLACE "([a-zA-Z]):/" "/\\1/" _VCPKG_PACKAGE_PREFIX "${_VCPKG_PACKAGE_PREFIX}")
+ set(INSTALL_OPTS -j ${VCPKG_CONCURRENCY} --trace -f ${_bc_MAKEFILE} ${_bc_INSTALL_TARGET} DESTDIR=${_VCPKG_PACKAGE_PREFIX})
+ #TODO: optimize for install-data (release) and install-exec (release/debug)
+ else()
+ # Compiler requriements
+ if(VCPKG_HOST_IS_OPENBSD)
+ find_program(MAKE gmake REQUIRED)
+ else()
+ find_program(MAKE make REQUIRED)
+ endif()
+ set(MAKE_COMMAND "${MAKE}")
+ # Set make command and install command
+ set(MAKE_OPTS ${_bc_MAKE_OPTIONS} V=1 -j ${VCPKG_CONCURRENCY} -f ${_bc_MAKEFILE} ${_bc_BUILD_TARGET})
+ set(NO_PARALLEL_MAKE_OPTS ${_bc_MAKE_OPTIONS} V=1 -j 1 -f ${_bc_MAKEFILE} ${_bc_BUILD_TARGET})
+ set(INSTALL_OPTS -j ${VCPKG_CONCURRENCY} -f ${_bc_MAKEFILE} ${_bc_INSTALL_TARGET} DESTDIR=${CURRENT_PACKAGES_DIR})
+ endif()
+
+ # Since includes are buildtype independent those are setup by vcpkg_configure_make
+ _vcpkg_backup_env_variables(LIB LIBPATH LIBRARY_PATH LD_LIBRARY_PATH)
+
+ foreach(BUILDTYPE "debug" "release")
+ if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL BUILDTYPE)
+ if(BUILDTYPE STREQUAL "debug")
+ # Skip debug generate
+ if (_VCPKG_NO_DEBUG)
+ continue()
+ endif()
+ set(SHORT_BUILDTYPE "-dbg")
+ set(CMAKE_BUILDTYPE "DEBUG")
+ set(PATH_SUFFIX "/debug")
+ else()
+ # In NO_DEBUG mode, we only use ${TARGET_TRIPLET} directory.
+ if (_VCPKG_NO_DEBUG)
+ set(SHORT_BUILDTYPE "")
+ else()
+ set(SHORT_BUILDTYPE "-rel")
+ endif()
+ set(CMAKE_BUILDTYPE "RELEASE")
+ set(PATH_SUFFIX "")
+ endif()
+
+ set(WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}${SHORT_BUILDTYPE}${_bc_SUBPATH}")
+ message(STATUS "Building ${TARGET_TRIPLET}${SHORT_BUILDTYPE}")
+
+ _vcpkg_extract_cpp_flags_and_set_cflags_and_cxxflags(${CMAKE_BUILDTYPE})
+
+ if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
+ set(LINKER_FLAGS_${CMAKE_BUILDTYPE} "${VCPKG_DETECTED_STATIC_LINKERFLAGS_${CMAKE_BUILDTYPE}}")
+ else() # dynamic
+ set(LINKER_FLAGS_${CMAKE_BUILDTYPE} "${VCPKG_DETECTED_SHARED_LINKERFLAGS_${CMAKE_BUILDTYPE}}")
+ endif()
+ if (CMAKE_HOST_WIN32 AND VCPKG_DETECTED_C_COMPILER MATCHES "cl.exe")
+ set(LDFLAGS_${CMAKE_BUILDTYPE} "-L${_VCPKG_INSTALLED}${PATH_SUFFIX}/lib -L${_VCPKG_INSTALLED}${PATH_SUFFIX}/lib/manual-link")
+ set(LINK_ENV_${CMAKE_BUILDTYPE} "$ENV{_LINK_} ${LINKER_FLAGS_${CMAKE_BUILDTYPE}}")
+ else()
+ set(LDFLAGS_${CMAKE_BUILDTYPE} "-L${_VCPKG_INSTALLED}${PATH_SUFFIX}/lib -L${_VCPKG_INSTALLED}${PATH_SUFFIX}/lib/manual-link ${LINKER_FLAGS_${CMAKE_BUILDTYPE}}")
+ endif()
+
+ # Setup environment
+ set(ENV{CPPFLAGS} "${CPPFLAGS_${CMAKE_BUILDTYPE}}")
+ set(ENV{CFLAGS} "${CFLAGS_${CMAKE_BUILDTYPE}}")
+ set(ENV{CXXFLAGS} "${CXXFLAGS_${CMAKE_BUILDTYPE}}")
+ set(ENV{RCFLAGS} "${VCPKG_DETECTED_CMAKE_RC_FLAGS_${CMAKE_BUILDTYPE}}")
+ set(ENV{LDFLAGS} "${LDFLAGS_${CMAKE_BUILDTYPE}}")
+ set(ENV{LIB} "${_VCPKG_INSTALLED}${PATH_SUFFIX}/lib/${VCPKG_HOST_PATH_SEPARATOR}${_VCPKG_INSTALLED}${PATH_SUFFIX}/lib/manual-link/${LIB_PATHLIKE_CONCAT}")
+ set(ENV{LIBPATH} "${_VCPKG_INSTALLED}${PATH_SUFFIX}/lib/${VCPKG_HOST_PATH_SEPARATOR}${_VCPKG_INSTALLED}${PATH_SUFFIX}/lib/manual-link/${LIBPATH_PATHLIKE_CONCAT}")
+ set(ENV{LIBRARY_PATH} "${_VCPKG_INSTALLED}${PATH_SUFFIX}/lib/${VCPKG_HOST_PATH_SEPARATOR}${_VCPKG_INSTALLED}${PATH_SUFFIX}/lib/manual-link/${LIBRARY_PATH_PATHLIKE_CONCAT}")
+ #set(ENV{LD_LIBRARY_PATH} "${_VCPKG_INSTALLED}${PATH_SUFFIX_${BUILDTYPE}}/lib/${VCPKG_HOST_PATH_SEPARATOR}${_VCPKG_INSTALLED}${PATH_SUFFIX_${BUILDTYPE}}/lib/manual-link/${LD_LIBRARY_PATH_PATHLIKE_CONCAT}")
+
+ if(LINK_ENV_${_VAR_SUFFIX})
+ set(_LINK_CONFIG_BACKUP "$ENV{_LINK_}")
+ set(ENV{_LINK_} "${LINK_ENV_${_VAR_SUFFIX}}")
+ endif()
+
+ if(_bc_ADD_BIN_TO_PATH)
+ set(_BACKUP_ENV_PATH "$ENV{PATH}")
+ vcpkg_add_to_path(PREPEND "${CURRENT_INSTALLED_DIR}${PATH_SUFFIX}/bin")
+ endif()
+
+ if(MAKE_BASH)
+ set(MAKE_CMD_LINE "${MAKE_COMMAND} ${MAKE_OPTS}")
+ set(NO_PARALLEL_MAKE_CMD_LINE "${MAKE_COMMAND} ${NO_PARALLEL_MAKE_OPTS}")
+ else()
+ set(MAKE_CMD_LINE ${MAKE_COMMAND} ${MAKE_OPTS})
+ set(NO_PARALLEL_MAKE_CMD_LINE ${MAKE_COMMAND} ${NO_PARALLEL_MAKE_OPTS})
+ endif()
+
+ if (_bc_DISABLE_PARALLEL)
+ vcpkg_execute_build_process(
+ COMMAND ${MAKE_BASH} ${NO_PARALLEL_MAKE_CMD_LINE}
+ WORKING_DIRECTORY "${WORKING_DIRECTORY}"
+ LOGNAME "${_bc_LOGFILE_ROOT}-${TARGET_TRIPLET}${SHORT_BUILDTYPE}"
+ )
+ else()
+ vcpkg_execute_build_process(
+ COMMAND ${MAKE_BASH} ${MAKE_CMD_LINE}
+ NO_PARALLEL_COMMAND ${MAKE_BASH} ${NO_PARALLEL_MAKE_CMD_LINE}
+ WORKING_DIRECTORY "${WORKING_DIRECTORY}"
+ LOGNAME "${_bc_LOGFILE_ROOT}-${TARGET_TRIPLET}${SHORT_BUILDTYPE}"
+ )
+ endif()
+
+ file(READ "${CURRENT_BUILDTREES_DIR}/${_bc_LOGFILE_ROOT}-${TARGET_TRIPLET}${SHORT_BUILDTYPE}-out.log" LOGDATA)
+ if(LOGDATA MATCHES "Warning: linker path does not have real file for library")
+ message(FATAL_ERROR "libtool could not find a file being linked against!")
+ endif()
+
+ if (_bc_ENABLE_INSTALL)
+ message(STATUS "Installing ${TARGET_TRIPLET}${SHORT_BUILDTYPE}")
+ if(MAKE_BASH)
+ set(MAKE_CMD_LINE "${MAKE_COMMAND} ${INSTALL_OPTS}")
+ else()
+ set(MAKE_CMD_LINE ${MAKE_COMMAND} ${INSTALL_OPTS})
+ endif()
+ vcpkg_execute_build_process(
+ COMMAND ${MAKE_BASH} ${MAKE_CMD_LINE}
+ WORKING_DIRECTORY "${WORKING_DIRECTORY}"
+ LOGNAME "install-${TARGET_TRIPLET}${SHORT_BUILDTYPE}"
+ )
+ endif()
+
+ if(_LINK_CONFIG_BACKUP)
+ set(ENV{_LINK_} "${_LINK_CONFIG_BACKUP}")
+ unset(_LINK_CONFIG_BACKUP)
+ endif()
+
+ if(_bc_ADD_BIN_TO_PATH)
+ set(ENV{PATH} "${_BACKUP_ENV_PATH}")
+ endif()
+ endif()
+ endforeach()
+
+ if (_bc_ENABLE_INSTALL)
+ string(REGEX REPLACE "([a-zA-Z]):/" "/\\1/" _VCPKG_INSTALL_PREFIX "${CURRENT_INSTALLED_DIR}")
+ file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}_tmp")
+ file(RENAME "${CURRENT_PACKAGES_DIR}" "${CURRENT_PACKAGES_DIR}_tmp")
+ file(RENAME "${CURRENT_PACKAGES_DIR}_tmp${_VCPKG_INSTALL_PREFIX}" "${CURRENT_PACKAGES_DIR}")
+ file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}_tmp")
+ endif()
+
+ # Remove libtool files since they contain absolute paths and are not necessary.
+ file(GLOB_RECURSE LIBTOOL_FILES "${CURRENT_PACKAGES_DIR}/**/*.la")
+ if(LIBTOOL_FILES)
+ file(REMOVE ${LIBTOOL_FILES})
+ endif()
+
+ if (CMAKE_HOST_WIN32)
+ set(ENV{PATH} "${PATH_GLOBAL}")
+ endif()
+
+ _vcpkg_restore_env_variables(LIB LIBPATH LIBRARY_PATH LD_LIBRARY_PATH)
+endfunction()
diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_build_msbuild.cmake b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_build_msbuild.cmake new file mode 100644 index 000000000..799eb33b5 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_build_msbuild.cmake @@ -0,0 +1,148 @@ +#[===[.md: +# vcpkg_build_msbuild + +Build a msbuild-based project. Deprecated in favor of `vcpkg_install_msbuild()`. + +## Usage +```cmake +vcpkg_build_msbuild( + PROJECT_PATH <${SOURCE_PATH}/port.sln> + [RELEASE_CONFIGURATION <Release>] + [DEBUG_CONFIGURATION <Debug>] + [TARGET <Build>] + [TARGET_PLATFORM_VERSION <10.0.15063.0>] + [PLATFORM <${TRIPLET_SYSTEM_ARCH}>] + [PLATFORM_TOOLSET <${VCPKG_PLATFORM_TOOLSET}>] + [OPTIONS </p:ZLIB_INCLUDE_PATH=X>...] + [OPTIONS_RELEASE </p:ZLIB_LIB=X>...] + [OPTIONS_DEBUG </p:ZLIB_LIB=X>...] + [USE_VCPKG_INTEGRATION] +) +``` + +## Parameters +### USE_VCPKG_INTEGRATION +Apply the normal `integrate install` integration for building the project. + +By default, projects built with this command will not automatically link libraries or have header paths set. + +### PROJECT_PATH +The path to the solution (`.sln`) or project (`.vcxproj`) file. + +### RELEASE_CONFIGURATION +The configuration (``/p:Configuration`` msbuild parameter) used for Release builds. + +### DEBUG_CONFIGURATION +The configuration (``/p:Configuration`` msbuild parameter) +used for Debug builds. + +### TARGET_PLATFORM_VERSION +The WindowsTargetPlatformVersion (``/p:WindowsTargetPlatformVersion`` msbuild parameter) + +### TARGET +The MSBuild target to build. (``/t:<TARGET>``) + +### PLATFORM +The platform (``/p:Platform`` msbuild parameter) used for the build. + +### PLATFORM_TOOLSET +The platform toolset (``/p:PlatformToolset`` msbuild parameter) used for the build. + +### OPTIONS +Additional options passed to msbuild for all builds. + +### OPTIONS_RELEASE +Additional options passed to msbuild for Release builds. These are in addition to `OPTIONS`. + +### OPTIONS_DEBUG +Additional options passed to msbuild for Debug builds. These are in addition to `OPTIONS`. + +## Examples + +* [chakracore](https://github.com/Microsoft/vcpkg/blob/master/ports/chakracore/portfile.cmake) +#]===] + +function(vcpkg_build_msbuild) + # parse parameters such that semicolons in options arguments to COMMAND don't get erased + cmake_parse_arguments( + PARSE_ARGV 0 + _csc + "USE_VCPKG_INTEGRATION" + "PROJECT_PATH;RELEASE_CONFIGURATION;DEBUG_CONFIGURATION;PLATFORM;PLATFORM_TOOLSET;TARGET_PLATFORM_VERSION;TARGET" + "OPTIONS;OPTIONS_RELEASE;OPTIONS_DEBUG" + ) + + if(NOT DEFINED _csc_RELEASE_CONFIGURATION) + set(_csc_RELEASE_CONFIGURATION Release) + endif() + if(NOT DEFINED _csc_DEBUG_CONFIGURATION) + set(_csc_DEBUG_CONFIGURATION Debug) + endif() + if(NOT DEFINED _csc_PLATFORM) + set(_csc_PLATFORM ${TRIPLET_SYSTEM_ARCH}) + endif() + if(NOT DEFINED _csc_PLATFORM_TOOLSET) + set(_csc_PLATFORM_TOOLSET ${VCPKG_PLATFORM_TOOLSET}) + endif() + if(NOT DEFINED _csc_TARGET_PLATFORM_VERSION) + vcpkg_get_windows_sdk(_csc_TARGET_PLATFORM_VERSION) + endif() + if(NOT DEFINED _csc_TARGET) + set(_csc_TARGET Rebuild) + endif() + + list(APPEND _csc_OPTIONS + /t:${_csc_TARGET} + /p:Platform=${_csc_PLATFORM} + /p:PlatformToolset=${_csc_PLATFORM_TOOLSET} + /p:VCPkgLocalAppDataDisabled=true + /p:UseIntelMKL=No + /p:WindowsTargetPlatformVersion=${_csc_TARGET_PLATFORM_VERSION} + /p:VcpkgManifestInstall=false + /p:VcpkgManifestEnabled=false + /m + ) + + if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + # Disable LTCG for static libraries because this setting introduces ABI incompatibility between minor compiler versions + # TODO: Add a way for the user to override this if they want to opt-in to incompatibility + list(APPEND _csc_OPTIONS /p:WholeProgramOptimization=false) + endif() + + if(_csc_USE_VCPKG_INTEGRATION) + list( + APPEND _csc_OPTIONS + /p:ForceImportBeforeCppTargets=${SCRIPTS}/buildsystems/msbuild/vcpkg.targets + "/p:VcpkgTriplet=${TARGET_TRIPLET}" + "/p:VcpkgInstalledDir=${_VCPKG_INSTALLED_DIR}" + ) + else() + list(APPEND _csc_OPTIONS "/p:VcpkgEnabled=false") + endif() + + if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") + message(STATUS "Building ${_csc_PROJECT_PATH} for Release") + file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) + vcpkg_execute_required_process( + COMMAND msbuild ${_csc_PROJECT_PATH} + /p:Configuration=${_csc_RELEASE_CONFIGURATION} + ${_csc_OPTIONS} + ${_csc_OPTIONS_RELEASE} + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel + LOGNAME build-${TARGET_TRIPLET}-rel + ) + endif() + + if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") + message(STATUS "Building ${_csc_PROJECT_PATH} for Debug") + file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) + vcpkg_execute_required_process( + COMMAND msbuild ${_csc_PROJECT_PATH} + /p:Configuration=${_csc_DEBUG_CONFIGURATION} + ${_csc_OPTIONS} + ${_csc_OPTIONS_DEBUG} + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg + LOGNAME build-${TARGET_TRIPLET}-dbg + ) + endif() +endfunction() diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_build_ninja.cmake b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_build_ninja.cmake new file mode 100644 index 000000000..2c9276e63 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_build_ninja.cmake @@ -0,0 +1,40 @@ +#[===[.md: +# vcpkg_build_ninja + +Build a ninja project + +## Usage: +```cmake +vcpkg_build_ninja( + [TARGETS <target>...] +) +``` + +## Parameters: +### TARGETS +Only build the specified targets. +#]===] + +function(vcpkg_build_ninja) + # parse parameters such that semicolons in options arguments to COMMAND don't get erased + cmake_parse_arguments(PARSE_ARGV 0 _vbn "" "" "TARGETS") + + vcpkg_find_acquire_program(NINJA) + + function(build CONFIG) + message(STATUS "Building (${CONFIG})...") + vcpkg_execute_build_process( + COMMAND "${NINJA}" -C "${CURRENT_BUILDTREES_DIR}/${CONFIG}" ${_vbn_TARGETS} + WORKING_DIRECTORY "${SOURCE_PATH}" + LOGNAME build-${CONFIG} + ) + endfunction() + + if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") + build(${TARGET_TRIPLET}-dbg) + endif() + + if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") + build(${TARGET_TRIPLET}-rel) + endif() +endfunction() diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_build_nmake.cmake b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_build_nmake.cmake new file mode 100755 index 000000000..47c68ecfd --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_build_nmake.cmake @@ -0,0 +1,232 @@ +#[===[.md:
+# vcpkg_build_nmake
+
+Build a msvc makefile project.
+
+## Usage:
+```cmake
+vcpkg_build_nmake(
+ SOURCE_PATH <${SOURCE_PATH}>
+ [NO_DEBUG]
+ [TARGET <all>]
+ [PROJECT_SUBPATH <${SUBPATH}>]
+ [PROJECT_NAME <${MAKEFILE_NAME}>]
+ [PRERUN_SHELL <${SHELL_PATH}>]
+ [PRERUN_SHELL_DEBUG <${SHELL_PATH}>]
+ [PRERUN_SHELL_RELEASE <${SHELL_PATH}>]
+ [OPTIONS <-DUSE_THIS_IN_ALL_BUILDS=1>...]
+ [OPTIONS_RELEASE <-DOPTIMIZE=1>...]
+ [OPTIONS_DEBUG <-DDEBUGGABLE=1>...]
+ [TARGET <target>])
+```
+
+## Parameters
+### SOURCE_PATH
+Specifies the directory containing the source files.
+By convention, this is usually set in the portfile as the variable `SOURCE_PATH`.
+
+### PROJECT_SUBPATH
+Specifies the sub directory containing the `makefile.vc`/`makefile.mak`/`makefile.msvc` or other msvc makefile.
+
+### PROJECT_NAME
+Specifies the name of msvc makefile name.
+Default is `makefile.vc`
+
+### NO_DEBUG
+This port doesn't support debug mode.
+
+### ENABLE_INSTALL
+Install binaries after build.
+
+### PRERUN_SHELL
+Script that needs to be called before build
+
+### PRERUN_SHELL_DEBUG
+Script that needs to be called before debug build
+
+### PRERUN_SHELL_RELEASE
+Script that needs to be called before release build
+
+### OPTIONS
+Additional options passed to generate during the generation.
+
+### OPTIONS_RELEASE
+Additional options passed to generate during the Release generation. These are in addition to `OPTIONS`.
+
+### OPTIONS_DEBUG
+Additional options passed to generate during the Debug generation. These are in addition to `OPTIONS`.
+
+### TARGET
+The target passed to the nmake build command (`nmake/nmake install`). If not specified, no target will
+be passed.
+
+### ADD_BIN_TO_PATH
+Adds the appropriate Release and Debug `bin\` directories to the path during the build such that executables can run against the in-tree DLLs.
+
+## Notes:
+This command should be preceded by a call to [`vcpkg_configure_nmake()`](vcpkg_configure_nmake.md).
+You can use the alias [`vcpkg_install_nmake()`](vcpkg_install_nmake.md) function if your makefile supports the
+"install" target
+
+## Examples
+
+* [tcl](https://github.com/Microsoft/vcpkg/blob/master/ports/tcl/portfile.cmake)
+* [freexl](https://github.com/Microsoft/vcpkg/blob/master/ports/freexl/portfile.cmake)
+#]===]
+
+function(vcpkg_build_nmake)
+ # parse parameters such that semicolons in options arguments to COMMAND don't get erased
+ cmake_parse_arguments(PARSE_ARGV 0 _bn
+ "ADD_BIN_TO_PATH;ENABLE_INSTALL;NO_DEBUG"
+ "SOURCE_PATH;PROJECT_SUBPATH;PROJECT_NAME;LOGFILE_ROOT"
+ "OPTIONS;OPTIONS_RELEASE;OPTIONS_DEBUG;PRERUN_SHELL;PRERUN_SHELL_DEBUG;PRERUN_SHELL_RELEASE;TARGET"
+ )
+
+ if (NOT CMAKE_HOST_WIN32)
+ message(FATAL_ERROR "vcpkg_build_nmake only support windows.")
+ endif()
+
+ if (_bn_OPTIONS_DEBUG STREQUAL _bn_OPTIONS_RELEASE)
+ message(FATAL_ERROR "Detected debug configuration is equal to release configuration, please use NO_DEBUG for vcpkg_build_nmake/vcpkg_install_nmake")
+ endif()
+
+ if(NOT _bn_LOGFILE_ROOT)
+ set(_bn_LOGFILE_ROOT "build")
+ endif()
+
+ if (NOT _bn_PROJECT_NAME)
+ set(MAKEFILE_NAME makefile.vc)
+ else()
+ set(MAKEFILE_NAME ${_bn_PROJECT_NAME})
+ endif()
+
+ set(MAKE )
+ set(MAKE_OPTS_BASE )
+
+ find_program(NMAKE nmake REQUIRED)
+ get_filename_component(NMAKE_EXE_PATH ${NMAKE} DIRECTORY)
+ # Load toolchains
+ if(NOT VCPKG_CHAINLOAD_TOOLCHAIN_FILE)
+ set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${SCRIPTS}/toolchains/windows.cmake")
+ endif()
+ include("${VCPKG_CHAINLOAD_TOOLCHAIN_FILE}")
+ # Set needed env
+ set(ENV{PATH} "$ENV{PATH};${NMAKE_EXE_PATH}")
+ set(ENV{INCLUDE} "${CURRENT_INSTALLED_DIR}/include;$ENV{INCLUDE}")
+ # Set make command and install command
+ set(MAKE ${NMAKE} /NOLOGO /G /U)
+ set(MAKE_OPTS_BASE -f ${MAKEFILE_NAME})
+ if (_bn_ENABLE_INSTALL)
+ set(INSTALL_COMMAND install)
+ endif()
+ if (_bn_TARGET)
+ set(MAKE_OPTS_BASE ${MAKE_OPTS_BASE} ${_bn_TARGET} ${INSTALL_COMMAND})
+ else()
+ set(MAKE_OPTS_BASE ${MAKE_OPTS_BASE} all ${INSTALL_COMMAND})
+ endif()
+ # Add subpath to work directory
+ if (_bn_PROJECT_SUBPATH)
+ set(_bn_PROJECT_SUBPATH /${_bn_PROJECT_SUBPATH})
+ else()
+ set(_bn_PROJECT_SUBPATH )
+ endif()
+
+ foreach(BUILDTYPE "debug" "release")
+ if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL BUILDTYPE)
+ if(BUILDTYPE STREQUAL "debug")
+ # Skip debug generate
+ if (_bn_NO_DEBUG)
+ continue()
+ endif()
+ # Generate obj dir suffix
+ set(SHORT_BUILDTYPE "-dbg")
+ set(CONFIG "Debug")
+ # Add install command and arguments
+ set(MAKE_OPTS ${MAKE_OPTS_BASE})
+ if (_bn_ENABLE_INSTALL)
+ set(INSTALL_OPTS INSTALLDIR=${CURRENT_PACKAGES_DIR}/debug)
+ set(MAKE_OPTS ${MAKE_OPTS} ${INSTALL_OPTS})
+ endif()
+ set(MAKE_OPTS ${MAKE_OPTS} ${_bn_OPTIONS} ${_bn_OPTIONS_DEBUG})
+
+ unset(ENV{CL})
+ set(TMP_CL_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_DEBUG}")
+ string(REPLACE "/" "-" TMP_CL_FLAGS "${TMP_CL_FLAGS}")
+ set(ENV{CL} "$ENV{CL} ${TMP_CL_FLAGS}")
+ else()
+ # In NO_DEBUG mode, we only use ${TARGET_TRIPLET} directory.
+ if (_bn_NO_DEBUG)
+ set(SHORT_BUILDTYPE "")
+ else()
+ set(SHORT_BUILDTYPE "-rel")
+ endif()
+ set(CONFIG "Release")
+ # Add install command and arguments
+ set(MAKE_OPTS ${MAKE_OPTS_BASE})
+ if (_bn_ENABLE_INSTALL)
+ set(INSTALL_OPTS INSTALLDIR=${CURRENT_PACKAGES_DIR})
+ set(MAKE_OPTS ${MAKE_OPTS} ${INSTALL_OPTS})
+ endif()
+ set(MAKE_OPTS ${MAKE_OPTS} ${_bn_OPTIONS} ${_bn_OPTIONS_RELEASE})
+
+ unset(ENV{CL})
+ set(TMP_CL_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELEASE}")
+ string(REPLACE "/" "-" TMP_CL_FLAGS "${TMP_CL_FLAGS}")
+ set(ENV{CL} "$ENV{CL} ${TMP_CL_FLAGS}")
+ endif()
+
+ set(CURRENT_TRIPLET_NAME ${TARGET_TRIPLET}${SHORT_BUILDTYPE})
+ set(OBJ_DIR ${CURRENT_BUILDTREES_DIR}/${CURRENT_TRIPLET_NAME})
+
+ file(REMOVE_RECURSE ${OBJ_DIR})
+ file(MAKE_DIRECTORY ${OBJ_DIR})
+ file(GLOB_RECURSE SOURCE_FILES ${_bn_SOURCE_PATH}/*)
+ foreach(ONE_SOUCRCE_FILE ${SOURCE_FILES})
+ get_filename_component(DST_DIR ${ONE_SOUCRCE_FILE} PATH)
+ string(REPLACE "${_bn_SOURCE_PATH}" "${OBJ_DIR}" DST_DIR "${DST_DIR}")
+ file(COPY ${ONE_SOUCRCE_FILE} DESTINATION ${DST_DIR})
+ endforeach()
+
+ if (_bn_PRERUN_SHELL)
+ message(STATUS "Prerunning ${CURRENT_TRIPLET_NAME}")
+ vcpkg_execute_required_process(
+ COMMAND ${_bn_PRERUN_SHELL}
+ WORKING_DIRECTORY ${OBJ_DIR}${_bn_PROJECT_SUBPATH}
+ LOGNAME "$prerun-${CURRENT_TRIPLET_NAME}"
+ )
+ endif()
+ if (BUILDTYPE STREQUAL "debug" AND _bn_PRERUN_SHELL_DEBUG)
+ message(STATUS "Prerunning ${CURRENT_TRIPLET_NAME}")
+ vcpkg_execute_required_process(
+ COMMAND ${_bn_PRERUN_SHELL_DEBUG}
+ WORKING_DIRECTORY ${OBJ_DIR}${_bn_PROJECT_SUBPATH}
+ LOGNAME "prerun-${CURRENT_TRIPLET_NAME}-dbg"
+ )
+ endif()
+ if (BUILDTYPE STREQUAL "release" AND _bn_PRERUN_SHELL_RELEASE)
+ message(STATUS "Prerunning ${CURRENT_TRIPLET_NAME}")
+ vcpkg_execute_required_process(
+ COMMAND ${_bn_PRERUN_SHELL_RELEASE}
+ WORKING_DIRECTORY ${OBJ_DIR}${_bn_PROJECT_SUBPATH}
+ LOGNAME "prerun-${CURRENT_TRIPLET_NAME}-rel"
+ )
+ endif()
+
+ if (NOT _bn_ENABLE_INSTALL)
+ message(STATUS "Building ${CURRENT_TRIPLET_NAME}")
+ else()
+ message(STATUS "Building and installing ${CURRENT_TRIPLET_NAME}")
+ endif()
+
+ vcpkg_execute_build_process(
+ COMMAND ${MAKE} ${MAKE_OPTS}
+ WORKING_DIRECTORY ${OBJ_DIR}${_bn_PROJECT_SUBPATH}
+ LOGNAME "${_bn_LOGFILE_ROOT}-${CURRENT_TRIPLET_NAME}"
+ )
+
+ if(_bn_ADD_BIN_TO_PATH)
+ set(ENV{PATH} "${_BACKUP_ENV_PATH}")
+ endif()
+ endif()
+ endforeach()
+endfunction()
diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_build_qmake.cmake b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_build_qmake.cmake new file mode 100644 index 000000000..6b85234c8 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_build_qmake.cmake @@ -0,0 +1,109 @@ +#[===[.md: +# vcpkg_build_qmake + +Build a qmake-based project, previously configured using vcpkg_configure_qmake. + +```cmake +vcpkg_build_qmake() +``` +#]===] + +function(vcpkg_build_qmake) + # parse parameters such that semicolons in options arguments to COMMAND don't get erased + cmake_parse_arguments(PARSE_ARGV 0 _csc "SKIP_MAKEFILES" "BUILD_LOGNAME" "TARGETS;RELEASE_TARGETS;DEBUG_TARGETS") + + if(CMAKE_HOST_WIN32) + if (VCPKG_QMAKE_USE_NMAKE) + find_program(NMAKE nmake) + set(INVOKE "${NMAKE}") + get_filename_component(NMAKE_EXE_PATH ${NMAKE} DIRECTORY) + set(PATH_GLOBAL "$ENV{PATH}") + set(ENV{PATH} "$ENV{PATH};${NMAKE_EXE_PATH}") + set(ENV{CL} "$ENV{CL} /MP${VCPKG_CONCURRENCY}") + else() + vcpkg_find_acquire_program(JOM) + set(INVOKE "${JOM}") + endif() + else() + find_program(MAKE make) + set(INVOKE "${MAKE}") + endif() + + # Make sure that the linker finds the libraries used + set(ENV_PATH_BACKUP "$ENV{PATH}") + + file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}" NATIVE_INSTALLED_DIR) + + if(NOT _csc_BUILD_LOGNAME) + set(_csc_BUILD_LOGNAME build) + endif() + + function(run_jom TARGETS LOG_PREFIX LOG_SUFFIX) + message(STATUS "Package ${LOG_PREFIX}-${TARGET_TRIPLET}-${LOG_SUFFIX}") + vcpkg_execute_build_process( + COMMAND ${INVOKE} -j ${VCPKG_CONCURRENCY} ${TARGETS} + NO_PARALLEL_COMMAND ${INVOKE} -j 1 ${TARGETS} + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${LOG_SUFFIX} + LOGNAME package-${LOG_PREFIX}-${TARGET_TRIPLET}-${LOG_SUFFIX} + ) + endfunction() + + # This fixes issues on machines with default codepages that are not ASCII compatible, such as some CJK encodings + set(ENV_CL_BACKUP "$ENV{_CL_}") + set(ENV{_CL_} "/utf-8") + + #Replace with VCPKG variables if PR #7733 is merged + unset(BUILDTYPES) + if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") + set(_buildname "DEBUG") + list(APPEND BUILDTYPES ${_buildname}) + set(_short_name_${_buildname} "dbg") + set(_path_suffix_${_buildname} "/debug") + endif() + if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") + set(_buildname "RELEASE") + list(APPEND BUILDTYPES ${_buildname}) + set(_short_name_${_buildname} "rel") + set(_path_suffix_${_buildname} "") + endif() + unset(_buildname) + + foreach(_buildname ${BUILDTYPES}) + set(_installed_prefix_ "${CURRENT_INSTALLED_DIR}${_path_suffix_${_buildname}}") + set(_installed_libpath_ "${_installed_prefix_}/lib/${VCPKG_HOST_PATH_SEPARATOR}${_installed_prefix_}/lib/manual-link/") + + vcpkg_add_to_path(PREPEND "${_installed_prefix_}/bin") + vcpkg_add_to_path(PREPEND "${_installed_prefix_}/lib") + + # We set LD_LIBRARY_PATH ENV variable to allow executing Qt tools (rcc,...) even with dynamic linking + if(CMAKE_HOST_UNIX) + if(DEFINED ENV{LD_LIBRARY_PATH}) + set(_ld_library_path_defined_ TRUE) + set(_ld_library_path_backup_ $ENV{LD_LIBRARY_PATH}) + set(ENV{LD_LIBRARY_PATH} "${_installed_libpath_}${VCPKG_HOST_PATH_SEPARATOR}${_ld_library_path_backup_}") + else() + set(_ld_library_path_defined_ FALSE) + set(ENV{LD_LIBRARY_PATH} "${_installed_libpath_}") + endif() + endif() + + list(APPEND _csc_${_buildname}_TARGETS ${_csc_TARGETS}) + if(NOT _csc_SKIP_MAKEFILES) + run_jom(qmake_all makefiles ${_short_name_${_buildname}}) + endif() + run_jom("${_csc_${_buildname}_TARGETS}" ${_csc_BUILD_LOGNAME} ${_short_name_${_buildname}}) + + # Restore backup + if(CMAKE_HOST_UNIX) + if(_ld_library_path_defined_) + set(ENV{LD_LIBRARY_PATH} "${_ld_library_path_backup_}") + else() + unset(ENV{LD_LIBRARY_PATH}) + endif() + endif() + endforeach() + + # Restore the original value of ENV{PATH} + set(ENV{PATH} "${ENV_PATH_BACKUP}") + set(ENV{_CL_} "${ENV_CL_BACKUP}") +endfunction() diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_buildpath_length_warning.cmake b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_buildpath_length_warning.cmake new file mode 100644 index 000000000..7b4032e7c --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_buildpath_length_warning.cmake @@ -0,0 +1,22 @@ +#[===[.md:
+# vcpkg_buildpath_length_warning
+
+Warns the user if their vcpkg installation path might be too long for the package they're installing.
+
+```cmake
+vcpkg_buildpath_length_warning(<N>)
+```
+
+`vcpkg_buildpath_length_warning` warns the user if the number of bytes in the
+path to `buildtrees` is bigger than `N`. Note that this is simply a warning,
+and isn't relied on for correctness.
+#]===]
+
+function(vcpkg_buildpath_length_warning warning_length)
+ string(LENGTH "${CURRENT_BUILDTREES_DIR}" buildtrees_path_length)
+ if(buildtrees_path_length GREATER warning_length AND CMAKE_HOST_WIN32)
+ message(WARNING "${PORT}'s buildsystem uses very long paths and may fail on your system.\n"
+ "We recommend moving vcpkg to a short path such as 'C:\\src\\vcpkg' or using the subst command."
+ )
+ endif()
+endfunction()
diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_check_features.cmake b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_check_features.cmake new file mode 100644 index 000000000..7679b0d11 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_check_features.cmake @@ -0,0 +1,233 @@ +#[===[.md: +# vcpkg_check_features +Check if one or more features are a part of a package installation. + +```cmake +vcpkg_check_features( + OUT_FEATURE_OPTIONS <out-var> + [PREFIX <prefix>] + [FEATURES + [<feature-name> <feature-var>]... + ] + [INVERTED_FEATURES + [<feature-name> <feature-var>]... + ] +) +``` + +The `<out-var>` should be set to `FEATURE_OPTIONS` by convention. + +`vcpkg_check_features()` will: + +- for each `<feature-name>` passed in `FEATURES`: + - if the feature is set, add `-D<feature-var>=ON` to `<out-var>`, + and set `<prefix>_<feature-var>` to ON. + - if the feature is not set, add `-D<feature-var>=OFF` to `<out-var>`, + and set `<prefix>_<feature-var>` to OFF. +- for each `<feature-name>` passed in `INVERTED_FEATURES`: + - if the feature is set, add `-D<feature-var>=OFF` to `<out-var>`, + and set `<prefix>_<feature-var>` to OFF. + - if the feature is not set, add `-D<feature-var>=ON` to `<out-var>`, + and set `<prefix>_<feature-var>` to ON. + +If `<prefix>` is not passed, then the feature vars set are simply `<feature-var>`, +not `_<feature-var>`. + +If `INVERTED_FEATURES` is not passed, then the `FEATURES` keyword is optional. +This behavior is deprecated. + +If the same `<feature-var>` is passed multiple times, +then `vcpkg_check_features` will cause a fatal error, +since that is a bug. + +## Examples + +### Example 1: Regular features + +```cmake +$ ./vcpkg install mimalloc[asm,secure] + +# ports/mimalloc/portfile.cmake +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + FEATURES + asm MI_SEE_ASM + override MI_OVERRIDE + secure MI_SECURE +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + # Expands to "-DMI_SEE_ASM=ON;-DMI_OVERRIDE=OFF;-DMI_SECURE=ON" + ${FEATURE_OPTIONS} +) +``` + +### Example 2: Inverted features + +```cmake +$ ./vcpkg install cpprestsdk[websockets] + +# ports/cpprestsdk/portfile.cmake +vcpkg_check_features( + INVERTED_FEATURES + brotli CPPREST_EXCLUDE_BROTLI + websockets CPPREST_EXCLUDE_WEBSOCKETS +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + # Expands to "-DCPPREST_EXCLUDE_BROTLI=ON;-DCPPREST_EXCLUDE_WEBSOCKETS=OFF" + ${FEATURE_OPTIONS} +) +``` + +### Example 3: Set multiple options for same feature + +```cmake +$ ./vcpkg install pcl[cuda] + +# ports/pcl/portfile.cmake +vcpkg_check_features( + FEATURES + cuda WITH_CUDA + cuda BUILD_CUDA + cuda BUILD_GPU +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + # Expands to "-DWITH_CUDA=ON;-DBUILD_CUDA=ON;-DBUILD_GPU=ON" + ${FEATURE_OPTIONS} +) +``` + +### Example 4: Use regular and inverted features + +```cmake +$ ./vcpkg install rocksdb[tbb] + +# ports/rocksdb/portfile.cmake +vcpkg_check_features( + FEATURES + tbb WITH_TBB + INVERTED_FEATURES + tbb ROCKSDB_IGNORE_PACKAGE_TBB +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + # Expands to "-DWITH_TBB=ON;-DROCKSDB_IGNORE_PACKAGE_TBB=OFF" + ${FEATURE_OPTIONS} +) +``` + +## Examples in portfiles + +* [cpprestsdk](https://github.com/microsoft/vcpkg/blob/master/ports/cpprestsdk/portfile.cmake) +* [pcl](https://github.com/microsoft/vcpkg/blob/master/ports/pcl/portfile.cmake) +* [rocksdb](https://github.com/microsoft/vcpkg/blob/master/ports/rocksdb/portfile.cmake) +#]===] + +function(z_vcpkg_check_features_last_feature out_var features_name features_list) + list(LENGTH features_list features_length) + math(EXPR features_length_mod_2 "${features_length} % 2") + if(NOT features_length_mod_2 EQUAL 0) + message(FATAL_ERROR "vcpkg_check_features has an incorrect number of arguments to ${features_name}") + endif() + + math(EXPR last_feature "${features_length} / 2 - 1") + set("${out_var}" "${last_feature}" PARENT_SCOPE) +endfunction() + +function(z_vcpkg_check_features_get_feature idx features_list out_feature_name out_feature_var) + math(EXPR feature_name_idx "${idx} * 2") + math(EXPR feature_var_idx "${feature_name_idx} + 1") + + list(GET features_list "${feature_name_idx}" feature_name) + list(GET features_list "${feature_var_idx}" feature_var) + + set("${out_feature_name}" "${feature_name}" PARENT_SCOPE) + set("${out_feature_var}" "${feature_var}" PARENT_SCOPE) +endfunction() + +function(vcpkg_check_features) + cmake_parse_arguments( + PARSE_ARGV 0 "arg" + "" + "OUT_FEATURE_OPTIONS;PREFIX" + "FEATURES;INVERTED_FEATURES" + ) + + if(NOT DEFINED arg_OUT_FEATURE_OPTIONS) + message(FATAL_ERROR "OUT_FEATURE_OPTIONS must be defined.") + endif() + if(NOT DEFINED arg_PREFIX) + set(prefix "") + else() + set(prefix "${arg_PREFIX}_") + endif() + + set(feature_options) + set(feature_variables) + + if(NOT DEFINED arg_FEATURES AND NOT DEFINED arg_INVERTED_FEATURES) + message(DEPRECATION +"calling `vcpkg_check_features` without the `FEATURES` keyword has been deprecated. + Please add the `FEATURES` keyword to the call.") + set(arg_FEATURES "${arg_UNPARSED_ARGUMENTS}") + elseif(DEFINED arg_UNPARSED_ARGUMENTS) + message(FATAL_ERROR "vcpkg_check_features called with unknown arguments: ${arg_UNPARSED_ARGUMENTS}") + endif() + + + + z_vcpkg_check_features_last_feature(last_feature "FEATURES" "${arg_FEATURES}") + if(last_feature GREATER_EQUAL 0) + foreach(feature_pair_idx RANGE "${last_feature}") + z_vcpkg_check_features_get_feature("${feature_pair_idx}" "${arg_FEATURES}" feature_name feature_var) + + list(APPEND feature_variables "${feature_var}") + if(feature_name IN_LIST FEATURES) + list(APPEND feature_options "-D${feature_var}=ON") + set("${prefix}${feature_var}" ON PARENT_SCOPE) + else() + list(APPEND feature_options "-D${feature_var}=OFF") + set("${prefix}${feature_var}" OFF PARENT_SCOPE) + endif() + endforeach() + endif() + + z_vcpkg_check_features_last_feature(last_inverted_feature "INVERTED_FEATURES" "${arg_INVERTED_FEATURES}") + if(last_inverted_feature GREATER_EQUAL 0) + foreach(feature_pair_idx RANGE "${last_inverted_feature}") + z_vcpkg_check_features_get_feature("${feature_pair_idx}" "${arg_INVERTED_FEATURES}" feature_name feature_var) + + list(APPEND feature_variables "${feature_var}") + if(feature_name IN_LIST FEATURES) + list(APPEND feature_options "-D${feature_var}=OFF") + set("${prefix}${feature_var}" OFF PARENT_SCOPE) + else() + list(APPEND feature_options "-D${feature_var}=ON") + set("${prefix}${feature_var}" ON PARENT_SCOPE) + endif() + endforeach() + endif() + + list(SORT feature_variables) + set(last_variable) + foreach(variable IN LISTS feature_variables) + if(variable STREQUAL last_variable) + message(FATAL_ERROR "vcpkg_check_features passed the same feature variable multiple times: '${variable}'") + endif() + endforeach() + + set("${arg_OUT_FEATURE_OPTIONS}" "${feature_options}" PARENT_SCOPE) +endfunction() diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_check_linkage.cmake b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_check_linkage.cmake new file mode 100644 index 000000000..97e29bad7 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_check_linkage.cmake @@ -0,0 +1,58 @@ +#[===[.md:
+# vcpkg_check_linkage
+
+Asserts the available library and CRT linkage options for the port.
+
+## Usage
+```cmake
+vcpkg_check_linkage(
+ [ONLY_STATIC_LIBRARY | ONLY_DYNAMIC_LIBRARY]
+ [ONLY_STATIC_CRT | ONLY_DYNAMIC_CRT]
+)
+```
+
+## Parameters
+### ONLY_STATIC_LIBRARY
+Indicates that this port can only be built with static library linkage.
+
+Note: If the user requested a dynamic build ONLY_STATIC_LIBRARY will result in a note being printed, not a fatal error.
+
+### ONLY_DYNAMIC_LIBRARY
+Indicates that this port can only be built with dynamic/shared library linkage.
+
+### ONLY_STATIC_CRT
+Indicates that this port can only be built with static CRT linkage.
+
+### ONLY_DYNAMIC_CRT
+Indicates that this port can only be built with dynamic/shared CRT linkage.
+
+## Notes
+This command will either alter the settings for `VCPKG_LIBRARY_LINKAGE` or fail, depending on what was requested by the user versus what the library supports.
+
+## Examples
+
+* [abseil](https://github.com/Microsoft/vcpkg/blob/master/ports/abseil/portfile.cmake)
+#]===]
+
+function(vcpkg_check_linkage)
+ cmake_parse_arguments(_csc "ONLY_STATIC_LIBRARY;ONLY_DYNAMIC_LIBRARY;ONLY_DYNAMIC_CRT;ONLY_STATIC_CRT" "" "" ${ARGN})
+
+ if(_csc_ONLY_STATIC_LIBRARY AND VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
+ message(STATUS "Note: ${PORT} only supports static library linkage. Building static library.")
+ set(VCPKG_LIBRARY_LINKAGE static PARENT_SCOPE)
+ endif()
+ if(_csc_ONLY_DYNAMIC_LIBRARY AND VCPKG_LIBRARY_LINKAGE STREQUAL "static")
+ message(STATUS "Note: ${PORT} only supports dynamic library linkage. Building dynamic library.")
+ if(VCPKG_CRT_LINKAGE STREQUAL "static")
+ message(FATAL_ERROR "Refusing to build unexpected dynamic library against the static CRT. If this is desired, please configure your triplet to directly request this configuration.")
+ endif()
+ set(VCPKG_LIBRARY_LINKAGE dynamic PARENT_SCOPE)
+ endif()
+
+ if(_csc_ONLY_DYNAMIC_CRT AND VCPKG_CRT_LINKAGE STREQUAL "static")
+ message(FATAL_ERROR "${PORT} only supports dynamic crt linkage")
+ endif()
+ if(_csc_ONLY_STATIC_CRT AND VCPKG_CRT_LINKAGE STREQUAL "dynamic")
+ message(FATAL_ERROR "${PORT} only supports static crt linkage")
+ endif()
+endfunction()
diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_clean_executables_in_bin.cmake b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_clean_executables_in_bin.cmake new file mode 100644 index 000000000..077e23cc3 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_clean_executables_in_bin.cmake @@ -0,0 +1,64 @@ +#[===[.md:
+# vcpkg_clean_executables_in_bin
+
+Remove specified executables found in `${CURRENT_PACKAGES_DIR}/bin` and `${CURRENT_PACKAGES_DIR}/debug/bin`. If, after all specified executables have been removed, and the `bin` and `debug/bin` directories are empty, then also delete `bin` and `debug/bin` directories.
+
+## Usage
+```cmake
+vcpkg_clean_executables_in_bin(
+ FILE_NAMES <file1>...
+)
+```
+
+## Parameters
+### FILE_NAMES
+A list of executable filenames without extension.
+
+## Notes
+Generally, there is no need to call this function manually. Instead, pass an extra `AUTO_CLEAN` argument when calling `vcpkg_copy_tools`.
+
+## Examples
+* [czmq](https://github.com/microsoft/vcpkg/blob/master/ports/czmq/portfile.cmake)
+#]===]
+
+function(vcpkg_clean_executables_in_bin)
+ # parse parameters such that semicolons in options arguments to COMMAND don't get erased
+ cmake_parse_arguments(PARSE_ARGV 0 _vct "" "" "FILE_NAMES")
+
+ if(NOT DEFINED _vct_FILE_NAMES)
+ message(FATAL_ERROR "FILE_NAMES must be specified.")
+ endif()
+
+ foreach(file_name IN LISTS _vct_FILE_NAMES)
+ file(REMOVE
+ "${CURRENT_PACKAGES_DIR}/bin/${file_name}${VCPKG_TARGET_EXECUTABLE_SUFFIX}"
+ "${CURRENT_PACKAGES_DIR}/debug/bin/${file_name}${VCPKG_TARGET_EXECUTABLE_SUFFIX}"
+ "${CURRENT_PACKAGES_DIR}/bin/${file_name}.pdb"
+ "${CURRENT_PACKAGES_DIR}/debug/bin/${file_name}.pdb"
+ )
+ endforeach()
+
+ function(try_remove_empty_directory directory)
+ if(NOT EXISTS "${directory}")
+ return()
+ endif()
+
+ if(NOT IS_DIRECTORY "${directory}")
+ message(FATAL_ERROR "${directory} is supposed to be an existing directory.")
+ endif()
+
+ # TODO:
+ # For an empty directory,
+ # file(GLOB items "${directory}" "${directory}/*")
+ # will return a list with one item.
+ file(GLOB items "${directory}/" "${directory}/*")
+ list(LENGTH items items_count)
+
+ if(${items_count} EQUAL 0)
+ file(REMOVE_RECURSE "${directory}")
+ endif()
+ endfunction()
+
+ try_remove_empty_directory("${CURRENT_PACKAGES_DIR}/bin")
+ try_remove_empty_directory("${CURRENT_PACKAGES_DIR}/debug/bin")
+endfunction()
diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_clean_msbuild.cmake b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_clean_msbuild.cmake new file mode 100644 index 000000000..ead78706d --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_clean_msbuild.cmake @@ -0,0 +1,21 @@ +#[===[.md: +# vcpkg_clean_msbuild + +Clean intermediate files generated by `vcpkg_install_msbuild()`. + +## Usage +```cmake +vcpkg_clean_msbuild() +``` + +## Examples + +* [xalan-c](https://github.com/Microsoft/vcpkg/blob/master/ports/xalan-c/portfile.cmake) +#]===] + +function(vcpkg_clean_msbuild) + file(REMOVE_RECURSE + ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg + ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel + ) +endfunction() diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_common_definitions.cmake b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_common_definitions.cmake new file mode 100644 index 000000000..f12e909d9 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_common_definitions.cmake @@ -0,0 +1,208 @@ +#[===[.md: +# vcpkg_common_definitions + +This file defines the following variables which are commonly needed or used in portfiles: + +```cmake +VCPKG_TARGET_IS_<target> with <target> being one of the following: WINDOWS, UWP, LINUX, OSX, ANDROID, FREEBSD, OPENBSD. only defined if <target> +VCPKG_HOST_IS_<target> with <host> being one of the following: WINDOWS, LINUX, OSX, FREEBSD, OPENBSD. only defined if <host> +VCPKG_HOST_PATH_SEPARATOR Host specific path separator (USAGE: "<something>${VCPKG_HOST_PATH_SEPARATOR}<something>"; only use and pass variables with VCPKG_HOST_PATH_SEPARATOR within "") +VCPKG_HOST_EXECUTABLE_SUFFIX executable suffix of the host +VCPKG_TARGET_EXECUTABLE_SUFFIX executable suffix of the target +VCPKG_TARGET_STATIC_LIBRARY_PREFIX static library prefix for target (same as CMAKE_STATIC_LIBRARY_PREFIX) +VCPKG_TARGET_STATIC_LIBRARY_SUFFIX static library suffix for target (same as CMAKE_STATIC_LIBRARY_SUFFIX) +VCPKG_TARGET_SHARED_LIBRARY_PREFIX shared library prefix for target (same as CMAKE_SHARED_LIBRARY_PREFIX) +VCPKG_TARGET_SHARED_LIBRARY_SUFFIX shared library suffix for target (same as CMAKE_SHARED_LIBRARY_SUFFIX) +VCPKG_TARGET_IMPORT_LIBRARY_PREFIX import library prefix for target (same as CMAKE_IMPORT_LIBRARY_PREFIX) +VCPKG_TARGET_IMPORT_LIBRARY_SUFFIX import library suffix for target (same as CMAKE_IMPORT_LIBRARY_SUFFIX) +VCPKG_FIND_LIBRARY_PREFIXES target dependent prefixes used for find_library calls in portfiles +VCPKG_FIND_LIBRARY_SUFFIXES target dependent suffixes used for find_library calls in portfiles +VCPKG_SYSTEM_LIBRARIES list of libraries are provide by the toolchain and are not managed by vcpkg +TARGET_TRIPLET the name of the current triplet to build for +CURRENT_INSTALLED_DIR the absolute path to the installed files for the current triplet +HOST_TRIPLET the name of the triplet corresponding to the host +CURRENT_HOST_INSTALLED_DIR the absolute path to the installed files for the host triplet +VCPKG_CROSSCOMPILING Whether vcpkg is cross-compiling: in other words, whether TARGET_TRIPLET and HOST_TRIPLET are different +``` + +CMAKE_STATIC_LIBRARY_(PREFIX|SUFFIX), CMAKE_SHARED_LIBRARY_(PREFIX|SUFFIX) and CMAKE_IMPORT_LIBRARY_(PREFIX|SUFFIX) are defined for the target +Furthermore the variables CMAKE_FIND_LIBRARY_(PREFIXES|SUFFIXES) are also defined for the target so that +portfiles are able to use find_library calls to discover dependent libraries within the current triplet for ports. +#]===] + +string(COMPARE NOTEQUAL "${TARGET_TRIPLET}" "${HOST_TRIPLET}" VCPKG_CROSSCOMPILING) +#Helper variable to identify the Target system. VCPKG_TARGET_IS_<targetname> +if (NOT DEFINED VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "") + set(VCPKG_TARGET_IS_WINDOWS ON) +elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") + set(VCPKG_TARGET_IS_WINDOWS ON) + set(VCPKG_TARGET_IS_UWP ON) +elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Darwin") + set(VCPKG_TARGET_IS_OSX ON) +elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "iOS") + set(VCPKG_TARGET_IS_IOS ON) +elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Linux") + set(VCPKG_TARGET_IS_LINUX ON) +elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Android") + set(VCPKG_TARGET_IS_ANDROID ON) +elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") + set(VCPKG_TARGET_IS_FREEBSD ON) +elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "OpenBSD") + set(VCPKG_TARGET_IS_OPENBSD ON) +elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "MinGW") + set(VCPKG_TARGET_IS_WINDOWS ON) + set(VCPKG_TARGET_IS_MINGW ON) +endif() + +#Helper variables to identify the host system name +if (CMAKE_HOST_WIN32) + set(VCPKG_HOST_IS_WINDOWS ON) +elseif (CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin") + set(VCPKG_HOST_IS_OSX ON) +elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux") + set(VCPKG_HOST_IS_LINUX ON) +elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "FreeBSD") + set(VCPKG_HOST_IS_FREEBSD ON) +elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "OpenBSD") + set(VCPKG_HOST_IS_OPENBSD ON) +endif() + +#Helper variable to identify the host path separator. +if(CMAKE_HOST_WIN32) + set(VCPKG_HOST_PATH_SEPARATOR ";") +elseif(CMAKE_HOST_UNIX) + set(VCPKG_HOST_PATH_SEPARATOR ":") +endif() + +#Helper variables to identify executables on host/target +if(CMAKE_HOST_WIN32) + set(VCPKG_HOST_EXECUTABLE_SUFFIX ".exe") +else() + set(VCPKG_HOST_EXECUTABLE_SUFFIX "") +endif() +#set(CMAKE_EXECUTABLE_SUFFIX ${VCPKG_HOST_EXECUTABLE_SUFFIX}) not required by find_program + +if(VCPKG_TARGET_IS_WINDOWS) + set(VCPKG_TARGET_EXECUTABLE_SUFFIX ".exe") +else() + set(VCPKG_TARGET_EXECUTABLE_SUFFIX "") +endif() + +#Helper variables for libraries +if(VCPKG_TARGET_IS_MINGW) + set(VCPKG_TARGET_STATIC_LIBRARY_SUFFIX ".a") + set(VCPKG_TARGET_IMPORT_LIBRARY_SUFFIX ".dll.a") + set(VCPKG_TARGET_SHARED_LIBRARY_SUFFIX ".dll") + set(VCPKG_TARGET_STATIC_LIBRARY_PREFIX "lib") + set(VCPKG_TARGET_SHARED_LIBRARY_PREFIX "lib") + set(VCPKG_TARGET_IMPORT_LIBRARY_PREFIX "lib") + set(VCPKG_FIND_LIBRARY_SUFFIXES ".dll" ".dll.a" ".a" ".lib") + set(VCPKG_FIND_LIBRARY_PREFIXES "lib" "") +elseif(VCPKG_TARGET_IS_WINDOWS) + set(VCPKG_TARGET_STATIC_LIBRARY_SUFFIX ".lib") + set(VCPKG_TARGET_IMPORT_LIBRARY_SUFFIX ".lib") + set(VCPKG_TARGET_SHARED_LIBRARY_SUFFIX ".dll") + set(VCPKG_TARGET_IMPORT_LIBRARY_SUFFIX ".lib") + set(VCPKG_TARGET_STATIC_LIBRARY_PREFIX "") + set(VCPKG_TARGET_SHARED_LIBRARY_PREFIX "") + set(VCPKG_TARGET_IMPORT_LIBRARY_PREFIX "") + set(VCPKG_FIND_LIBRARY_SUFFIXES ".lib" ".dll") #This is a slight modification to CMakes value which does not include ".dll". + set(VCPKG_FIND_LIBRARY_PREFIXES "" "lib") #This is a slight modification to CMakes value which does not include "lib". +elseif(VCPKG_TARGET_IS_OSX) + set(VCPKG_TARGET_STATIC_LIBRARY_SUFFIX ".a") + set(VCPKG_TARGET_IMPORT_LIBRARY_SUFFIX "") + set(VCPKG_TARGET_SHARED_LIBRARY_SUFFIX ".dylib") + set(VCPKG_TARGET_STATIC_LIBRARY_PREFIX "lib") + set(VCPKG_TARGET_SHARED_LIBRARY_PREFIX "lib") + set(VCPKG_FIND_LIBRARY_SUFFIXES ".tbd" ".dylib" ".so" ".a") + set(VCPKG_FIND_LIBRARY_PREFIXES "lib" "") +else() + set(VCPKG_TARGET_STATIC_LIBRARY_SUFFIX ".a") + set(VCPKG_TARGET_IMPORT_LIBRARY_SUFFIX "") + set(VCPKG_TARGET_SHARED_LIBRARY_SUFFIX ".so") + set(VCPKG_TARGET_STATIC_LIBRARY_PREFIX "lib") + set(VCPKG_TARGET_SHARED_LIBRARY_PREFIX "lib") + set(VCPKG_FIND_LIBRARY_SUFFIXES ".so" ".a") + set(VCPKG_FIND_LIBRARY_PREFIXES "lib" "") +endif() +#Setting these variables allows find_library to work in script mode and thus in portfiles! +#This allows us scale down on hardcoded target dependent paths in portfiles +set(CMAKE_STATIC_LIBRARY_SUFFIX "${VCPKG_TARGET_STATIC_LIBRARY_SUFFIX}") +set(CMAKE_SHARED_LIBRARY_SUFFIX "${VCPKG_TARGET_SHARED_LIBRARY_SUFFIX}") +set(CMAKE_IMPORT_LIBRARY_SUFFIX "${VCPKG_TARGET_IMPORT_LIBRARY_SUFFIX}") +set(CMAKE_STATIC_LIBRARY_PREFIX "${VCPKG_TARGET_STATIC_LIBRARY_PREFIX}") +set(CMAKE_SHARED_LIBRARY_PREFIX "${VCPKG_TARGET_SHARED_LIBRARY_PREFIX}") +set(CMAKE_IMPORT_LIBRARY_PREFIX "${VCPKG_TARGET_IMPORT_LIBRARY_PREFIX}") + +set(CMAKE_FIND_LIBRARY_SUFFIXES "${VCPKG_FIND_LIBRARY_SUFFIXES}" CACHE INTERNAL "") # Required by find_library +set(CMAKE_FIND_LIBRARY_PREFIXES "${VCPKG_FIND_LIBRARY_PREFIXES}" CACHE INTERNAL "") # Required by find_library + +# Append platform libraries to VCPKG_SYSTEM_LIBRARIES +# The variable are just appended to permit to custom triplets define the variable + +# Platforms with libdl +if(VCPKG_TARGET_IS_LINUX OR VCPKG_TARGET_IS_ANDROID OR VCPKG_TARGET_IS_OSX) + list(APPEND VCPKG_SYSTEM_LIBRARIES dl) +endif() + +# Platforms with libm +if(VCPKG_TARGET_IS_LINUX OR VCPKG_TARGET_IS_ANDROID OR VCPKG_TARGET_IS_FREEBSD OR VCPKG_TARGET_IS_OPENBSD OR VCPKG_TARGET_IS_OSX OR VCPKG_TARGET_IS_MINGW) + list(APPEND VCPKG_SYSTEM_LIBRARIES m) +endif() + +# Platforms with pthread +if(VCPKG_TARGET_IS_LINUX OR VCPKG_TARGET_IS_ANDROID OR VCPKG_TARGET_IS_OSX OR VCPKG_TARGET_IS_FREEBSD OR VCPKG_TARGET_IS_OPENBSD OR VCPKG_TARGET_IS_MINGW) + list(APPEND VCPKG_SYSTEM_LIBRARIES pthread) +endif() + +# Platforms with libstdc++ +if(VCPKG_TARGET_IS_LINUX OR VCPKG_TARGET_IS_ANDROID OR VCPKG_TARGET_IS_FREEBSD OR VCPKG_TARGET_IS_OPENBSD OR VCPKG_TARGET_IS_MINGW) + list(APPEND VCPKG_SYSTEM_LIBRARIES [[stdc\+\+]]) +endif() + +# Platforms with libc++ +if(VCPKG_TARGET_IS_OSX) + list(APPEND VCPKG_SYSTEM_LIBRARIES [[c\+\+]]) +endif() + +# Platforms with librt +if(VCPKG_TARGET_IS_LINUX OR VCPKG_TARGET_IS_ANDROID OR VCPKG_TARGET_IS_OSX OR VCPKG_TARGET_IS_FREEBSD OR VCPKG_TARGET_IS_MINGW) + list(APPEND VCPKG_SYSTEM_LIBRARIES rt) +endif() + +# Platforms with GCC libs +if(VCPKG_TARGET_IS_LINUX OR VCPKG_TARGET_IS_ANDROID OR VCPKG_TARGET_IS_OSX OR VCPKG_TARGET_IS_FREEBSD OR VCPKG_TARGET_IS_OPENBSD OR VCPKG_TARGET_IS_MINGW) + list(APPEND VCPKG_SYSTEM_LIBRARIES gcc) + list(APPEND VCPKG_SYSTEM_LIBRARIES gcc_s) +endif() + +# Platforms with system iconv +if(VCPKG_TARGET_IS_OSX) + list(APPEND VCPKG_SYSTEM_LIBRARIES iconv) +endif() + +# Windows system libs +if(VCPKG_TARGET_IS_WINDOWS) + list(APPEND VCPKG_SYSTEM_LIBRARIES advapi32) + list(APPEND VCPKG_SYSTEM_LIBRARIES bcrypt) + list(APPEND VCPKG_SYSTEM_LIBRARIES dinput8) + list(APPEND VCPKG_SYSTEM_LIBRARIES gdi32) + list(APPEND VCPKG_SYSTEM_LIBRARIES imm32) + list(APPEND VCPKG_SYSTEM_LIBRARIES oleaut32) + list(APPEND VCPKG_SYSTEM_LIBRARIES ole32) + list(APPEND VCPKG_SYSTEM_LIBRARIES psapi) + list(APPEND VCPKG_SYSTEM_LIBRARIES secur32) + list(APPEND VCPKG_SYSTEM_LIBRARIES setupapi) + list(APPEND VCPKG_SYSTEM_LIBRARIES shell32) + list(APPEND VCPKG_SYSTEM_LIBRARIES shlwapi) + list(APPEND VCPKG_SYSTEM_LIBRARIES strmiids) + list(APPEND VCPKG_SYSTEM_LIBRARIES user32) + list(APPEND VCPKG_SYSTEM_LIBRARIES uuid) + list(APPEND VCPKG_SYSTEM_LIBRARIES version) + list(APPEND VCPKG_SYSTEM_LIBRARIES vfw32) + list(APPEND VCPKG_SYSTEM_LIBRARIES winmm) + list(APPEND VCPKG_SYSTEM_LIBRARIES wsock32) + list(APPEND VCPKG_SYSTEM_LIBRARIES Ws2_32) + list(APPEND VCPKG_SYSTEM_LIBRARIES wldap32) + list(APPEND VCPKG_SYSTEM_LIBRARIES crypt32) +endif() diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_common_functions.cmake b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_common_functions.cmake new file mode 100644 index 000000000..515164789 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_common_functions.cmake @@ -0,0 +1,3 @@ +# DEPRECATED
+
+message("${Z_VCPKG_BACKCOMPAT_MESSAGE_LEVEL}" "vcpkg_common_functions has been removed and all values are automatically provided in all portfile.cmake invocations. Please remove `include(vcpkg_common_functions)`.")
diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_configure_cmake.cmake b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_configure_cmake.cmake new file mode 100644 index 000000000..fdf054e43 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_configure_cmake.cmake @@ -0,0 +1,351 @@ +# DEPRECATED BY ports/vcpkg-cmake/vcpkg_cmake_configure +#[===[.md: +# vcpkg_configure_cmake + +Configure CMake for Debug and Release builds of a project. + +## Usage +```cmake +vcpkg_configure_cmake( + SOURCE_PATH <${SOURCE_PATH}> + [PREFER_NINJA] + [DISABLE_PARALLEL_CONFIGURE] + [NO_CHARSET_FLAG] + [GENERATOR <"NMake Makefiles">] + [OPTIONS <-DUSE_THIS_IN_ALL_BUILDS=1>...] + [OPTIONS_RELEASE <-DOPTIMIZE=1>...] + [OPTIONS_DEBUG <-DDEBUGGABLE=1>...] +) +``` + +## Parameters +### SOURCE_PATH +Specifies the directory containing the `CMakeLists.txt`. +By convention, this is usually set in the portfile as the variable `SOURCE_PATH`. + +### PREFER_NINJA +Indicates that, when available, Vcpkg should use Ninja to perform the build. +This should be specified unless the port is known to not work under Ninja. + +### DISABLE_PARALLEL_CONFIGURE +Disables running the CMake configure step in parallel. +This is needed for libraries which write back into their source directory during configure. + +This also disables CMAKE_DISABLE_SOURCE_CHANGES. + +### NO_CHARSET_FLAG +Disables passing `utf-8` as the default character set to `CMAKE_C_FLAGS` and `CMAKE_CXX_FLAGS`. + +This is needed for libraries that set their own source code's character set. + +### GENERATOR +Specifies the precise generator to use. + +This is useful if some project-specific buildsystem has been wrapped in a cmake script that won't perform an actual build. +If used for this purpose, it should be set to `"NMake Makefiles"`. + +### OPTIONS +Additional options passed to CMake during the configuration. + +### OPTIONS_RELEASE +Additional options passed to CMake during the Release configuration. These are in addition to `OPTIONS`. + +### OPTIONS_DEBUG +Additional options passed to CMake during the Debug configuration. These are in addition to `OPTIONS`. + +### LOGNAME +Name of the log to write the output of the configure call to. + +## Notes +This command supplies many common arguments to CMake. To see the full list, examine the source. + +## Examples + +* [zlib](https://github.com/Microsoft/vcpkg/blob/master/ports/zlib/portfile.cmake) +* [cpprestsdk](https://github.com/Microsoft/vcpkg/blob/master/ports/cpprestsdk/portfile.cmake) +* [poco](https://github.com/Microsoft/vcpkg/blob/master/ports/poco/portfile.cmake) +* [opencv](https://github.com/Microsoft/vcpkg/blob/master/ports/opencv/portfile.cmake) +#]===] + +function(vcpkg_configure_cmake) + if(Z_VCPKG_CMAKE_CONFIGURE_GUARD) + message(FATAL_ERROR "The ${PORT} port already depends on vcpkg-cmake; using both vcpkg-cmake and vcpkg_configure_cmake in the same port is unsupported.") + endif() + + cmake_parse_arguments(PARSE_ARGV 0 arg + "PREFER_NINJA;DISABLE_PARALLEL_CONFIGURE;NO_CHARSET_FLAG" + "SOURCE_PATH;GENERATOR;LOGNAME" + "OPTIONS;OPTIONS_DEBUG;OPTIONS_RELEASE" + ) + + if(NOT VCPKG_PLATFORM_TOOLSET) + message(FATAL_ERROR "Vcpkg has been updated with VS2017 support; " + "however, vcpkg.exe must be rebuilt by re-running bootstrap-vcpkg.bat\n") + endif() + + if(NOT arg_LOGNAME) + set(arg_LOGNAME config-${TARGET_TRIPLET}) + endif() + + if(CMAKE_HOST_WIN32) + if(DEFINED ENV{PROCESSOR_ARCHITEW6432}) + set(arg_HOST_ARCHITECTURE $ENV{PROCESSOR_ARCHITEW6432}) + else() + set(arg_HOST_ARCHITECTURE $ENV{PROCESSOR_ARCHITECTURE}) + endif() + endif() + + set(NINJA_CAN_BE_USED ON) # Ninja as generator + set(NINJA_HOST ON) # Ninja as parallel configurator + + if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") + set(_TARGETTING_UWP 1) + endif() + + if(arg_HOST_ARCHITECTURE STREQUAL "x86") + # Prebuilt ninja binaries are only provided for x64 hosts + set(NINJA_CAN_BE_USED OFF) + set(NINJA_HOST OFF) + elseif(_TARGETTING_UWP) + # Ninja and MSBuild have many differences when targetting UWP, so use MSBuild to maximize existing compatibility + set(NINJA_CAN_BE_USED OFF) + endif() + + if(arg_GENERATOR) + set(GENERATOR ${arg_GENERATOR}) + elseif(arg_PREFER_NINJA AND NINJA_CAN_BE_USED) + set(GENERATOR "Ninja") + elseif(VCPKG_CHAINLOAD_TOOLCHAIN_FILE OR (VCPKG_CMAKE_SYSTEM_NAME AND NOT _TARGETTING_UWP)) + set(GENERATOR "Ninja") + + elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86" AND VCPKG_PLATFORM_TOOLSET STREQUAL "v120") + set(GENERATOR "Visual Studio 12 2013") + elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64" AND VCPKG_PLATFORM_TOOLSET STREQUAL "v120") + set(GENERATOR "Visual Studio 12 2013 Win64") + elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm" AND VCPKG_PLATFORM_TOOLSET STREQUAL "v120") + set(GENERATOR "Visual Studio 12 2013 ARM") + + elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86" AND VCPKG_PLATFORM_TOOLSET STREQUAL "v140") + set(GENERATOR "Visual Studio 14 2015") + elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64" AND VCPKG_PLATFORM_TOOLSET STREQUAL "v140") + set(GENERATOR "Visual Studio 14 2015 Win64") + elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm" AND VCPKG_PLATFORM_TOOLSET STREQUAL "v140") + set(GENERATOR "Visual Studio 14 2015 ARM") + + elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86" AND VCPKG_PLATFORM_TOOLSET STREQUAL "v141") + set(GENERATOR "Visual Studio 15 2017") + elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64" AND VCPKG_PLATFORM_TOOLSET STREQUAL "v141") + set(GENERATOR "Visual Studio 15 2017 Win64") + elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm" AND VCPKG_PLATFORM_TOOLSET STREQUAL "v141") + set(GENERATOR "Visual Studio 15 2017 ARM") + elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64" AND VCPKG_PLATFORM_TOOLSET STREQUAL "v141") + set(GENERATOR "Visual Studio 15 2017") + set(ARCH "ARM64") + + elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86" AND VCPKG_PLATFORM_TOOLSET STREQUAL "v142") + set(GENERATOR "Visual Studio 16 2019") + set(ARCH "Win32") + elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64" AND VCPKG_PLATFORM_TOOLSET STREQUAL "v142") + set(GENERATOR "Visual Studio 16 2019") + set(ARCH "x64") + elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm" AND VCPKG_PLATFORM_TOOLSET STREQUAL "v142") + set(GENERATOR "Visual Studio 16 2019") + set(ARCH "ARM") + elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64" AND VCPKG_PLATFORM_TOOLSET STREQUAL "v142") + set(GENERATOR "Visual Studio 16 2019") + set(ARCH "ARM64") + + else() + if(NOT VCPKG_CMAKE_SYSTEM_NAME) + set(VCPKG_CMAKE_SYSTEM_NAME Windows) + endif() + message(FATAL_ERROR "Unable to determine appropriate generator for: " + "${VCPKG_CMAKE_SYSTEM_NAME}-${VCPKG_TARGET_ARCHITECTURE}-${VCPKG_PLATFORM_TOOLSET}") + endif() + + # If we use Ninja, make sure it's on PATH + if(GENERATOR STREQUAL "Ninja" AND NOT DEFINED ENV{VCPKG_FORCE_SYSTEM_BINARIES}) + vcpkg_find_acquire_program(NINJA) + get_filename_component(NINJA_PATH ${NINJA} DIRECTORY) + vcpkg_add_to_path("${NINJA_PATH}") + list(APPEND arg_OPTIONS "-DCMAKE_MAKE_PROGRAM=${NINJA}") + endif() + + file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) + + if(DEFINED VCPKG_CMAKE_SYSTEM_NAME) + list(APPEND arg_OPTIONS "-DCMAKE_SYSTEM_NAME=${VCPKG_CMAKE_SYSTEM_NAME}") + if(_TARGETTING_UWP AND NOT DEFINED VCPKG_CMAKE_SYSTEM_VERSION) + set(VCPKG_CMAKE_SYSTEM_VERSION 10.0) + elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Android" AND NOT DEFINED VCPKG_CMAKE_SYSTEM_VERSION) + set(VCPKG_CMAKE_SYSTEM_VERSION 21) + endif() + endif() + + if(DEFINED VCPKG_CMAKE_SYSTEM_VERSION) + list(APPEND arg_OPTIONS "-DCMAKE_SYSTEM_VERSION=${VCPKG_CMAKE_SYSTEM_VERSION}") + endif() + + if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") + list(APPEND arg_OPTIONS -DBUILD_SHARED_LIBS=ON) + elseif(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + list(APPEND arg_OPTIONS -DBUILD_SHARED_LIBS=OFF) + else() + message(FATAL_ERROR + "Invalid setting for VCPKG_LIBRARY_LINKAGE: \"${VCPKG_LIBRARY_LINKAGE}\". " + "It must be \"static\" or \"dynamic\"") + endif() + + macro(check_both_vars_are_set var1 var2) + if((NOT DEFINED ${var1} OR NOT DEFINED ${var2}) AND (DEFINED ${var1} OR DEFINED ${var2})) + message(FATAL_ERROR "Both ${var1} and ${var2} must be set.") + endif() + endmacro() + + check_both_vars_are_set(VCPKG_CXX_FLAGS_DEBUG VCPKG_C_FLAGS_DEBUG) + check_both_vars_are_set(VCPKG_CXX_FLAGS_RELEASE VCPKG_C_FLAGS_RELEASE) + check_both_vars_are_set(VCPKG_CXX_FLAGS VCPKG_C_FLAGS) + + set(VCPKG_SET_CHARSET_FLAG ON) + if(arg_NO_CHARSET_FLAG) + set(VCPKG_SET_CHARSET_FLAG OFF) + endif() + + if(NOT VCPKG_CHAINLOAD_TOOLCHAIN_FILE) + if(NOT DEFINED VCPKG_CMAKE_SYSTEM_NAME OR _TARGETTING_UWP) + set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${SCRIPTS}/toolchains/windows.cmake") + elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Linux") + set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${SCRIPTS}/toolchains/linux.cmake") + elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Android") + set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${SCRIPTS}/toolchains/android.cmake") + elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Darwin") + set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${SCRIPTS}/toolchains/osx.cmake") + elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "iOS") + set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${SCRIPTS}/toolchains/ios.cmake") + elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") + set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${SCRIPTS}/toolchains/freebsd.cmake") + elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "OpenBSD") + set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${SCRIPTS}/toolchains/openbsd.cmake") + elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "MinGW") + set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${SCRIPTS}/toolchains/mingw.cmake") + endif() + endif() + + + list(APPEND arg_OPTIONS + "-DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=${VCPKG_CHAINLOAD_TOOLCHAIN_FILE}" + "-DVCPKG_TARGET_TRIPLET=${TARGET_TRIPLET}" + "-DVCPKG_SET_CHARSET_FLAG=${VCPKG_SET_CHARSET_FLAG}" + "-DVCPKG_PLATFORM_TOOLSET=${VCPKG_PLATFORM_TOOLSET}" + "-DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON" + "-DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON" + "-DCMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY=ON" + "-DCMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=TRUE" + "-DCMAKE_VERBOSE_MAKEFILE=ON" + "-DVCPKG_APPLOCAL_DEPS=OFF" + "-DCMAKE_TOOLCHAIN_FILE=${SCRIPTS}/buildsystems/vcpkg.cmake" + "-DCMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION=ON" + "-DVCPKG_CXX_FLAGS=${VCPKG_CXX_FLAGS}" + "-DVCPKG_CXX_FLAGS_RELEASE=${VCPKG_CXX_FLAGS_RELEASE}" + "-DVCPKG_CXX_FLAGS_DEBUG=${VCPKG_CXX_FLAGS_DEBUG}" + "-DVCPKG_C_FLAGS=${VCPKG_C_FLAGS}" + "-DVCPKG_C_FLAGS_RELEASE=${VCPKG_C_FLAGS_RELEASE}" + "-DVCPKG_C_FLAGS_DEBUG=${VCPKG_C_FLAGS_DEBUG}" + "-DVCPKG_CRT_LINKAGE=${VCPKG_CRT_LINKAGE}" + "-DVCPKG_LINKER_FLAGS=${VCPKG_LINKER_FLAGS}" + "-DVCPKG_LINKER_FLAGS_RELEASE=${VCPKG_LINKER_FLAGS_RELEASE}" + "-DVCPKG_LINKER_FLAGS_DEBUG=${VCPKG_LINKER_FLAGS_DEBUG}" + "-DVCPKG_TARGET_ARCHITECTURE=${VCPKG_TARGET_ARCHITECTURE}" + "-DCMAKE_INSTALL_LIBDIR:STRING=lib" + "-DCMAKE_INSTALL_BINDIR:STRING=bin" + "-D_VCPKG_ROOT_DIR=${VCPKG_ROOT_DIR}" + "-D_VCPKG_INSTALLED_DIR=${_VCPKG_INSTALLED_DIR}" + "-DVCPKG_MANIFEST_INSTALL=OFF" + ) + + if(DEFINED ARCH) + list(APPEND arg_OPTIONS + "-A${ARCH}" + ) + endif() + + # Sets configuration variables for macOS builds + foreach(config_var INSTALL_NAME_DIR OSX_DEPLOYMENT_TARGET OSX_SYSROOT OSX_ARCHITECTURES) + if(DEFINED VCPKG_${config_var}) + list(APPEND arg_OPTIONS "-DCMAKE_${config_var}=${VCPKG_${config_var}}") + endif() + endforeach() + + set(rel_command + ${CMAKE_COMMAND} ${arg_SOURCE_PATH} "${arg_OPTIONS}" "${arg_OPTIONS_RELEASE}" + -G ${GENERATOR} + -DCMAKE_BUILD_TYPE=Release + -DCMAKE_INSTALL_PREFIX=${CURRENT_PACKAGES_DIR}) + set(dbg_command + ${CMAKE_COMMAND} ${arg_SOURCE_PATH} "${arg_OPTIONS}" "${arg_OPTIONS_DEBUG}" + -G ${GENERATOR} + -DCMAKE_BUILD_TYPE=Debug + -DCMAKE_INSTALL_PREFIX=${CURRENT_PACKAGES_DIR}/debug) + + if(NINJA_HOST AND CMAKE_HOST_WIN32 AND NOT arg_DISABLE_PARALLEL_CONFIGURE) + list(APPEND arg_OPTIONS "-DCMAKE_DISABLE_SOURCE_CHANGES=ON") + + vcpkg_find_acquire_program(NINJA) + get_filename_component(NINJA_PATH ${NINJA} DIRECTORY) + vcpkg_add_to_path("${NINJA_PATH}") + + #parallelize the configure step + set(_contents + "rule CreateProcess\n command = $process\n\n" + ) + + macro(_build_cmakecache whereat build_type) + set(${build_type}_line "build ${whereat}/CMakeCache.txt: CreateProcess\n process = cmd /c \"cd ${whereat} &&") + foreach(arg ${${build_type}_command}) + set(${build_type}_line "${${build_type}_line} \"${arg}\"") + endforeach() + set(_contents "${_contents}${${build_type}_line}\"\n\n") + endmacro() + + if(NOT DEFINED VCPKG_BUILD_TYPE) + _build_cmakecache(".." "rel") + _build_cmakecache("../../${TARGET_TRIPLET}-dbg" "dbg") + elseif(VCPKG_BUILD_TYPE STREQUAL "release") + _build_cmakecache(".." "rel") + elseif(VCPKG_BUILD_TYPE STREQUAL "debug") + _build_cmakecache("../../${TARGET_TRIPLET}-dbg" "dbg") + endif() + + file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/vcpkg-parallel-configure) + file(WRITE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/vcpkg-parallel-configure/build.ninja "${_contents}") + + message(STATUS "Configuring ${TARGET_TRIPLET}") + vcpkg_execute_required_process( + COMMAND ninja -v + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/vcpkg-parallel-configure + LOGNAME ${arg_LOGNAME} + ) + else() + if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") + message(STATUS "Configuring ${TARGET_TRIPLET}-dbg") + file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) + vcpkg_execute_required_process( + COMMAND ${dbg_command} + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg + LOGNAME ${arg_LOGNAME}-dbg + ) + endif() + + if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") + message(STATUS "Configuring ${TARGET_TRIPLET}-rel") + file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) + vcpkg_execute_required_process( + COMMAND ${rel_command} + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel + LOGNAME ${arg_LOGNAME}-rel + ) + endif() + endif() + + set(Z_VCPKG_CMAKE_GENERATOR "${GENERATOR}" PARENT_SCOPE) +endfunction() diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_configure_gn.cmake b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_configure_gn.cmake new file mode 100644 index 000000000..883463402 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_configure_gn.cmake @@ -0,0 +1,61 @@ +#[===[.md: +# vcpkg_configure_gn + +Generate Ninja (GN) targets + +## Usage: +```cmake +vcpkg_configure_gn( + SOURCE_PATH <SOURCE_PATH> + [OPTIONS <OPTIONS>] + [OPTIONS_DEBUG <OPTIONS_DEBUG>] + [OPTIONS_RELEASE <OPTIONS_RELEASE>] +) +``` + +## Parameters: +### SOURCE_PATH (required) +The path to the GN project. + +### OPTIONS +Options to be passed to both the debug and release targets. +Note: Must be provided as a space-separated string. + +### OPTIONS_DEBUG (space-separated string) +Options to be passed to the debug target. + +### OPTIONS_RELEASE (space-separated string) +Options to be passed to the release target. +#]===] + +function(vcpkg_configure_gn) + # parse parameters such that semicolons in options arguments to COMMAND don't get erased + cmake_parse_arguments(PARSE_ARGV 0 _vcg "" "SOURCE_PATH;OPTIONS;OPTIONS_DEBUG;OPTIONS_RELEASE" "") + + if(NOT DEFINED _vcg_SOURCE_PATH) + message(FATAL_ERROR "SOURCE_PATH must be specified.") + endif() + + vcpkg_find_acquire_program(PYTHON2) + get_filename_component(PYTHON2_DIR "${PYTHON2}" DIRECTORY) + vcpkg_add_to_path(PREPEND "${PYTHON2_DIR}") + + vcpkg_find_acquire_program(GN) + + function(generate CONFIG ARGS) + message(STATUS "Generating build (${CONFIG})...") + vcpkg_execute_required_process( + COMMAND "${GN}" gen "${CURRENT_BUILDTREES_DIR}/${CONFIG}" ${ARGS} + WORKING_DIRECTORY "${SOURCE_PATH}" + LOGNAME generate-${CONFIG} + ) + endfunction() + + if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") + generate(${TARGET_TRIPLET}-dbg "--args=${_vcg_OPTIONS} ${_vcg_OPTIONS_DEBUG}") + endif() + + if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") + generate(${TARGET_TRIPLET}-rel "--args=${_vcg_OPTIONS} ${_vcg_OPTIONS_RELEASE}") + endif() +endfunction() diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_configure_make.cmake b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_configure_make.cmake new file mode 100644 index 000000000..c5b2e5912 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_configure_make.cmake @@ -0,0 +1,820 @@ +#[===[.md:
+# vcpkg_configure_make
+
+Configure configure for Debug and Release builds of a project.
+
+## Usage
+```cmake
+vcpkg_configure_make(
+ SOURCE_PATH <${SOURCE_PATH}>
+ [AUTOCONFIG]
+ [USE_WRAPPERS]
+ [DETERMINE_BUILD_TRIPLET]
+ [BUILD_TRIPLET "--host=x64 --build=i686-unknown-pc"]
+ [NO_ADDITIONAL_PATHS]
+ [CONFIG_DEPENDENT_ENVIRONMENT <SOME_VAR>...]
+ [CONFIGURE_ENVIRONMENT_VARIABLES <SOME_ENVVAR>...]
+ [ADD_BIN_TO_PATH]
+ [NO_DEBUG]
+ [SKIP_CONFIGURE]
+ [PROJECT_SUBPATH <${PROJ_SUBPATH}>]
+ [PRERUN_SHELL <${SHELL_PATH}>]
+ [OPTIONS <-DUSE_THIS_IN_ALL_BUILDS=1>...]
+ [OPTIONS_RELEASE <-DOPTIMIZE=1>...]
+ [OPTIONS_DEBUG <-DDEBUGGABLE=1>...]
+)
+```
+
+## Parameters
+### SOURCE_PATH
+Specifies the directory containing the `configure`/`configure.ac`.
+By convention, this is usually set in the portfile as the variable `SOURCE_PATH`.
+
+### PROJECT_SUBPATH
+Specifies the directory containing the ``configure`/`configure.ac`.
+By convention, this is usually set in the portfile as the variable `SOURCE_PATH`.
+
+### SKIP_CONFIGURE
+Skip configure process
+
+### USE_WRAPPERS
+Use autotools ar-lib and compile wrappers (only applies to windows cl and lib)
+
+### BUILD_TRIPLET
+Used to pass custom --build/--target/--host to configure. Can be globally overwritten by VCPKG_MAKE_BUILD_TRIPLET
+
+### DETERMINE_BUILD_TRIPLET
+For ports having a configure script following the autotools rules for selecting the triplet
+
+### NO_ADDITIONAL_PATHS
+Don't pass any additional paths except for --prefix to the configure call
+
+### AUTOCONFIG
+Need to use autoconfig to generate configure file.
+
+### PRERUN_SHELL
+Script that needs to be called before configuration (do not use for batch files which simply call autoconf or configure)
+
+### ADD_BIN_TO_PATH
+Adds the appropriate Release and Debug `bin\` directories to the path during configure such that executables can run against the in-tree DLLs.
+
+## DISABLE_VERBOSE_FLAGS
+do not pass '--disable-silent-rules --verbose' to configure
+
+### OPTIONS
+Additional options passed to configure during the configuration.
+
+### OPTIONS_RELEASE
+Additional options passed to configure during the Release configuration. These are in addition to `OPTIONS`.
+
+### OPTIONS_DEBUG
+Additional options passed to configure during the Debug configuration. These are in addition to `OPTIONS`.
+
+### CONFIG_DEPENDENT_ENVIRONMENT
+List of additional configuration dependent environment variables to set.
+Pass SOMEVAR to set the environment and have SOMEVAR_(DEBUG|RELEASE) set in the portfile to the appropriate values
+General environment variables can be set from within the portfile itself.
+
+### CONFIGURE_ENVIRONMENT_VARIABLES
+List of additional environment variables to pass via the configure call.
+
+## Notes
+This command supplies many common arguments to configure. To see the full list, examine the source.
+
+## Examples
+
+* [x264](https://github.com/Microsoft/vcpkg/blob/master/ports/x264/portfile.cmake)
+* [tcl](https://github.com/Microsoft/vcpkg/blob/master/ports/tcl/portfile.cmake)
+* [freexl](https://github.com/Microsoft/vcpkg/blob/master/ports/freexl/portfile.cmake)
+* [libosip2](https://github.com/Microsoft/vcpkg/blob/master/ports/libosip2/portfile.cmake)
+#]===]
+
+macro(_vcpkg_determine_host_mingw out_var)
+ if(DEFINED ENV{PROCESSOR_ARCHITEW6432})
+ set(HOST_ARCH $ENV{PROCESSOR_ARCHITEW6432})
+ else()
+ set(HOST_ARCH $ENV{PROCESSOR_ARCHITECTURE})
+ endif()
+ if(HOST_ARCH MATCHES "(amd|AMD)64")
+ set(${out_var} mingw64)
+ elseif(HOST_ARCH MATCHES "(x|X)86")
+ set(${out_var} mingw32)
+ else()
+ message(FATAL_ERROR "Unsupported mingw architecture ${HOST_ARCH} in _vcpkg_determine_autotools_host_cpu!" )
+ endif()
+ unset(HOST_ARCH)
+endmacro()
+
+macro(_vcpkg_determine_autotools_host_cpu out_var)
+ # TODO: the host system processor architecture can differ from the host triplet target architecture
+ if(DEFINED ENV{PROCESSOR_ARCHITEW6432})
+ set(HOST_ARCH $ENV{PROCESSOR_ARCHITEW6432})
+ elseif(DEFINED ENV{PROCESSOR_ARCHITECTURE})
+ set(HOST_ARCH $ENV{PROCESSOR_ARCHITECTURE})
+ else()
+ set(HOST_ARCH "${VCPKG_DETECTED_CMAKE_HOST_SYSTEM_PROCESSOR}")
+ endif()
+ if(HOST_ARCH MATCHES "(amd|AMD)64")
+ set(${out_var} x86_64)
+ elseif(HOST_ARCH MATCHES "(x|X)86")
+ set(${out_var} i686)
+ elseif(HOST_ARCH MATCHES "^(ARM|arm)64$")
+ set(${out_var} aarch64)
+ elseif(HOST_ARCH MATCHES "^(ARM|arm)$")
+ set(${out_var} arm)
+ else()
+ message(FATAL_ERROR "Unsupported host architecture ${HOST_ARCH} in _vcpkg_determine_autotools_host_cpu!" )
+ endif()
+ unset(HOST_ARCH)
+endmacro()
+
+macro(_vcpkg_determine_autotools_target_cpu out_var)
+ if(VCPKG_TARGET_ARCHITECTURE MATCHES "(x|X)64")
+ set(${out_var} x86_64)
+ elseif(VCPKG_TARGET_ARCHITECTURE MATCHES "(x|X)86")
+ set(${out_var} i686)
+ elseif(VCPKG_TARGET_ARCHITECTURE MATCHES "^(ARM|arm)64$")
+ set(${out_var} aarch64)
+ elseif(VCPKG_TARGET_ARCHITECTURE MATCHES "^(ARM|arm)$")
+ set(${out_var} arm)
+ else()
+ message(FATAL_ERROR "Unsupported VCPKG_TARGET_ARCHITECTURE architecture ${VCPKG_TARGET_ARCHITECTURE} in _vcpkg_determine_autotools_target_cpu!" )
+ endif()
+endmacro()
+
+macro(_vcpkg_determine_autotools_host_arch_mac out_var)
+ set(${out_var} "${VCPKG_DETECTED_CMAKE_HOST_SYSTEM_PROCESSOR}")
+endmacro()
+
+macro(_vcpkg_determine_autotools_target_arch_mac out_var)
+ list(LENGTH VCPKG_OSX_ARCHITECTURES _num_osx_archs)
+ if(_num_osx_archs GREATER_EQUAL 2)
+ set(${out_var} "universal")
+ else()
+ # Better match the arch behavior of config.guess
+ # See: https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+ if(VCPKG_OSX_ARCHITECTURES MATCHES "^(ARM|arm)64$")
+ set(${out_var} "aarch64")
+ else()
+ set(${out_var} "${VCPKG_OSX_ARCHITECTURES}")
+ endif()
+ endif()
+ unset(_num_osx_archs)
+endmacro()
+
+macro(_vcpkg_backup_env_variable envvar)
+ if(DEFINED ENV{${envvar}})
+ set(${envvar}_BACKUP "$ENV{${envvar}}")
+ set(${envvar}_PATHLIKE_CONCAT "${VCPKG_HOST_PATH_SEPARATOR}$ENV{${envvar}}")
+ else()
+ set(${envvar}_BACKUP)
+ set(${envvar}_PATHLIKE_CONCAT)
+ endif()
+endmacro()
+
+macro(_vcpkg_backup_env_variables)
+ foreach(_var ${ARGV})
+ _vcpkg_backup_env_variable(${_var})
+ endforeach()
+endmacro()
+
+macro(_vcpkg_restore_env_variable envvar)
+ if(${envvar}_BACKUP)
+ set(ENV{${envvar}} "${${envvar}_BACKUP}")
+ else()
+ unset(ENV{${envvar}})
+ endif()
+endmacro()
+
+macro(_vcpkg_restore_env_variables)
+ foreach(_var ${ARGV})
+ _vcpkg_restore_env_variable(${_var})
+ endforeach()
+endmacro()
+
+macro(_vcpkg_extract_cpp_flags_and_set_cflags_and_cxxflags _SUFFIX)
+ string(REGEX MATCHALL "( |^)-D[^ ]+" CPPFLAGS_${_SUFFIX} "${VCPKG_DETECTED_CMAKE_C_FLAGS_${_SUFFIX}}")
+ string(REGEX MATCHALL "( |^)-D[^ ]+" CXXPPFLAGS_${_SUFFIX} "${VCPKG_DETECTED_CMAKE_CXX_FLAGS_${_SUFFIX}}")
+ list(JOIN CXXPPFLAGS_${_SUFFIX} "|" CXXREGEX)
+ if(CXXREGEX)
+ list(FILTER CPPFLAGS_${_SUFFIX} INCLUDE REGEX "(${CXXREGEX})")
+ else()
+ set(CPPFLAGS_${_SUFFIX})
+ endif()
+ list(JOIN CPPFLAGS_${_SUFFIX} "|" CPPREGEX)
+ list(JOIN CPPFLAGS_${_SUFFIX} " " CPPFLAGS_${_SUFFIX})
+ set(CPPFLAGS_${_SUFFIX} "${CPPFLAGS_${_SUFFIX}}")
+ if(CPPREGEX)
+ string(REGEX REPLACE "(${CPPREGEX})" "" CFLAGS_${_SUFFIX} "${VCPKG_DETECTED_CMAKE_C_FLAGS_${_SUFFIX}}")
+ string(REGEX REPLACE "(${CPPREGEX})" "" CXXFLAGS_${_SUFFIX} "${VCPKG_DETECTED_CMAKE_CXX_FLAGS_${_SUFFIX}}")
+ else()
+ set(CFLAGS_${_SUFFIX} "${VCPKG_DETECTED_CMAKE_C_FLAGS_${_SUFFIX}}")
+ set(CXXFLAGS_${_SUFFIX} "${VCPKG_DETECTED_CMAKE_CXX_FLAGS_${_SUFFIX}}")
+ endif()
+ string(REGEX REPLACE " +" " " CPPFLAGS_${_SUFFIX} "${CPPFLAGS_${_SUFFIX}}")
+ string(REGEX REPLACE " +" " " CFLAGS_${_SUFFIX} "${CFLAGS_${_SUFFIX}}")
+ string(REGEX REPLACE " +" " " CXXFLAGS_${_SUFFIX} "${CXXFLAGS_${_SUFFIX}}")
+ # libtool has and -R option so we need to guard against -RTC by using -Xcompiler
+ # while configuring there might be a lot of unknown compiler option warnings due to that
+ # just ignore them.
+ string(REGEX REPLACE "((-|/)RTC[^ ]+)" "-Xcompiler \\1" CFLAGS_${_SUFFIX} "${CFLAGS_${_SUFFIX}}")
+ string(REGEX REPLACE "((-|/)RTC[^ ]+)" "-Xcompiler \\1" CXXFLAGS_${_SUFFIX} "${CXXFLAGS_${_SUFFIX}}")
+ string(STRIP "${CPPFLAGS_${_SUFFIX}}" CPPFLAGS_${_SUFFIX})
+ string(STRIP "${CFLAGS_${_SUFFIX}}" CFLAGS_${_SUFFIX})
+ string(STRIP "${CXXFLAGS_${_SUFFIX}}" CXXFLAGS_${_SUFFIX})
+ debug_message("CPPFLAGS_${_SUFFIX}: ${CPPFLAGS_${_SUFFIX}}")
+ debug_message("CFLAGS_${_SUFFIX}: ${CFLAGS_${_SUFFIX}}")
+ debug_message("CXXFLAGS_${_SUFFIX}: ${CXXFLAGS_${_SUFFIX}}")
+endmacro()
+
+function(vcpkg_configure_make)
+ # parse parameters such that semicolons in options arguments to COMMAND don't get erased
+ cmake_parse_arguments(PARSE_ARGV 0 _csc
+ "AUTOCONFIG;SKIP_CONFIGURE;COPY_SOURCE;DISABLE_VERBOSE_FLAGS;NO_ADDITIONAL_PATHS;ADD_BIN_TO_PATH;USE_WRAPPERS;DETERMINE_BUILD_TRIPLET"
+ "SOURCE_PATH;PROJECT_SUBPATH;PRERUN_SHELL;BUILD_TRIPLET"
+ "OPTIONS;OPTIONS_DEBUG;OPTIONS_RELEASE;CONFIGURE_ENVIRONMENT_VARIABLES;CONFIG_DEPENDENT_ENVIRONMENT;ADDITIONAL_MSYS_PACKAGES"
+ )
+ vcpkg_internal_get_cmake_vars(OUTPUT_FILE _VCPKG_CMAKE_VARS_FILE)
+ set(_VCPKG_CMAKE_VARS_FILE "${_VCPKG_CMAKE_VARS_FILE}" PARENT_SCOPE)
+ debug_message("Including cmake vars from: ${_VCPKG_CMAKE_VARS_FILE}")
+ include("${_VCPKG_CMAKE_VARS_FILE}")
+ if(DEFINED VCPKG_MAKE_BUILD_TRIPLET)
+ set(_csc_BUILD_TRIPLET ${VCPKG_MAKE_BUILD_TRIPLET}) # Triplet overwrite for crosscompiling
+ endif()
+
+ set(SRC_DIR "${_csc_SOURCE_PATH}/${_csc_PROJECT_SUBPATH}")
+
+ set(REQUIRES_AUTOGEN FALSE) # use autogen.sh
+ set(REQUIRES_AUTOCONFIG FALSE) # use autotools and configure.ac
+ if(EXISTS "${SRC_DIR}/configure" AND "${SRC_DIR}/configure.ac") # remove configure; rerun autoconf
+ if(NOT VCPKG_MAINTAINER_SKIP_AUTOCONFIG) # If fixing bugs skipping autoconfig saves a lot of time
+ set(REQUIRES_AUTOCONFIG TRUE)
+ file(REMOVE "${SRC_DIR}/configure") # remove possible autodated configure scripts
+ set(_csc_AUTOCONFIG ON)
+ endif()
+ elseif(EXISTS "${SRC_DIR}/configure" AND NOT _csc_SKIP_CONFIGURE) # run normally; no autoconf or autgen required
+ elseif(EXISTS "${SRC_DIR}/configure.ac") # Run autoconfig
+ set(REQUIRES_AUTOCONFIG TRUE)
+ set(_csc_AUTOCONFIG ON)
+ elseif(EXISTS "${SRC_DIR}/autogen.sh") # Run autogen
+ set(REQUIRES_AUTOGEN TRUE)
+ else()
+ message(FATAL_ERROR "Could not determine method to configure make")
+ endif()
+
+ debug_message("REQUIRES_AUTOGEN:${REQUIRES_AUTOGEN}")
+ debug_message("REQUIRES_AUTOCONFIG:${REQUIRES_AUTOCONFIG}")
+ # Backup environment variables
+ # CCAS CC C CPP CXX FC FF GC LD LF LIBTOOL OBJC OBJCXX R UPC Y
+ set(_cm_FLAGS AS CCAS CC C CPP CXX FC FF GC LD LF LIBTOOL OBJC OBJXX R UPC Y RC)
+ list(TRANSFORM _cm_FLAGS APPEND "FLAGS")
+ _vcpkg_backup_env_variables(${_cm_FLAGS})
+
+
+ # FC fotran compiler | FF Fortran 77 compiler
+ # LDFLAGS -> pass -L flags
+ # LIBS -> pass -l flags
+
+ #Used by gcc/linux
+ _vcpkg_backup_env_variables(C_INCLUDE_PATH CPLUS_INCLUDE_PATH LIBRARY_PATH LD_LIBRARY_PATH)
+
+ #Used by cl
+ _vcpkg_backup_env_variables(INCLUDE LIB LIBPATH)
+
+ set(_vcm_paths_with_spaces FALSE)
+ if(CURRENT_PACKAGES_DIR MATCHES " " OR CURRENT_INSTALLED_DIR MATCHES " ")
+ # Don't bother with whitespace. The tools will probably fail and I tried very hard trying to make it work (no success so far)!
+ message(WARNING "Detected whitespace in root directory. Please move the path to one without whitespaces! The required tools do not handle whitespaces correctly and the build will most likely fail")
+ set(_vcm_paths_with_spaces TRUE)
+ endif()
+
+ # Pre-processing windows configure requirements
+ if (VCPKG_TARGET_IS_WINDOWS)
+ if(CMAKE_HOST_WIN32)
+ list(APPEND MSYS_REQUIRE_PACKAGES binutils libtool autoconf automake-wrapper automake1.16 m4)
+ vcpkg_acquire_msys(MSYS_ROOT PACKAGES ${MSYS_REQUIRE_PACKAGES} ${_csc_ADDITIONAL_MSYS_PACKAGES})
+ endif()
+ if (_csc_AUTOCONFIG AND NOT _csc_BUILD_TRIPLET OR _csc_DETERMINE_BUILD_TRIPLET OR VCPKG_CROSSCOMPILING AND NOT _csc_BUILD_TRIPLET)
+ _vcpkg_determine_autotools_host_cpu(BUILD_ARCH) # VCPKG_HOST => machine you are building on => --build=
+ _vcpkg_determine_autotools_target_cpu(TARGET_ARCH)
+ # --build: the machine you are building on
+ # --host: the machine you are building for
+ # --target: the machine that CC will produce binaries for
+ # https://stackoverflow.com/questions/21990021/how-to-determine-host-value-for-configure-when-using-cross-compiler
+ # Only for ports using autotools so we can assume that they follow the common conventions for build/target/host
+ if(CMAKE_HOST_WIN32)
+ set(_csc_BUILD_TRIPLET "--build=${BUILD_ARCH}-pc-mingw32") # This is required since we are running in a msys
+ # shell which will be otherwise identified as ${BUILD_ARCH}-pc-msys
+ endif()
+ if(NOT TARGET_ARCH MATCHES "${BUILD_ARCH}" OR NOT CMAKE_HOST_WIN32) # we don't need to specify the additional flags if we build nativly, this does not hold when we are not on windows
+ string(APPEND _csc_BUILD_TRIPLET " --host=${TARGET_ARCH}-pc-mingw32") # (Host activates crosscompilation; The name given here is just the prefix of the host tools for the target)
+ endif()
+ if(VCPKG_TARGET_IS_UWP AND NOT _csc_BUILD_TRIPLET MATCHES "--host")
+ # Needs to be different from --build to enable cross builds.
+ string(APPEND _csc_BUILD_TRIPLET " --host=${TARGET_ARCH}-unknown-mingw32")
+ endif()
+ debug_message("Using make triplet: ${_csc_BUILD_TRIPLET}")
+ endif()
+ if(CMAKE_HOST_WIN32)
+ set(APPEND_ENV)
+ if(_csc_AUTOCONFIG OR _csc_USE_WRAPPERS)
+ set(APPEND_ENV ";${MSYS_ROOT}/usr/share/automake-1.16")
+ string(APPEND APPEND_ENV ";${SCRIPTS}/buildsystems/make_wrapper") # Other required wrappers are also located there
+ endif()
+ # This inserts msys before system32 (which masks sort.exe and find.exe) but after MSVC (which avoids masking link.exe)
+ string(REPLACE ";$ENV{SystemRoot}\\System32;" "${APPEND_ENV};${MSYS_ROOT}/usr/bin;$ENV{SystemRoot}\\System32;" NEWPATH "$ENV{PATH}")
+ string(REPLACE ";$ENV{SystemRoot}\\system32;" "${APPEND_ENV};${MSYS_ROOT}/usr/bin;$ENV{SystemRoot}\\system32;" NEWPATH "$ENV{PATH}")
+ set(ENV{PATH} "${NEWPATH}")
+ set(BASH "${MSYS_ROOT}/usr/bin/bash.exe")
+ endif()
+
+ macro(_vcpkg_append_to_configure_environment inoutstring var defaultval)
+ # Allows to overwrite settings in custom triplets via the environment on windows
+ if(CMAKE_HOST_WIN32 AND DEFINED ENV{${var}})
+ string(APPEND ${inoutstring} " ${var}='$ENV{${var}}'")
+ else()
+ string(APPEND ${inoutstring} " ${var}='${defaultval}'")
+ endif()
+ endmacro()
+
+ set(CONFIGURE_ENV "V=1")
+ # Remove full filepaths due to spaces and prepend filepaths to PATH (cross-compiling tools are unlikely on path by default)
+ set(progs VCPKG_DETECTED_CMAKE_C_COMPILER VCPKG_DETECTED_CMAKE_CXX_COMPILER VCPKG_DETECTED_CMAKE_AR
+ VCPKG_DETECTED_CMAKE_LINKER VCPKG_DETECTED_CMAKE_RANLIB VCPKG_DETECTED_CMAKE_OBJDUMP
+ VCPKG_DETECTED_CMAKE_STRIP VCPKG_DETECTED_CMAKE_NM VCPKG_DETECTED_CMAKE_DLLTOOL VCPKG_DETECTED_CMAKE_RC_COMPILER)
+ foreach(prog IN LISTS progs)
+ if(${prog})
+ set(path "${${prog}}")
+ unset(prog_found CACHE)
+ get_filename_component(${prog} "${${prog}}" NAME)
+ find_program(prog_found ${${prog}} PATHS ENV PATH NO_DEFAULT_PATH)
+ if(NOT path STREQUAL prog_found)
+ get_filename_component(path "${path}" DIRECTORY)
+ vcpkg_add_to_path(PREPEND ${path})
+ endif()
+ endif()
+ endforeach()
+ if (_csc_AUTOCONFIG OR _csc_USE_WRAPPERS) # without autotools we assume a custom configure script which correctly handles cl and lib. Otherwise the port needs to set CC|CXX|AR and probably CPP
+ _vcpkg_append_to_configure_environment(CONFIGURE_ENV CPP "compile ${VCPKG_DETECTED_CMAKE_C_COMPILER} -E")
+
+ _vcpkg_append_to_configure_environment(CONFIGURE_ENV CC "compile ${VCPKG_DETECTED_CMAKE_C_COMPILER}")
+ _vcpkg_append_to_configure_environment(CONFIGURE_ENV CC_FOR_BUILD "compile ${VCPKG_DETECTED_CMAKE_C_COMPILER}")
+ _vcpkg_append_to_configure_environment(CONFIGURE_ENV CXX "compile ${VCPKG_DETECTED_CMAKE_CXX_COMPILER}")
+ _vcpkg_append_to_configure_environment(CONFIGURE_ENV RC "windres-rc ${VCPKG_DETECTED_CMAKE_RC_COMPILER}")
+ _vcpkg_append_to_configure_environment(CONFIGURE_ENV WINDRES "windres-rc ${VCPKG_DETECTED_CMAKE_RC_COMPILER}")
+ if(VCPKG_DETECTED_CMAKE_AR)
+ _vcpkg_append_to_configure_environment(CONFIGURE_ENV AR "ar-lib ${VCPKG_DETECTED_CMAKE_AR}")
+ else()
+ _vcpkg_append_to_configure_environment(CONFIGURE_ENV AR "ar-lib lib.exe -verbose")
+ endif()
+ else()
+ _vcpkg_append_to_configure_environment(CONFIGURE_ENV CPP "${VCPKG_DETECTED_CMAKE_C_COMPILER} -E")
+ _vcpkg_append_to_configure_environment(CONFIGURE_ENV CC "${VCPKG_DETECTED_CMAKE_C_COMPILER}")
+ _vcpkg_append_to_configure_environment(CONFIGURE_ENV CC_FOR_BUILD "${VCPKG_DETECTED_CMAKE_C_COMPILER}")
+ _vcpkg_append_to_configure_environment(CONFIGURE_ENV CXX "${VCPKG_DETECTED_CMAKE_CXX_COMPILER}")
+ if(VCPKG_DETECTED_CMAKE_AR)
+ _vcpkg_append_to_configure_environment(CONFIGURE_ENV AR "${VCPKG_DETECTED_CMAKE_AR}")
+ else()
+ _vcpkg_append_to_configure_environment(CONFIGURE_ENV AR "lib.exe -verbose")
+ endif()
+ endif()
+ _vcpkg_append_to_configure_environment(CONFIGURE_ENV LD "${VCPKG_DETECTED_CMAKE_LINKER} -verbose")
+ if(VCPKG_DETECTED_CMAKE_RANLIB)
+ _vcpkg_append_to_configure_environment(CONFIGURE_ENV RANLIB "${VCPKG_DETECTED_CMAKE_RANLIB}") # Trick to ignore the RANLIB call
+ else()
+ _vcpkg_append_to_configure_environment(CONFIGURE_ENV RANLIB ":")
+ endif()
+ if(VCPKG_DETECTED_CMAKE_OBJDUMP) #Objdump is required to make shared libraries. Otherwise define lt_cv_deplibs_check_method=pass_all
+ _vcpkg_append_to_configure_environment(CONFIGURE_ENV OBJDUMP "${VCPKG_DETECTED_CMAKE_OBJDUMP}") # Trick to ignore the RANLIB call
+ endif()
+ if(VCPKG_DETECTED_CMAKE_STRIP) # If required set the ENV variable STRIP in the portfile correctly
+ _vcpkg_append_to_configure_environment(CONFIGURE_ENV STRIP "${VCPKG_DETECTED_CMAKE_STRIP}")
+ else()
+ _vcpkg_append_to_configure_environment(CONFIGURE_ENV STRIP ":")
+ list(APPEND _csc_OPTIONS ac_cv_prog_ac_ct_STRIP=:)
+ endif()
+ if(VCPKG_DETECTED_CMAKE_NM) # If required set the ENV variable NM in the portfile correctly
+ _vcpkg_append_to_configure_environment(CONFIGURE_ENV NM "${VCPKG_DETECTED_CMAKE_NM}")
+ else()
+ # Would be better to have a true nm here! Some symbols (mainly exported variables) get not properly imported with dumpbin as nm
+ # and require __declspec(dllimport) for some reason (same problem CMake has with WINDOWS_EXPORT_ALL_SYMBOLS)
+ _vcpkg_append_to_configure_environment(CONFIGURE_ENV NM "dumpbin.exe -symbols -headers")
+ endif()
+ if(VCPKG_DETECTED_CMAKE_DLLTOOL) # If required set the ENV variable DLLTOOL in the portfile correctly
+ _vcpkg_append_to_configure_environment(CONFIGURE_ENV DLLTOOL "${VCPKG_DETECTED_CMAKE_DLLTOOL}")
+ else()
+ _vcpkg_append_to_configure_environment(CONFIGURE_ENV DLLTOOL "link.exe -verbose -dll")
+ endif()
+ _vcpkg_append_to_configure_environment(CONFIGURE_ENV CCAS ":") # If required set the ENV variable CCAS in the portfile correctly
+ _vcpkg_append_to_configure_environment(CONFIGURE_ENV AS ":") # If required set the ENV variable AS in the portfile correctly
+
+ foreach(_env IN LISTS _csc_CONFIGURE_ENVIRONMENT_VARIABLES)
+ _vcpkg_append_to_configure_environment(CONFIGURE_ENV ${_env} "${${_env}}")
+ endforeach()
+ debug_message("CONFIGURE_ENV: '${CONFIGURE_ENV}'")
+ # Other maybe interesting variables to control
+ # COMPILE This is the command used to actually compile a C source file. The file name is appended to form the complete command line.
+ # LINK This is the command used to actually link a C program.
+ # CXXCOMPILE The command used to actually compile a C++ source file. The file name is appended to form the complete command line.
+ # CXXLINK The command used to actually link a C++ program.
+
+ # Variables not correctly detected by configure. In release builds.
+ list(APPEND _csc_OPTIONS gl_cv_double_slash_root=yes
+ ac_cv_func_memmove=yes)
+ #list(APPEND _csc_OPTIONS lt_cv_deplibs_check_method=pass_all) # Just ignore libtool checks
+ if(VCPKG_TARGET_ARCHITECTURE MATCHES "^[Aa][Rr][Mm]64$")
+ list(APPEND _csc_OPTIONS gl_cv_host_cpu_c_abi=no)
+ # Currently needed for arm64 because objdump yields: "unrecognised machine type (0xaa64) in Import Library Format archive"
+ list(APPEND _csc_OPTIONS lt_cv_deplibs_check_method=pass_all)
+ elseif(VCPKG_TARGET_ARCHITECTURE MATCHES "^[Aa][Rr][Mm]$")
+ # Currently needed for arm because objdump yields: "unrecognised machine type (0x1c4) in Import Library Format archive"
+ list(APPEND _csc_OPTIONS lt_cv_deplibs_check_method=pass_all)
+ endif()
+ endif()
+
+ if(CMAKE_HOST_WIN32)
+ #Some PATH handling for dealing with spaces....some tools will still fail with that!
+ string(REPLACE " " "\\\ " _VCPKG_PREFIX ${CURRENT_INSTALLED_DIR})
+ string(REGEX REPLACE "([a-zA-Z]):/" "/\\1/" _VCPKG_PREFIX "${_VCPKG_PREFIX}")
+ set(_VCPKG_INSTALLED ${CURRENT_INSTALLED_DIR})
+ set(prefix_var "'\${prefix}'") # Windows needs extra quotes or else the variable gets expanded in the makefile!
+ else()
+ string(REPLACE " " "\ " _VCPKG_PREFIX ${CURRENT_INSTALLED_DIR})
+ string(REPLACE " " "\ " _VCPKG_INSTALLED ${CURRENT_INSTALLED_DIR})
+ set(EXTRA_QUOTES)
+ set(prefix_var "\${prefix}")
+ endif()
+
+ # macOS - cross-compiling support
+ if(VCPKG_TARGET_IS_OSX)
+ if (_csc_AUTOCONFIG AND NOT _csc_BUILD_TRIPLET OR _csc_DETERMINE_BUILD_TRIPLET)
+ _vcpkg_determine_autotools_host_arch_mac(BUILD_ARCH) # machine you are building on => --build=
+ _vcpkg_determine_autotools_target_arch_mac(TARGET_ARCH)
+ # --build: the machine you are building on
+ # --host: the machine you are building for
+ # --target: the machine that CC will produce binaries for
+ # https://stackoverflow.com/questions/21990021/how-to-determine-host-value-for-configure-when-using-cross-compiler
+ # Only for ports using autotools so we can assume that they follow the common conventions for build/target/host
+ if(NOT "${TARGET_ARCH}" STREQUAL "${BUILD_ARCH}") # we don't need to specify the additional flags if we build natively.
+ set(_csc_BUILD_TRIPLET "--host=${TARGET_ARCH}-apple-darwin") # (Host activates crosscompilation; The name given here is just the prefix of the host tools for the target)
+ endif()
+ debug_message("Using make triplet: ${_csc_BUILD_TRIPLET}")
+ endif()
+ endif()
+
+ # Cleanup previous build dirs
+ file(REMOVE_RECURSE "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel"
+ "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg"
+ "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}")
+
+ # Set configure paths
+ set(_csc_OPTIONS_RELEASE ${_csc_OPTIONS_RELEASE} "--prefix=${EXTRA_QUOTES}${_VCPKG_PREFIX}${EXTRA_QUOTES}")
+ set(_csc_OPTIONS_DEBUG ${_csc_OPTIONS_DEBUG} "--prefix=${EXTRA_QUOTES}${_VCPKG_PREFIX}/debug${EXTRA_QUOTES}")
+ if(NOT _csc_NO_ADDITIONAL_PATHS)
+ set(_csc_OPTIONS_RELEASE ${_csc_OPTIONS_RELEASE}
+ # Important: These should all be relative to prefix!
+ "--bindir=${prefix_var}/tools/${PORT}/bin"
+ "--sbindir=${prefix_var}/tools/${PORT}/sbin"
+ #"--libdir='\${prefix}'/lib" # already the default!
+ #"--includedir='\${prefix}'/include" # already the default!
+ "--mandir=${prefix_var}/share/${PORT}"
+ "--docdir=${prefix_var}/share/${PORT}"
+ "--datarootdir=${prefix_var}/share/${PORT}")
+ set(_csc_OPTIONS_DEBUG ${_csc_OPTIONS_DEBUG}
+ # Important: These should all be relative to prefix!
+ "--bindir=${prefix_var}/../tools/${PORT}/debug/bin"
+ "--sbindir=${prefix_var}/../tools/${PORT}/debug/sbin"
+ #"--libdir='\${prefix}'/lib" # already the default!
+ "--includedir=${prefix_var}/../include"
+ "--datarootdir=${prefix_var}/share/${PORT}")
+ endif()
+ # Setup common options
+ if(NOT DISABLE_VERBOSE_FLAGS)
+ list(APPEND _csc_OPTIONS --disable-silent-rules --verbose)
+ endif()
+
+ if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
+ list(APPEND _csc_OPTIONS --enable-shared --disable-static)
+ else()
+ list(APPEND _csc_OPTIONS --disable-shared --enable-static)
+ endif()
+
+ file(RELATIVE_PATH RELATIVE_BUILD_PATH "${CURRENT_BUILDTREES_DIR}" "${_csc_SOURCE_PATH}/${_csc_PROJECT_SUBPATH}")
+
+ set(base_cmd)
+ if(CMAKE_HOST_WIN32)
+ set(base_cmd ${BASH} --noprofile --norc --debug)
+ else()
+ find_program(base_cmd bash REQUIRED)
+ endif()
+ if(VCPKG_TARGET_IS_WINDOWS)
+ list(JOIN _csc_OPTIONS " " _csc_OPTIONS)
+ list(JOIN _csc_OPTIONS_RELEASE " " _csc_OPTIONS_RELEASE)
+ list(JOIN _csc_OPTIONS_DEBUG " " _csc_OPTIONS_DEBUG)
+ endif()
+
+ # Setup include environment (since these are buildtype independent restoring them is unnecessary)
+ # Used by CL
+ set(ENV{INCLUDE} "${_VCPKG_INSTALLED}/include${VCPKG_HOST_PATH_SEPARATOR}${INCLUDE_BACKUP}")
+ # Used by GCC
+ set(ENV{C_INCLUDE_PATH} "${_VCPKG_INSTALLED}/include${VCPKG_HOST_PATH_SEPARATOR}${C_INCLUDE_PATH_BACKUP}")
+ set(ENV{CPLUS_INCLUDE_PATH} "${_VCPKG_INSTALLED}/include${VCPKG_HOST_PATH_SEPARATOR}${CPLUS_INCLUDE_PATH_BACKUP}")
+
+ # Flags should be set in the toolchain instead (Setting this up correctly requires a function named vcpkg_determined_cmake_compiler_flags which can also be used to setup CC and CXX etc.)
+ if(VCPKG_TARGET_IS_WINDOWS)
+ _vcpkg_backup_env_variables(_CL_ _LINK_)
+ # TODO: Should be CPP flags instead -> rewrite when vcpkg_determined_cmake_compiler_flags defined
+ if(VCPKG_TARGET_IS_UWP)
+ # Be aware that configure thinks it is crosscompiling due to:
+ # error while loading shared libraries: VCRUNTIME140D_APP.dll:
+ # cannot open shared object file: No such file or directory
+ # IMPORTANT: The only way to pass linker flags through libtool AND the compile wrapper
+ # is to use the CL and LINK environment variables !!!
+ # (This is due to libtool and compiler wrapper using the same set of options to pass those variables around)
+ string(REPLACE "\\" "/" VCToolsInstallDir "$ENV{VCToolsInstallDir}")
+ # Can somebody please check if CMake's compiler flags for UWP are correct?
+ set(ENV{_CL_} "$ENV{_CL_} /D_UNICODE /DUNICODE /DWINAPI_FAMILY=WINAPI_FAMILY_APP /D__WRL_NO_DEFAULT_LIB_ -FU\"${VCToolsInstallDir}/lib/x86/store/references/platform.winmd\"")
+ string(APPEND VCPKG_DETECTED_CMAKE_CXX_FLAGS_RELEASE " -ZW:nostdlib")
+ string(APPEND VCPKG_DETECTED_CMAKE_CXX_FLAGS_DEBUG " -ZW:nostdlib")
+ set(ENV{_LINK_} "$ENV{_LINK_} ${VCPKG_DETECTED_CMAKE_C_STANDARD_LIBRARIES} ${VCPKG_DETECTED_CMAKE_CXX_STANDARD_LIBRARIES} /MANIFEST /DYNAMICBASE /WINMD:NO /APPCONTAINER")
+ endif()
+ endif()
+
+ macro(convert_to_list input output)
+ string(REGEX MATCHALL "(( +|^ *)[^ ]+)" ${output} "${${input}}")
+ endmacro()
+ convert_to_list(VCPKG_DETECTED_CMAKE_C_STANDARD_LIBRARIES C_LIBS_LIST)
+ convert_to_list(VCPKG_DETECTED_CMAKE_CXX_STANDARD_LIBRARIES CXX_LIBS_LIST)
+ set(ALL_LIBS_LIST ${C_LIBS_LIST} ${CXX_LIBS_LIST})
+ list(REMOVE_DUPLICATES ALL_LIBS_LIST)
+ list(TRANSFORM ALL_LIBS_LIST STRIP)
+ #Do lib list transformation from name.lib to -lname if necessary
+ set(_VCPKG_TRANSFORM_LIBS TRUE)
+ if(VCPKG_TARGET_IS_UWP)
+ set(_VCPKG_TRANSFORM_LIBS FALSE)
+ # Avoid libtool choke: "Warning: linker path does not have real file for library -lWindowsApp."
+ # The problem with the choke is that libtool always falls back to built a static library even if a dynamic was requested.
+ # Note: Env LIBPATH;LIB are on the search path for libtool by default on windows.
+ # It even does unix/dos-short/unix transformation with the path to get rid of spaces.
+ endif()
+ set(_lprefix)
+ if(_VCPKG_TRANSFORM_LIBS)
+ set(_lprefix "-l")
+ list(TRANSFORM ALL_LIBS_LIST REPLACE "(.dll.lib|.lib|.a|.so)$" "")
+ if(VCPKG_TARGET_IS_WINDOWS)
+ list(REMOVE_ITEM ALL_LIBS_LIST "uuid")
+ endif()
+ list(TRANSFORM ALL_LIBS_LIST REPLACE "^(${_lprefix})" "")
+ endif()
+ list(JOIN ALL_LIBS_LIST " ${_lprefix}" ALL_LIBS_STRING)
+
+ if(ALL_LIBS_STRING)
+ set(ALL_LIBS_STRING "${_lprefix}${ALL_LIBS_STRING}")
+ if(DEFINED ENV{LIBS})
+ set(ENV{LIBS} "$ENV{LIBS} ${ALL_LIBS_STRING}")
+ else()
+ set(ENV{LIBS} "${ALL_LIBS_STRING}")
+ endif()
+ endif()
+ debug_message(STATUS "ENV{LIBS}:$ENV{LIBS}")
+ vcpkg_find_acquire_program(PKGCONFIG)
+ if(VCPKG_LIBRARY_LINKAGE STREQUAL "static" AND NOT PKGCONFIG STREQUAL "--static")
+ set(PKGCONFIG "${PKGCONFIG} --static") # Is this still required or was the PR changing the pc files accordingly merged?
+ endif()
+
+ # Run autoconf if necessary
+ set(_GENERATED_CONFIGURE FALSE)
+ if (_csc_AUTOCONFIG OR REQUIRES_AUTOCONFIG)
+ find_program(AUTORECONF autoreconf)
+ if(NOT AUTORECONF)
+ message(FATAL_ERROR "${PORT} requires autoconf from the system package manager (example: \"sudo apt-get install autoconf\")")
+ endif()
+ message(STATUS "Generating configure for ${TARGET_TRIPLET}")
+ if (CMAKE_HOST_WIN32)
+ vcpkg_execute_required_process(
+ COMMAND ${base_cmd} -c "autoreconf -vfi"
+ WORKING_DIRECTORY "${SRC_DIR}"
+ LOGNAME autoconf-${TARGET_TRIPLET}
+ )
+ else()
+ vcpkg_execute_required_process(
+ COMMAND ${AUTORECONF} -vfi
+ WORKING_DIRECTORY "${SRC_DIR}"
+ LOGNAME autoconf-${TARGET_TRIPLET}
+ )
+ endif()
+ message(STATUS "Finished generating configure for ${TARGET_TRIPLET}")
+ endif()
+ if(REQUIRES_AUTOGEN)
+ message(STATUS "Generating configure for ${TARGET_TRIPLET} via autogen.sh")
+ if (CMAKE_HOST_WIN32)
+ vcpkg_execute_required_process(
+ COMMAND ${base_cmd} -c "./autogen.sh"
+ WORKING_DIRECTORY "${SRC_DIR}"
+ LOGNAME autoconf-${TARGET_TRIPLET}
+ )
+ else()
+ vcpkg_execute_required_process(
+ COMMAND "./autogen.sh"
+ WORKING_DIRECTORY "${SRC_DIR}"
+ LOGNAME autoconf-${TARGET_TRIPLET}
+ )
+ endif()
+ message(STATUS "Finished generating configure for ${TARGET_TRIPLET}")
+ endif()
+
+ if (_csc_PRERUN_SHELL)
+ message(STATUS "Prerun shell with ${TARGET_TRIPLET}")
+ vcpkg_execute_required_process(
+ COMMAND ${base_cmd} -c "${_csc_PRERUN_SHELL}"
+ WORKING_DIRECTORY "${SRC_DIR}"
+ LOGNAME prerun-${TARGET_TRIPLET}
+ )
+ endif()
+
+ if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug" AND NOT _csc_NO_DEBUG)
+ set(_VAR_SUFFIX DEBUG)
+ set(PATH_SUFFIX_${_VAR_SUFFIX} "/debug")
+ set(SHORT_NAME_${_VAR_SUFFIX} "dbg")
+ list(APPEND _buildtypes ${_VAR_SUFFIX})
+ if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
+ set(LINKER_FLAGS_${_VAR_SUFFIX} "${VCPKG_DETECTED_CMAKE_STATIC_LINKERFLAGS_${_VAR_SUFFIX}}")
+ else() # dynamic
+ set(LINKER_FLAGS_${_VAR_SUFFIX} "${VCPKG_DETECTED_CMAKE_SHARED_LINKERFLAGS_${_VAR_SUFFIX}}")
+ endif()
+ _vcpkg_extract_cpp_flags_and_set_cflags_and_cxxflags(${_VAR_SUFFIX})
+ if (CMAKE_HOST_WIN32 AND VCPKG_DETECTED_CMAKE_C_COMPILER MATCHES "cl.exe")
+ if(NOT _vcm_paths_with_spaces)
+ set(LDFLAGS_${_VAR_SUFFIX} "-L${_VCPKG_INSTALLED}${PATH_SUFFIX_${_VAR_SUFFIX}}/lib -L${_VCPKG_INSTALLED}${PATH_SUFFIX_${_VAR_SUFFIX}}/lib/manual-link")
+ endif()
+ if(DEFINED ENV{_LINK_})
+ set(LINK_ENV_${_VAR_SUFFIX} "$ENV{_LINK_} ${LINKER_FLAGS_${_VAR_SUFFIX}}")
+ else()
+ set(LINK_ENV_${_VAR_SUFFIX} "${LINKER_FLAGS_${_VAR_SUFFIX}}")
+ endif()
+ else()
+ set(_link_dirs)
+ if(EXISTS "${_VCPKG_INSTALLED}${PATH_SUFFIX_${_VAR_SUFFIX}}/lib")
+ set(_link_dirs "-L${_VCPKG_INSTALLED}${PATH_SUFFIX_${_VAR_SUFFIX}}/lib")
+ endif()
+ if(EXISTS "{_VCPKG_INSTALLED}${PATH_SUFFIX_${_VAR_SUFFIX}}/lib/manual-link")
+ set(_link_dirs "${_link_dirs} -L${_VCPKG_INSTALLED}${PATH_SUFFIX_${_VAR_SUFFIX}}/lib/manual-link")
+ endif()
+ string(STRIP "${_link_dirs}" _link_dirs)
+ set(LDFLAGS_${_VAR_SUFFIX} "${_link_dirs} ${LINKER_FLAGS_${_VAR_SUFFIX}}")
+ endif()
+ unset(_VAR_SUFFIX)
+ endif()
+ if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
+ set(_VAR_SUFFIX RELEASE)
+ set(PATH_SUFFIX_${_VAR_SUFFIX} "")
+ set(SHORT_NAME_${_VAR_SUFFIX} "rel")
+ list(APPEND _buildtypes ${_VAR_SUFFIX})
+ if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
+ set(LINKER_FLAGS_${_VAR_SUFFIX} "${VCPKG_DETECTED_CMAKE_STATIC_LINKERFLAGS_${_VAR_SUFFIX}}")
+ else() # dynamic
+ set(LINKER_FLAGS_${_VAR_SUFFIX} "${VCPKG_DETECTED_CMAKE_SHARED_LINKERFLAGS_${_VAR_SUFFIX}}")
+ endif()
+ _vcpkg_extract_cpp_flags_and_set_cflags_and_cxxflags(${_VAR_SUFFIX})
+ if (CMAKE_HOST_WIN32 AND VCPKG_DETECTED_CMAKE_C_COMPILER MATCHES "cl.exe")
+ if(NOT _vcm_paths_with_spaces)
+ set(LDFLAGS_${_VAR_SUFFIX} "-L${_VCPKG_INSTALLED}${PATH_SUFFIX_${_VAR_SUFFIX}}/lib -L${_VCPKG_INSTALLED}${PATH_SUFFIX_${_VAR_SUFFIX}}/lib/manual-link")
+ endif()
+ if(DEFINED ENV{_LINK_})
+ set(LINK_ENV_${_VAR_SUFFIX} "$ENV{_LINK_} ${LINKER_FLAGS_${_VAR_SUFFIX}}")
+ else()
+ set(LINK_ENV_${_VAR_SUFFIX} "${LINKER_FLAGS_${_VAR_SUFFIX}}")
+ endif()
+ else()
+ set(_link_dirs)
+ if(EXISTS "${_VCPKG_INSTALLED}${PATH_SUFFIX_${_VAR_SUFFIX}}/lib")
+ set(_link_dirs "-L${_VCPKG_INSTALLED}${PATH_SUFFIX_${_VAR_SUFFIX}}/lib")
+ endif()
+ if(EXISTS "{_VCPKG_INSTALLED}${PATH_SUFFIX_${_VAR_SUFFIX}}/lib/manual-link")
+ set(_link_dirs "${_link_dirs} -L${_VCPKG_INSTALLED}${PATH_SUFFIX_${_VAR_SUFFIX}}/lib/manual-link")
+ endif()
+ string(STRIP "${_link_dirs}" _link_dirs)
+ set(LDFLAGS_${_VAR_SUFFIX} "${_link_dirs} ${LINKER_FLAGS_${_VAR_SUFFIX}}")
+ endif()
+ unset(_VAR_SUFFIX)
+ endif()
+
+ foreach(_buildtype IN LISTS _buildtypes)
+ foreach(ENV_VAR ${_csc_CONFIG_DEPENDENT_ENVIRONMENT})
+ if(DEFINED ENV{${ENV_VAR}})
+ set(BACKUP_CONFIG_${ENV_VAR} "$ENV{${ENV_VAR}}")
+ endif()
+ set(ENV{${ENV_VAR}} "${${ENV_VAR}_${_buildtype}}")
+ endforeach()
+
+ set(TAR_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${SHORT_NAME_${_buildtype}}")
+ file(MAKE_DIRECTORY "${TAR_DIR}")
+ file(RELATIVE_PATH RELATIVE_BUILD_PATH "${TAR_DIR}" "${SRC_DIR}")
+
+ if(_csc_COPY_SOURCE)
+ file(COPY "${SRC_DIR}/" DESTINATION "${TAR_DIR}")
+ set(RELATIVE_BUILD_PATH .)
+ endif()
+
+ # Setup PKG_CONFIG_PATH
+ set(PKGCONFIG_INSTALLED_DIR "${CURRENT_INSTALLED_DIR}${PATH_SUFFIX_${_buildtype}}/lib/pkgconfig")
+ set(PKGCONFIG_INSTALLED_SHARE_DIR "${CURRENT_INSTALLED_DIR}/share/pkgconfig")
+ if(ENV{PKG_CONFIG_PATH})
+ set(BACKUP_ENV_PKG_CONFIG_PATH_${_buildtype} $ENV{PKG_CONFIG_PATH})
+ set(ENV{PKG_CONFIG_PATH} "${PKGCONFIG_INSTALLED_DIR}${VCPKG_HOST_PATH_SEPARATOR}${PKGCONFIG_INSTALLED_SHARE_DIR}${VCPKG_HOST_PATH_SEPARATOR}$ENV{PKG_CONFIG_PATH}")
+ else()
+ set(ENV{PKG_CONFIG_PATH} "${PKGCONFIG_INSTALLED_DIR}${VCPKG_HOST_PATH_SEPARATOR}${PKGCONFIG_INSTALLED_SHARE_DIR}")
+ endif()
+
+ # Setup environment
+ set(ENV{CPPFLAGS} "${CPPFLAGS_${_buildtype}}")
+ set(ENV{CFLAGS} "${CFLAGS_${_buildtype}}")
+ set(ENV{CXXFLAGS} "${CXXFLAGS_${_buildtype}}")
+ set(ENV{RCFLAGS} "${VCPKG_DETECTED_CMAKE_RC_FLAGS_${_buildtype}}")
+ set(ENV{LDFLAGS} "${LDFLAGS_${_buildtype}}")
+ if(LINK_ENV_${_VAR_SUFFIX})
+ set(_LINK_CONFIG_BACKUP "$ENV{_LINK_}")
+ set(ENV{_LINK_} "${LINK_ENV_${_VAR_SUFFIX}}")
+ endif()
+ set(ENV{PKG_CONFIG} "${PKGCONFIG} --define-variable=prefix=${_VCPKG_INSTALLED}${PATH_SUFFIX_${_buildtype}}")
+
+ set(_lib_env_vars LIB LIBPATH LIBRARY_PATH LD_LIBRARY_PATH)
+ foreach(_lib_env_var IN LISTS _lib_env_vars)
+ set(_link_path)
+ if(EXISTS "${_VCPKG_INSTALLED}${PATH_SUFFIX_${_buildtype}}/lib")
+ set(_link_path "${_VCPKG_INSTALLED}${PATH_SUFFIX_${_buildtype}}/lib")
+ endif()
+ if(EXISTS "${_VCPKG_INSTALLED}${PATH_SUFFIX_${_buildtype}}/lib/manual-link")
+ if(_link_path)
+ set(_link_path "${_link_path}${VCPKG_HOST_PATH_SEPARATOR}")
+ endif()
+ set(_link_path "${_link_path}${_VCPKG_INSTALLED}${PATH_SUFFIX_${_buildtype}}/lib/manual-link")
+ endif()
+ set(ENV{${_lib_env_var}} "${_link_path}${${_lib_env_var}_PATHLIKE_CONCAT}")
+ endforeach()
+ unset(_link_path)
+ unset(_lib_env_vars)
+
+ if(VCPKG_TARGET_IS_WINDOWS)
+ set(command "${base_cmd}" -c "${CONFIGURE_ENV} ./${RELATIVE_BUILD_PATH}/configure ${_csc_BUILD_TRIPLET} ${_csc_OPTIONS} ${_csc_OPTIONS_${_buildtype}}")
+ else()
+ set(command "${base_cmd}" "./${RELATIVE_BUILD_PATH}/configure" ${_csc_BUILD_TRIPLET} ${_csc_OPTIONS} ${_csc_OPTIONS_${_buildtype}})
+ endif()
+
+ if(_csc_ADD_BIN_TO_PATH)
+ set(PATH_BACKUP $ENV{PATH})
+ vcpkg_add_to_path("${CURRENT_INSTALLED_DIR}${PATH_SUFFIX_${_buildtype}}/bin")
+ endif()
+ debug_message("Configure command:'${command}'")
+ if (NOT _csc_SKIP_CONFIGURE)
+ message(STATUS "Configuring ${TARGET_TRIPLET}-${SHORT_NAME_${_buildtype}}")
+ vcpkg_execute_required_process(
+ COMMAND ${command}
+ WORKING_DIRECTORY "${TAR_DIR}"
+ LOGNAME config-${TARGET_TRIPLET}-${SHORT_NAME_${_buildtype}}
+ )
+ if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW AND VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
+ file(GLOB_RECURSE LIBTOOL_FILES "${TAR_DIR}*/libtool")
+ foreach(lt_file IN LISTS LIBTOOL_FILES)
+ file(READ "${lt_file}" _contents)
+ string(REPLACE ".dll.lib" ".lib" _contents "${_contents}")
+ file(WRITE "${lt_file}" "${_contents}")
+ endforeach()
+ endif()
+
+ if(EXISTS "${TAR_DIR}/config.log")
+ file(RENAME "${TAR_DIR}/config.log" "${CURRENT_BUILDTREES_DIR}/config.log-${TARGET_TRIPLET}-${SHORT_NAME_${_buildtype}}.log")
+ endif()
+ endif()
+
+ if(BACKUP_ENV_PKG_CONFIG_PATH_${_buildtype})
+ set(ENV{PKG_CONFIG_PATH} "${BACKUP_ENV_PKG_CONFIG_PATH_${_buildtype}}")
+ else()
+ unset(ENV{PKG_CONFIG_PATH})
+ endif()
+ unset(BACKUP_ENV_PKG_CONFIG_PATH_${_buildtype})
+
+ if(_LINK_CONFIG_BACKUP)
+ set(ENV{_LINK_} "${_LINK_CONFIG_BACKUP}")
+ unset(_LINK_CONFIG_BACKUP)
+ endif()
+
+ if(_csc_ADD_BIN_TO_PATH)
+ set(ENV{PATH} "${PATH_BACKUP}")
+ endif()
+ # Restore environment (config dependent)
+ foreach(ENV_VAR ${_csc_CONFIG_DEPENDENT_ENVIRONMENT})
+ if(BACKUP_CONFIG_${ENV_VAR})
+ set(ENV{${ENV_VAR}} "${BACKUP_CONFIG_${ENV_VAR}}")
+ else()
+ unset(ENV{${ENV_VAR}})
+ endif()
+ endforeach()
+ endforeach()
+
+ # Restore environment
+ _vcpkg_restore_env_variables(${_cm_FLAGS} LIB LIBPATH LIBRARY_PATH LD_LIBRARY_PATH)
+
+ SET(_VCPKG_PROJECT_SOURCE_PATH ${_csc_SOURCE_PATH} PARENT_SCOPE)
+ set(_VCPKG_PROJECT_SUBPATH ${_csc_PROJECT_SUBPATH} PARENT_SCOPE)
+endfunction()
diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_configure_meson.cmake b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_configure_meson.cmake new file mode 100644 index 000000000..6dc80ef2f --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_configure_meson.cmake @@ -0,0 +1,493 @@ +#[===[.md: +# vcpkg_configure_meson + +Configure Meson for Debug and Release builds of a project. + +## Usage +```cmake +vcpkg_configure_meson( + SOURCE_PATH <${SOURCE_PATH}> + [OPTIONS <-DUSE_THIS_IN_ALL_BUILDS=1>...] + [OPTIONS_RELEASE <-DOPTIMIZE=1>...] + [OPTIONS_DEBUG <-DDEBUGGABLE=1>...] +) +``` + +## Parameters +### SOURCE_PATH +Specifies the directory containing the `meson.build`. +By convention, this is usually set in the portfile as the variable `SOURCE_PATH`. + +### OPTIONS +Additional options passed to Meson during the configuration. + +### OPTIONS_RELEASE +Additional options passed to Meson during the Release configuration. These are in addition to `OPTIONS`. + +### OPTIONS_DEBUG +Additional options passed to Meson during the Debug configuration. These are in addition to `OPTIONS`. + +## Notes +This command supplies many common arguments to Meson. To see the full list, examine the source. + +## Examples + +* [fribidi](https://github.com/Microsoft/vcpkg/blob/master/ports/fribidi/portfile.cmake) +* [libepoxy](https://github.com/Microsoft/vcpkg/blob/master/ports/libepoxy/portfile.cmake) +#]===] + +function(vcpkg_internal_meson_generate_native_file _additional_binaries) #https://mesonbuild.com/Native-environments.html + set(NATIVE "[binaries]\n") + #set(proglist AR RANLIB STRIP NM OBJDUMP DLLTOOL MT) + if(VCPKG_TARGET_IS_WINDOWS) + set(proglist MT) + else() + set(proglist AR RANLIB STRIP NM OBJDUMP DLLTOOL MT) + endif() + foreach(prog IN LISTS proglist) + if(VCPKG_DETECTED_CMAKE_${prog}) + string(TOLOWER "${prog}" proglower) + string(APPEND NATIVE "${proglower} = '${VCPKG_DETECTED_CMAKE_${prog}}'\n") + endif() + endforeach() + set(compiler C CXX RC) + foreach(prog IN LISTS compiler) + if(VCPKG_DETECTED_CMAKE_${prog}_COMPILER) + string(REPLACE "CXX" "CPP" mesonprog "${prog}") + string(TOLOWER "${mesonprog}" proglower) + string(APPEND NATIVE "${proglower} = '${VCPKG_DETECTED_CMAKE_${prog}_COMPILER}'\n") + endif() + endforeach() + if(VCPKG_DETECTED_CMAKE_LINKER AND VCPKG_TARGET_IS_WINDOWS) + string(APPEND NATIVE "c_ld = '${VCPKG_DETECTED_CMAKE_LINKER}'\n") + string(APPEND NATIVE "cpp_ld = '${VCPKG_DETECTED_CMAKE_LINKER}'\n") + endif() + string(APPEND NATIVE "cmake = '${CMAKE_COMMAND}'\n") + foreach(_binary IN LISTS ${_additional_binaries}) + string(APPEND NATIVE "${_binary}\n") + endforeach() + + string(APPEND NATIVE "[built-in options]\n") #https://mesonbuild.com/Builtin-options.html + if(VCPKG_DETECTED_CMAKE_C_COMPILER MATCHES "cl.exe") + # This is currently wrongly documented in the meson docs or buggy. The docs say: 'none' = no flags + # In reality however 'none' tries to deactivate eh and meson passes the flags for it resulting in a lot of warnings + # about overriden flags. Until this is fixed in meson vcpkg should not pass this here. + # string(APPEND NATIVE "cpp_eh='none'\n") # To make sure meson is not adding eh flags by itself using msvc + endif() + if(VCPKG_TARGET_IS_WINDOWS) + string(REGEX REPLACE "( |^)(-|/)" ";\\2" WIN_C_STANDARD_LIBRARIES "${VCPKG_DETECTED_CMAKE_C_STANDARD_LIBRARIES}") + string(REGEX REPLACE "\\.lib " ".lib;" WIN_C_STANDARD_LIBRARIES "${WIN_C_STANDARD_LIBRARIES}") + list(TRANSFORM WIN_C_STANDARD_LIBRARIES APPEND "'") + list(TRANSFORM WIN_C_STANDARD_LIBRARIES PREPEND "'") + list(JOIN WIN_C_STANDARD_LIBRARIES ", " WIN_C_STANDARD_LIBRARIES) + string(APPEND NATIVE "c_winlibs = [${WIN_C_STANDARD_LIBRARIES}]\n") + string(REGEX REPLACE "( |^)(-|/)" ";\\2" WIN_CXX_STANDARD_LIBRARIES "${VCPKG_DETECTED_CMAKE_CXX_STANDARD_LIBRARIES}") + string(REGEX REPLACE "\\.lib " ".lib;" WIN_CXX_STANDARD_LIBRARIES "${WIN_CXX_STANDARD_LIBRARIES}") + list(TRANSFORM WIN_CXX_STANDARD_LIBRARIES APPEND "'") + list(TRANSFORM WIN_CXX_STANDARD_LIBRARIES PREPEND "'") + list(JOIN WIN_CXX_STANDARD_LIBRARIES ", " WIN_CXX_STANDARD_LIBRARIES) + string(APPEND NATIVE "cpp_winlibs = [${WIN_CXX_STANDARD_LIBRARIES}]\n") + endif() + + set(_file "${CURRENT_BUILDTREES_DIR}/meson-nativ-${TARGET_TRIPLET}.log") + set(VCPKG_MESON_NATIVE_FILE "${_file}" PARENT_SCOPE) + file(WRITE "${_file}" "${NATIVE}") +endfunction() + +function(vcpkg_internal_meson_convert_compiler_flags_to_list _out_var _compiler_flags) + string(REPLACE ";" "\\\;" tmp_var "${_compiler_flags}") + string(REGEX REPLACE [=[( +|^)((\"(\\\"|[^"])+\"|\\\"|\\ |[^ ])+)]=] ";\\2" ${_out_var} "${tmp_var}") + list(POP_FRONT ${_out_var}) # The first element is always empty due to the above replacement + list(TRANSFORM ${_out_var} STRIP) # Strip leading trailing whitespaces from each element in the list. + set(${_out_var} "${${_out_var}}" PARENT_SCOPE) +endfunction() + +function(vcpkg_internal_meson_convert_list_to_python_array _out_var) + set(FLAG_LIST ${ARGN}) + list(TRANSFORM FLAG_LIST APPEND "'") + list(TRANSFORM FLAG_LIST PREPEND "'") + list(JOIN FLAG_LIST ", " ${_out_var}) + string(REPLACE "'', " "" ${_out_var} "${${_out_var}}") # remove empty elements if any + set(${_out_var} "[${${_out_var}}]" PARENT_SCOPE) +endfunction() + +# Generates the required compiler properties for meson +function(vcpkg_internal_meson_generate_flags_properties_string _out_var _config) + if(VCPKG_TARGET_IS_WINDOWS) + set(L_FLAG /LIBPATH:) + else() + set(L_FLAG -L) + endif() + set(PATH_SUFFIX_DEBUG /debug) + set(LIBPATH_${_config} "${L_FLAG}${CURRENT_INSTALLED_DIR}${PATH_SUFFIX_${_config}}/lib") + vcpkg_internal_meson_convert_compiler_flags_to_list(MESON_CFLAGS_${_config} "${VCPKG_DETECTED_CMAKE_C_FLAGS_${_config}}") + list(APPEND MESON_CFLAGS_${_config} "-I\"${CURRENT_INSTALLED_DIR}/include\"") + vcpkg_internal_meson_convert_list_to_python_array(MESON_CFLAGS_${_config} ${MESON_CFLAGS_${_config}}) + string(APPEND ${_out_var} "c_args = ${MESON_CFLAGS_${_config}}\n") + vcpkg_internal_meson_convert_compiler_flags_to_list(MESON_CXXFLAGS_${_config} "${VCPKG_DETECTED_CMAKE_CXX_FLAGS_${_config}}") + list(APPEND MESON_CXXFLAGS_${_config} "-I\"${CURRENT_INSTALLED_DIR}/include\"") + vcpkg_internal_meson_convert_list_to_python_array(MESON_CXXFLAGS_${_config} ${MESON_CXXFLAGS_${_config}}) + string(APPEND ${_out_var} "cpp_args = ${MESON_CXXFLAGS_${_config}}\n") + if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") + set(LINKER_FLAGS_${_config} "${VCPKG_DETECTED_CMAKE_SHARED_LINKER_FLAGS_${_config}}") + else() + set(LINKER_FLAGS_${_config} "${VCPKG_DETECTED_CMAKE_STATIC_LINKER_FLAGS_${_config}}") + endif() + vcpkg_internal_meson_convert_compiler_flags_to_list(LINKER_FLAGS_${_config} "${LINKER_FLAGS_${_config}}") + list(APPEND LINKER_FLAGS_${_config} "${LIBPATH_${_config}}") + vcpkg_internal_meson_convert_list_to_python_array(LINKER_FLAGS_${_config} ${LINKER_FLAGS_${_config}}) + string(APPEND ${_out_var} "c_link_args = ${LINKER_FLAGS_${_config}}\n") + string(APPEND ${_out_var} "cpp_link_args = ${LINKER_FLAGS_${_config}}\n") + set(${_out_var} "${${_out_var}}" PARENT_SCOPE) +endfunction() + +function(vcpkg_internal_meson_generate_native_file_config _config) #https://mesonbuild.com/Native-environments.html + set(NATIVE_${_config} "[properties]\n") #https://mesonbuild.com/Builtin-options.html + vcpkg_internal_meson_generate_flags_properties_string(NATIVE_PROPERTIES ${_config}) + string(APPEND NATIVE_${_config} "${NATIVE_PROPERTIES}") + #Setup CMake properties + string(APPEND NATIVE_${_config} "cmake_toolchain_file = '${SCRIPTS}/buildsystems/vcpkg.cmake'\n") + string(APPEND NATIVE_${_config} "[cmake]\n") + + if(NOT VCPKG_CHAINLOAD_TOOLCHAIN_FILE) + if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW) + set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${SCRIPTS}/toolchains/windows.cmake") + elseif(VCPKG_TARGET_IS_LINUX) + set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${SCRIPTS}/toolchains/linux.cmake") + elseif(VCPKG_TARGET_IS_ANDROID) + set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${SCRIPTS}/toolchains/android.cmake") + elseif(VCPKG_TARGET_IS_OSX) + set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${SCRIPTS}/toolchains/osx.cmake") + elseif(VCPKG_TARGET_IS_IOS) + set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${SCRIPTS}/toolchains/ios.cmake") + elseif(VCPKG_TARGET_IS_FREEBSD) + set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${SCRIPTS}/toolchains/freebsd.cmake") + elseif(VCPKG_TARGET_IS_OPENBSD) + set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${SCRIPTS}/toolchains/openbsd.cmake") + elseif(VCPKG_TARGET_IS_MINGW) + set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${SCRIPTS}/toolchains/mingw.cmake") + endif() + endif() + + string(APPEND NATIVE_${_config} "VCPKG_TARGET_TRIPLET = '${TARGET_TRIPLET}'\n") + string(APPEND NATIVE_${_config} "VCPKG_CHAINLOAD_TOOLCHAIN_FILE = '${VCPKG_CHAINLOAD_TOOLCHAIN_FILE}'\n") + string(APPEND NATIVE_${_config} "VCPKG_CRT_LINKAGE = '${VCPKG_CRT_LINKAGE}'\n") + + string(APPEND NATIVE_${_config} "[built-in options]\n") + if(VCPKG_TARGET_IS_WINDOWS) + if(VCPKG_CRT_LINKAGE STREQUAL "static") + set(CRT mt) + else() + set(CRT md) + endif() + if(${_config} STREQUAL DEBUG) + set(CRT ${CRT}d) + endif() + string(APPEND NATIVE_${_config} "b_vscrt = '${CRT}'\n") + endif() + string(TOLOWER "${_config}" lowerconfig) + set(_file "${CURRENT_BUILDTREES_DIR}/meson-nativ-${TARGET_TRIPLET}-${lowerconfig}.log") + set(VCPKG_MESON_NATIVE_FILE_${_config} "${_file}" PARENT_SCOPE) + file(WRITE "${_file}" "${NATIVE_${_config}}") +endfunction() + +function(vcpkg_internal_meson_generate_cross_file _additional_binaries) #https://mesonbuild.com/Cross-compilation.html + if(CMAKE_HOST_WIN32) + if(DEFINED ENV{PROCESSOR_ARCHITEW6432}) + set(BUILD_ARCH $ENV{PROCESSOR_ARCHITEW6432}) + else() + set(BUILD_ARCH $ENV{PROCESSOR_ARCHITECTURE}) + endif() + if(BUILD_ARCH MATCHES "(amd|AMD)64") + set(BUILD_CPU_FAM x86_x64) + set(BUILD_CPU x86_x64) + elseif(BUILD_ARCH MATCHES "(x|X)86") + set(BUILD_CPU_FAM x86) + set(BUILD_CPU i686) + elseif(BUILD_ARCH MATCHES "^(ARM|arm)64$") + set(BUILD_CPU_FAM aarch64) + set(BUILD_CPU armv8) + elseif(BUILD_ARCH MATCHES "^(ARM|arm)$") + set(BUILD_CPU_FAM arm) + set(BUILD_CPU armv7hl) + else() + message(FATAL_ERROR "Unsupported host architecture ${BUILD_ARCH}!" ) + endif() + else() # TODO: add correct detection for OSX and Linux. Currently only x64 triplets are available in official vcpkg. + set(BUILD_CPU_FAM x86_x64) + set(BUILD_CPU x86_x64) + endif() + + if(VCPKG_TARGET_ARCHITECTURE MATCHES "(amd|AMD|x|X)64") + set(HOST_CPU_FAM x86_x64) + set(HOST_CPU x86_x64) + elseif(VCPKG_TARGET_ARCHITECTURE MATCHES "(x|X)86") + set(HOST_CPU_FAM x86) + set(HOST_CPU i686) + elseif(VCPKG_TARGET_ARCHITECTURE MATCHES "^(ARM|arm)64$") + set(HOST_CPU_FAM aarch64) + set(HOST_CPU armv8) + elseif(VCPKG_TARGET_ARCHITECTURE MATCHES "^(ARM|arm)$") + set(HOST_CPU_FAM arm) + set(HOST_CPU armv7hl) + else() + message(FATAL_ERROR "Unsupported target architecture ${VCPKG_TARGET_ARCHITECTURE}!" ) + endif() + set(CROSS "[binaries]\n") + if(VCPKG_TARGET_IS_WINDOWS) + set(proglist MT) + else() + set(proglist AR RANLIB STRIP NM OBJDUMP DLLTOOL MT) + endif() + foreach(prog IN LISTS proglist) + if(VCPKG_DETECTED_CMAKE_${prog}) + string(TOLOWER "${prog}" proglower) + string(APPEND CROSS "${proglower} = '${VCPKG_DETECTED_CMAKE_${prog}}'\n") + endif() + endforeach() + set(compiler C CXX RC) + foreach(prog IN LISTS compiler) + if(VCPKG_DETECTED_CMAKE_${prog}_COMPILER) + string(REPLACE "CXX" "CPP" mesonprog "${prog}") + string(TOLOWER "${mesonprog}" proglower) + string(APPEND CROSS "${proglower} = '${VCPKG_DETECTED_CMAKE_${prog}_COMPILER}'\n") + endif() + endforeach() + if(VCPKG_DETECTED_CMAKE_LINKER AND VCPKG_TARGET_IS_WINDOWS) + string(APPEND CROSS "c_ld = '${VCPKG_DETECTED_CMAKE_LINKER}'\n") + string(APPEND CROSS "cpp_ld = '${VCPKG_DETECTED_CMAKE_LINKER}'\n") + endif() + foreach(_binary IN LISTS ${_additional_binaries}) + string(APPEND CROSS "${_binary}\n") + endforeach() + + string(APPEND CROSS "[properties]\n") + + string(APPEND CROSS "[host_machine]\n") + string(APPEND CROSS "endian = 'little'\n") + if(NOT VCPKG_CMAKE_SYSTEM_NAME) + set(MESON_SYSTEM_NAME "windows") + else() + string(TOLOWER "${VCPKG_CMAKE_SYSTEM_NAME}" MESON_SYSTEM_NAME) + endif() + string(APPEND CROSS "system = '${MESON_SYSTEM_NAME}'\n") + string(APPEND CROSS "cpu_family = '${HOST_CPU_FAM}'\n") + string(APPEND CROSS "cpu = '${HOST_CPU}'\n") + + string(APPEND CROSS "[build_machine]\n") + string(APPEND CROSS "endian = 'little'\n") + if(WIN32) + string(APPEND CROSS "system = 'windows'\n") + elseif(DARWIN) + string(APPEND CROSS "system = 'darwin'\n") + else() + string(APPEND CROSS "system = 'linux'\n") + endif() + string(APPEND CROSS "cpu_family = '${BUILD_CPU_FAM}'\n") + string(APPEND CROSS "cpu = '${BUILD_CPU}'\n") + + if(NOT BUILD_CPU_FAM MATCHES "${HOST_CPU_FAM}" OR VCPKG_TARGET_IS_ANDROID OR VCPKG_TARGET_IS_IOS OR VCPKG_TARGET_IS_UWP) + set(_file "${CURRENT_BUILDTREES_DIR}/meson-cross-${TARGET_TRIPLET}.log") + set(VCPKG_MESON_CROSS_FILE "${_file}" PARENT_SCOPE) + file(WRITE "${_file}" "${CROSS}") + endif() +endfunction() + +function(vcpkg_internal_meson_generate_cross_file_config _config) #https://mesonbuild.com/Native-environments.html + set(CROSS_${_config} "[properties]\n") #https://mesonbuild.com/Builtin-options.html + vcpkg_internal_meson_generate_flags_properties_string(CROSS_PROPERTIES ${_config}) + string(APPEND CROSS_${_config} "${CROSS_PROPERTIES}") + string(APPEND CROSS_${_config} "[built-in options]\n") + if(VCPKG_TARGET_IS_WINDOWS) + if(VCPKG_CRT_LINKAGE STREQUAL "static") + set(CRT mt) + else() + set(CRT md) + endif() + if(${_config} STREQUAL DEBUG) + set(CRT ${CRT}d) + endif() + string(APPEND CROSS_${_config} "b_vscrt = '${CRT}'\n") + endif() + string(TOLOWER "${_config}" lowerconfig) + set(_file "${CURRENT_BUILDTREES_DIR}/meson-cross-${TARGET_TRIPLET}-${lowerconfig}.log") + set(VCPKG_MESON_CROSS_FILE_${_config} "${_file}" PARENT_SCOPE) + file(WRITE "${_file}" "${CROSS_${_config}}") +endfunction() + + +function(vcpkg_configure_meson) + # parse parameters such that semicolons in options arguments to COMMAND don't get erased + cmake_parse_arguments(PARSE_ARGV 0 _vcm "" "SOURCE_PATH" "OPTIONS;OPTIONS_DEBUG;OPTIONS_RELEASE;ADDITIONAL_NATIVE_BINARIES;ADDITIONAL_CROSS_BINARIES") + + file(REMOVE_RECURSE "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel") + file(REMOVE_RECURSE "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg") + + vcpkg_internal_get_cmake_vars(OUTPUT_FILE _VCPKG_CMAKE_VARS_FILE) + set(_VCPKG_CMAKE_VARS_FILE "${_VCPKG_CMAKE_VARS_FILE}" PARENT_SCOPE) + debug_message("Including cmake vars from: ${_VCPKG_CMAKE_VARS_FILE}") + include("${_VCPKG_CMAKE_VARS_FILE}") + + vcpkg_find_acquire_program(PYTHON3) + get_filename_component(PYTHON3_DIR "${PYTHON3}" DIRECTORY) + vcpkg_add_to_path("${PYTHON3_DIR}") + list(APPEND _vcm_ADDITIONAL_NATIVE_BINARIES "python = '${PYTHON3}'") + list(APPEND _vcm_ADDITIONAL_CROSS_BINARIES "python = '${PYTHON3}'") + + vcpkg_find_acquire_program(MESON) + + get_filename_component(CMAKE_PATH ${CMAKE_COMMAND} DIRECTORY) + vcpkg_add_to_path("${CMAKE_PATH}") # Make CMake invokeable for Meson + + vcpkg_find_acquire_program(NINJA) + get_filename_component(NINJA_PATH ${NINJA} DIRECTORY) + vcpkg_add_to_path(PREPEND "${NINJA_PATH}") # Need to prepend so that meson picks up the correct ninja from vcpkg .... + # list(APPEND _vcm_ADDITIONAL_NATIVE_BINARIES "ninja = '${NINJA}'") # This does not work due to meson issues ...... + + list(APPEND _vcm_OPTIONS --buildtype plain --backend ninja --wrap-mode nodownload) + + if(NOT VCPKG_MESON_CROSS_FILE) + vcpkg_internal_meson_generate_cross_file("_vcm_ADDITIONAL_CROSS_BINARIES") + endif() + if(NOT VCPKG_MESON_CROSS_FILE_DEBUG AND VCPKG_MESON_CROSS_FILE) + vcpkg_internal_meson_generate_cross_file_config(DEBUG) + endif() + if(NOT VCPKG_MESON_CROSS_FILE_RELEASE AND VCPKG_MESON_CROSS_FILE) + vcpkg_internal_meson_generate_cross_file_config(RELEASE) + endif() + if(VCPKG_MESON_CROSS_FILE) + list(APPEND _vcm_OPTIONS --cross "${VCPKG_MESON_CROSS_FILE}") + endif() + if(VCPKG_MESON_CROSS_FILE_DEBUG) + list(APPEND _vcm_OPTIONS_DEBUG --cross "${VCPKG_MESON_CROSS_FILE_DEBUG}") + endif() + if(VCPKG_MESON_CROSS_FILE_RELEASE) + list(APPEND _vcm_OPTIONS_RELEASE --cross "${VCPKG_MESON_CROSS_FILE_RELEASE}") + endif() + + if(NOT VCPKG_MESON_NATIVE_FILE AND NOT VCPKG_MESON_CROSS_FILE) + vcpkg_internal_meson_generate_native_file("_vcm_ADDITIONAL_NATIVE_BINARIES") + endif() + if(NOT VCPKG_MESON_NATIVE_FILE_DEBUG AND NOT VCPKG_MESON_CROSS_FILE) + vcpkg_internal_meson_generate_native_file_config(DEBUG) + endif() + if(NOT VCPKG_MESON_NATIVE_FILE_RELEASE AND NOT VCPKG_MESON_CROSS_FILE) + vcpkg_internal_meson_generate_native_file_config(RELEASE) + endif() + if(VCPKG_MESON_NATIVE_FILE AND NOT VCPKG_MESON_CROSS_FILE) + list(APPEND _vcm_OPTIONS --native "${VCPKG_MESON_NATIVE_FILE}") + list(APPEND _vcm_OPTIONS_DEBUG --native "${VCPKG_MESON_NATIVE_FILE_DEBUG}") + list(APPEND _vcm_OPTIONS_RELEASE --native "${VCPKG_MESON_NATIVE_FILE_RELEASE}") + else() + list(APPEND _vcm_OPTIONS --native "${SCRIPTS}/buildsystems/meson/none.txt") + endif() + if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") + list(APPEND _vcm_OPTIONS --default-library shared) + else() + list(APPEND _vcm_OPTIONS --default-library static) + endif() + + list(APPEND _vcm_OPTIONS --libdir lib) # else meson install into an architecture describing folder + list(APPEND _vcm_OPTIONS_DEBUG -Ddebug=true --prefix ${CURRENT_PACKAGES_DIR}/debug --includedir ../include) + list(APPEND _vcm_OPTIONS_RELEASE -Ddebug=false --prefix ${CURRENT_PACKAGES_DIR}) + + # select meson cmd-line options + if(VCPKG_TARGET_IS_WINDOWS) + list(APPEND _vcm_OPTIONS_DEBUG "-Dcmake_prefix_path=['${CURRENT_INSTALLED_DIR}/debug','${CURRENT_INSTALLED_DIR}','${CURRENT_INSTALLED_DIR}/share']") + list(APPEND _vcm_OPTIONS_RELEASE "-Dcmake_prefix_path=['${CURRENT_INSTALLED_DIR}','${CURRENT_INSTALLED_DIR}/debug','${CURRENT_INSTALLED_DIR}/share']") + else() + list(APPEND _vcm_OPTIONS_DEBUG "-Dcmake_prefix_path=['${CURRENT_INSTALLED_DIR}/debug','${CURRENT_INSTALLED_DIR}']") + list(APPEND _vcm_OPTIONS_RELEASE "-Dcmake_prefix_path=['${CURRENT_INSTALLED_DIR}','${CURRENT_INSTALLED_DIR}/debug']") + endif() + + vcpkg_find_acquire_program(PKGCONFIG) + get_filename_component(PKGCONFIG_PATH ${PKGCONFIG} DIRECTORY) + vcpkg_add_to_path("${PKGCONFIG_PATH}") + set(PKGCONFIG_SHARE_DIR "${CURRENT_INSTALLED_DIR}/share/pkgconfig/") + + set(buildtypes) + if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") + set(BUILDNAME DEBUG) + list(APPEND buildtypes ${BUILDNAME}) + set(PATH_SUFFIX_${BUILDNAME} "debug/") + set(SUFFIX_${BUILDNAME} "dbg") + endif() + if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") + set(BUILDNAME RELEASE) + list(APPEND buildtypes ${BUILDNAME}) + set(PATH_SUFFIX_${BUILDNAME} "") + set(SUFFIX_${BUILDNAME} "rel") + endif() + + if(VCPKG_TARGET_IS_OSX) + if(DEFINED ENV{SDKROOT}) + set(_VCPKG_ENV_SDKROOT_BACKUP $ENV{SDKROOT}) + endif() + set(ENV{SDKROOT} "${VCPKG_DETECTED_CMAKE_OSX_SYSROOT}") + set(VCPKG_DETECTED_CMAKE_OSX_SYSROOT "${VCPKG_DETECTED_CMAKE_OSX_SYSROOT}" PARENT_SCOPE) + + if(DEFINED ENV{MACOSX_DEPLOYMENT_TARGET}) + set(_VCPKG_ENV_MACOSX_DEPLOYMENT_TARGET_BACKUP $ENV{MACOSX_DEPLOYMENT_TARGET}) + endif() + set(ENV{MACOSX_DEPLOYMENT_TARGET} "${VCPKG_DETECTED_CMAKE_OSX_DEPLOYMENT_TARGET}") + set(VCPKG_DETECTED_CMAKE_OSX_DEPLOYMENT_TARGET "${VCPKG_DETECTED_CMAKE_OSX_DEPLOYMENT_TARGET}" PARENT_SCOPE) + endif() + + if(DEFINED ENV{INCLUDE}) + set(ENV{INCLUDE} "$ENV{INCLUDE}${VCPKG_HOST_PATH_SEPARATOR}${CURRENT_INSTALLED_DIR}/include") + else() + set(ENV{INCLUDE} "${CURRENT_INSTALLED_DIR}/include") + endif() + # configure build + foreach(buildtype IN LISTS buildtypes) + message(STATUS "Configuring ${TARGET_TRIPLET}-${SUFFIX_${buildtype}}") + file(MAKE_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${SUFFIX_${buildtype}}") + #setting up PKGCONFIG + set(ENV{PKG_CONFIG} "${PKGCONFIG}") # Set via native file? + set(PKGCONFIG_INSTALLED_DIR "${CURRENT_INSTALLED_DIR}/${PATH_SUFFIX_${buildtype}}lib/pkgconfig/") + if(DEFINED ENV{PKG_CONFIG_PATH}) + set(BACKUP_ENV_PKG_CONFIG_PATH_RELEASE $ENV{PKG_CONFIG_PATH}) + set(ENV{PKG_CONFIG_PATH} "${PKGCONFIG_INSTALLED_DIR}${VCPKG_HOST_PATH_SEPARATOR}${PKGCONFIG_SHARE_DIR}${VCPKG_HOST_PATH_SEPARATOR}$ENV{PKG_CONFIG_PATH}") + else() + set(ENV{PKG_CONFIG_PATH} "${PKGCONFIG_INSTALLED_DIR}${VCPKG_HOST_PATH_SEPARATOR}${PKGCONFIG_SHARE_DIR}") + endif() + + vcpkg_execute_required_process( + COMMAND ${MESON} ${_vcm_OPTIONS} ${_vcm_OPTIONS_${buildtype}} ${_vcm_SOURCE_PATH} + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${SUFFIX_${buildtype}} + LOGNAME config-${TARGET_TRIPLET}-${SUFFIX_${buildtype}} + ) + + #Copy meson log files into buildtree for CI + if(EXISTS "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${SUFFIX_${buildtype}}/meson-logs/meson-log.txt") + file(COPY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${SUFFIX_${buildtype}}/meson-logs/meson-log.txt" DESTINATION "${CURRENT_BUILDTREES_DIR}") + file(RENAME "${CURRENT_BUILDTREES_DIR}/meson-log.txt" "${CURRENT_BUILDTREES_DIR}/meson-log-${SUFFIX_${buildtype}}.txt") + endif() + if(EXISTS "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${SUFFIX_${buildtype}}/meson-logs/install-log.txt") + file(COPY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${SUFFIX_${buildtype}}/meson-logs/install-log.txt" DESTINATION "${CURRENT_BUILDTREES_DIR}") + file(RENAME "${CURRENT_BUILDTREES_DIR}/install-log.txt" "${CURRENT_BUILDTREES_DIR}/install-log-${SUFFIX_${buildtype}}.txt") + endif() + message(STATUS "Configuring ${TARGET_TRIPLET}-${SUFFIX_${buildtype}} done") + + #Restore PKG_CONFIG_PATH + if(BACKUP_ENV_PKG_CONFIG_PATH_${buildtype}) + set(ENV{PKG_CONFIG_PATH} "${BACKUP_ENV_PKG_CONFIG_PATH_${buildtype}}") + unset(BACKUP_ENV_PKG_CONFIG_PATH_${buildtype}) + else() + unset(ENV{PKG_CONFIG_PATH}) + endif() + endforeach() + + if(VCPKG_TARGET_IS_OSX) + if(DEFINED _VCPKG_ENV_SDKROOT_BACKUP) + set(ENV{SDKROOT} "${_VCPKG_ENV_SDKROOT_BACKUP}") + else() + unset(ENV{SDKROOT}) + endif() + if(DEFINED _VCPKG_ENV_MACOSX_DEPLOYMENT_TARGET_BACKUP) + set(ENV{MACOSX_DEPLOYMENT_TARGET} "${_VCPKG_ENV_MACOSX_DEPLOYMENT_TARGET_BACKUP}") + else() + unset(ENV{MACOSX_DEPLOYMENT_TARGET}) + endif() + endif() +endfunction() diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_configure_qmake.cmake b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_configure_qmake.cmake new file mode 100644 index 000000000..6fa3a609a --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_configure_qmake.cmake @@ -0,0 +1,134 @@ +#[===[.md: +# vcpkg_configure_qmake + +Configure a qmake-based project. + +```cmake +vcpkg_configure_qmake( + SOURCE_PATH <pro_file_path> + [OPTIONS arg1 [arg2 ...]] + [OPTIONS_RELEASE arg1 [arg2 ...]] + [OPTIONS_DEBUG arg1 [arg2 ...]] +) +``` + +### SOURCE_PATH +The path to the *.pro qmake project file. + +### OPTIONS, OPTIONS\_RELEASE, OPTIONS\_DEBUG +The options passed to qmake. +#]===] + +function(vcpkg_configure_qmake) + # parse parameters such that semicolons in options arguments to COMMAND don't get erased + cmake_parse_arguments(PARSE_ARGV 0 _csc "" "SOURCE_PATH" "OPTIONS;OPTIONS_RELEASE;OPTIONS_DEBUG;BUILD_OPTIONS;BUILD_OPTIONS_RELEASE;BUILD_OPTIONS_DEBUG") + + # Find qmake executable + set(_triplet_hostbindir ${CURRENT_INSTALLED_DIR}/tools/qt5/bin) + if(DEFINED VCPKG_QT_HOST_TOOLS_ROOT_DIR) + find_program(QMAKE_COMMAND NAMES qmake PATHS ${VCPKG_QT_HOST_TOOLS_ROOT_DIR}/bin ${_triplet_hostbindir} NO_DEFAULT_PATH) + else() + find_program(QMAKE_COMMAND NAMES qmake PATHS ${_triplet_hostbindir} NO_DEFAULT_PATH) + endif() + + if(NOT QMAKE_COMMAND) + message(FATAL_ERROR "vcpkg_configure_qmake: unable to find qmake.") + endif() + + if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + list(APPEND _csc_OPTIONS "CONFIG-=shared") + list(APPEND _csc_OPTIONS "CONFIG*=static") + else() + list(APPEND _csc_OPTIONS "CONFIG-=static") + list(APPEND _csc_OPTIONS "CONFIG*=shared") + list(APPEND _csc_OPTIONS_DEBUG "CONFIG*=separate_debug_info") + endif() + + if(VCPKG_TARGET_IS_WINDOWS AND VCPKG_CRT_LINKAGE STREQUAL "static") + list(APPEND _csc_OPTIONS "CONFIG*=static-runtime") + endif() + + # Cleanup build directories + file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) + + if(DEFINED VCPKG_OSX_DEPLOYMENT_TARGET) + set(ENV{QMAKE_MACOSX_DEPLOYMENT_TARGET} ${VCPKG_OSX_DEPLOYMENT_TARGET}) + endif() + + vcpkg_find_acquire_program(PKGCONFIG) + set(ENV{PKG_CONFIG} "${PKGCONFIG}") + get_filename_component(PKGCONFIG_PATH "${PKGCONFIG}" DIRECTORY) + vcpkg_add_to_path("${PKGCONFIG_PATH}") + + if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") + set(_config RELEASE) + set(PKGCONFIG_INSTALLED_DIR "${_VCPKG_INSTALLED_PKGCONF}${PATH_SUFFIX_${_config}}/lib/pkgconfig") + set(PKGCONFIG_INSTALLED_SHARE_DIR "${_VCPKG_INSTALLED_PKGCONF}/share/pkgconfig") + set(PKGCONFIG_PACKAGES_DIR "${_VCPKG_PACKAGES_PKGCONF}${PATH_SUFFIX_${_config}}/lib/pkgconfig") + set(PKGCONFIG_PACKAGES_SHARE_DIR "${_VCPKG_PACKAGES_PKGCONF}/share/pkgconfig") + if(DEFINED ENV{PKG_CONFIG_PATH}) + set(BACKUP_ENV_PKG_CONFIG_PATH_${_config} $ENV{PKG_CONFIG_PATH}) + set(ENV{PKG_CONFIG_PATH} "${PKGCONFIG_INSTALLED_DIR}${VCPKG_HOST_PATH_SEPARATOR}${PKGCONFIG_INSTALLED_SHARE_DIR}${VCPKG_HOST_PATH_SEPARATOR}${PKGCONFIG_PACKAGES_DIR}${VCPKG_HOST_PATH_SEPARATOR}${PKGCONFIG_PACKAGES_SHARE_DIR}${VCPKG_HOST_PATH_SEPARATOR}$ENV{PKG_CONFIG_PATH}") + else() + set(ENV{PKG_CONFIG_PATH} "${PKGCONFIG_INSTALLED_DIR}${VCPKG_HOST_PATH_SEPARATOR}${PKGCONFIG_INSTALLED_SHARE_DIR}${VCPKG_HOST_PATH_SEPARATOR}${PKGCONFIG_PACKAGES_DIR}${VCPKG_HOST_PATH_SEPARATOR}${PKGCONFIG_PACKAGES_SHARE_DIR}") + endif() + + configure_file(${CURRENT_INSTALLED_DIR}/tools/qt5/qt_release.conf ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/qt.conf) + + message(STATUS "Configuring ${TARGET_TRIPLET}-rel") + file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) + if(DEFINED _csc_BUILD_OPTIONS OR DEFINED _csc_BUILD_OPTIONS_RELEASE) + set(BUILD_OPT -- ${_csc_BUILD_OPTIONS} ${_csc_BUILD_OPTIONS_RELEASE}) + endif() + vcpkg_execute_required_process( + COMMAND ${QMAKE_COMMAND} CONFIG-=debug CONFIG+=release + ${_csc_OPTIONS} ${_csc_OPTIONS_RELEASE} ${_csc_SOURCE_PATH} + -qtconf "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/qt.conf" + ${BUILD_OPT} + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel + LOGNAME config-${TARGET_TRIPLET}-rel + ) + message(STATUS "Configuring ${TARGET_TRIPLET}-rel done") + if(EXISTS "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/config.log") + file(REMOVE "${CURRENT_BUILDTREES_DIR}/internal-config-${TARGET_TRIPLET}-rel.log") + file(RENAME "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/config.log" "${CURRENT_BUILDTREES_DIR}/internal-config-${TARGET_TRIPLET}-rel.log") + endif() + endif() + + if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") + set(_config DEBUG) + set(PATH_SUFFIX_DEBUG /debug) + set(PKGCONFIG_INSTALLED_DIR "${_VCPKG_INSTALLED_PKGCONF}${PATH_SUFFIX_${_config}}/lib/pkgconfig") + set(PKGCONFIG_INSTALLED_SHARE_DIR "${_VCPKG_INSTALLED_PKGCONF}/share/pkgconfig") + set(PKGCONFIG_PACKAGES_DIR "${_VCPKG_PACKAGES_PKGCONF}${PATH_SUFFIX_${_config}}/lib/pkgconfig") + set(PKGCONFIG_PACKAGES_SHARE_DIR "${_VCPKG_PACKAGES_PKGCONF}/share/pkgconfig") + if(DEFINED ENV{PKG_CONFIG_PATH}) + set(BACKUP_ENV_PKG_CONFIG_PATH_${_config} $ENV{PKG_CONFIG_PATH}) + set(ENV{PKG_CONFIG_PATH} "${PKGCONFIG_INSTALLED_DIR}${VCPKG_HOST_PATH_SEPARATOR}${PKGCONFIG_INSTALLED_SHARE_DIR}${VCPKG_HOST_PATH_SEPARATOR}${PKGCONFIG_PACKAGES_DIR}${VCPKG_HOST_PATH_SEPARATOR}${PKGCONFIG_PACKAGES_SHARE_DIR}${VCPKG_HOST_PATH_SEPARATOR}$ENV{PKG_CONFIG_PATH}") + else() + set(ENV{PKG_CONFIG_PATH} "${PKGCONFIG_INSTALLED_DIR}${VCPKG_HOST_PATH_SEPARATOR}${PKGCONFIG_INSTALLED_SHARE_DIR}${VCPKG_HOST_PATH_SEPARATOR}${PKGCONFIG_PACKAGES_DIR}${VCPKG_HOST_PATH_SEPARATOR}${PKGCONFIG_PACKAGES_SHARE_DIR}") + endif() + + configure_file(${CURRENT_INSTALLED_DIR}/tools/qt5/qt_debug.conf ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/qt.conf) + + message(STATUS "Configuring ${TARGET_TRIPLET}-dbg") + file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) + if(DEFINED _csc_BUILD_OPTIONS OR DEFINED _csc_BUILD_OPTIONS_DEBUG) + set(BUILD_OPT -- ${_csc_BUILD_OPTIONS} ${_csc_BUILD_OPTIONS_DEBUG}) + endif() + vcpkg_execute_required_process( + COMMAND ${QMAKE_COMMAND} CONFIG-=release CONFIG+=debug + ${_csc_OPTIONS} ${_csc_OPTIONS_DEBUG} ${_csc_SOURCE_PATH} + -qtconf "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/qt.conf" + ${BUILD_OPT} + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg + LOGNAME config-${TARGET_TRIPLET}-dbg + ) + message(STATUS "Configuring ${TARGET_TRIPLET}-dbg done") + if(EXISTS "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/config.log") + file(REMOVE "${CURRENT_BUILDTREES_DIR}/internal-config-${TARGET_TRIPLET}-dbg.log") + file(RENAME "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/config.log" "${CURRENT_BUILDTREES_DIR}/internal-config-${TARGET_TRIPLET}-dbg.log") + endif() + endif() + +endfunction() diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_copy_pdbs.cmake b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_copy_pdbs.cmake new file mode 100644 index 000000000..dd489db02 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_copy_pdbs.cmake @@ -0,0 +1,73 @@ +#[===[.md: +# vcpkg_copy_pdbs + +Automatically locate pdbs in the build tree and copy them adjacent to all DLLs. + +```cmake +vcpkg_copy_pdbs( + [BUILD_PATHS <glob>...]) +``` + +The `<glob>`s are patterns which will be passed to `file(GLOB_RECURSE)`, +for locating DLLs. It defaults to using: + +- `${CURRENT_PACKAGES_DIR}/bin/*.dll` +- `${CURRENT_PACKAGES_DIR}/debug/bin/*.dll` + +since that is generally where DLLs are located. + +## Notes +This command should always be called by portfiles after they have finished rearranging the binary output. + +## Examples + +* [zlib](https://github.com/Microsoft/vcpkg/blob/master/ports/zlib/portfile.cmake) +* [cpprestsdk](https://github.com/Microsoft/vcpkg/blob/master/ports/cpprestsdk/portfile.cmake) +#]===] +function(vcpkg_copy_pdbs) + cmake_parse_arguments(PARSE_ARGV 0 "arg" "" "" "BUILD_PATHS") + + if(NOT DEFINED arg_BUILD_PATHS) + set( + arg_BUILD_PATHS + "${CURRENT_PACKAGES_DIR}/bin/*.dll" + "${CURRENT_PACKAGES_DIR}/debug/bin/*.dll" + ) + endif() + + set(dlls_without_matching_pdbs) + + if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic" AND VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW) + file(GLOB_RECURSE dlls ${arg_BUILD_PATHS}) + + set(vslang_backup "$ENV{VSLANG}") + set(ENV{VSLANG} 1033) + + foreach(dll IN LISTS dlls) + execute_process(COMMAND dumpbin /PDBPATH ${dll} + COMMAND findstr PDB + OUTPUT_VARIABLE pdb_line + ERROR_QUIET + RESULT_VARIABLE error_code + ) + + if(NOT error_code AND pdb_line MATCHES "PDB file found at") + string(REGEX MATCH [['.*']] pdb_path "${pdb_line}") # Extract the path which is in single quotes + string(REPLACE "'" "" pdb_path "${pdb_path}") # Remove single quotes + get_filename_component(dll_dir "${dll}" DIRECTORY) + file(COPY "${pdb_path}" DESTINATION "${dll_dir}") + else() + list(APPEND dlls_without_matching_pdbs "${dll}") + endif() + endforeach() + + set(ENV{VSLANG} "${vslang_backup}") + + list(LENGTH dlls_without_matching_pdbs unmatched_dlls_length) + if(unmatched_dlls_length GREATER 0) + list(JOIN dlls_without_matching_pdbs "\n " message) + message(WARNING "Could not find a matching pdb file for:${message}\n") + endif() + endif() + +endfunction() diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_copy_tool_dependencies.cmake b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_copy_tool_dependencies.cmake new file mode 100644 index 000000000..0cb0bbcef --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_copy_tool_dependencies.cmake @@ -0,0 +1,47 @@ +#[===[.md: +# vcpkg_copy_tool_dependencies + +Copy all DLL dependencies of built tools into the tool folder. + +## Usage +```cmake +vcpkg_copy_tool_dependencies(<${CURRENT_PACKAGES_DIR}/tools/${PORT}>) +``` +## Parameters +The path to the directory containing the tools. + +## Notes +This command should always be called by portfiles after they have finished rearranging the binary output, if they have any tools. + +## Examples + +* [glib](https://github.com/Microsoft/vcpkg/blob/master/ports/glib/portfile.cmake) +* [fltk](https://github.com/Microsoft/vcpkg/blob/master/ports/fltk/portfile.cmake) +#]===] + +function(vcpkg_copy_tool_dependencies TOOL_DIR) + if (VCPKG_TARGET_IS_WINDOWS) + find_program(PWSH_EXE pwsh) + if (NOT PWSH_EXE) + if(UNIX AND NOT CYGWIN) + message(FATAL_ERROR "Could not find PowerShell Core; install PowerShell Core as described here: https://docs.microsoft.com/en-us/powershell/scripting/install/installing-powershell-core-on-linux") + endif() + message(FATAL_ERROR "Could not find PowerShell Core; please open an issue to report this.") + endif() + macro(search_for_dependencies PATH_TO_SEARCH) + file(GLOB TOOLS "${TOOL_DIR}/*.exe" "${TOOL_DIR}/*.dll" "${TOOL_DIR}/*.pyd") + foreach(TOOL IN LISTS TOOLS) + vcpkg_execute_required_process( + COMMAND "${PWSH_EXE}" -noprofile -executionpolicy Bypass -nologo + -file "${SCRIPTS}/buildsystems/msbuild/applocal.ps1" + -targetBinary "${TOOL}" + -installedDir "${PATH_TO_SEARCH}" + WORKING_DIRECTORY "${VCPKG_ROOT_DIR}" + LOGNAME copy-tool-dependencies + ) + endforeach() + endmacro() + search_for_dependencies("${CURRENT_PACKAGES_DIR}/bin") + search_for_dependencies("${CURRENT_INSTALLED_DIR}/bin") + endif() +endfunction() diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_copy_tools.cmake b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_copy_tools.cmake new file mode 100644 index 000000000..18ddc3715 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_copy_tools.cmake @@ -0,0 +1,71 @@ +#[===[.md:
+# vcpkg_copy_tools
+
+Copy tools and all their DLL dependencies into the `tools` folder.
+
+## Usage
+```cmake
+vcpkg_copy_tools(
+ TOOL_NAMES <tool1>...
+ [SEARCH_DIR <${CURRENT_PACKAGES_DIR}/bin>]
+ [DESTINATION <${CURRENT_PACKAGES_DIR}/tools/${PORT}>]
+ [AUTO_CLEAN]
+)
+```
+## Parameters
+### TOOL_NAMES
+A list of tool filenames without extension.
+
+### SEARCH_DIR
+The path to the directory containing the tools. This will be set to `${CURRENT_PACKAGES_DIR}/bin` if omitted.
+
+### DESTINATION
+Destination to copy the tools to. This will be set to `${CURRENT_PACKAGES_DIR}/tools/${PORT}` if omitted.
+
+### AUTO_CLEAN
+Auto clean executables in `${CURRENT_PACKAGES_DIR}/bin` and `${CURRENT_PACKAGES_DIR}/debug/bin`.
+
+## Examples
+
+* [cpuinfo](https://github.com/microsoft/vcpkg/blob/master/ports/cpuinfo/portfile.cmake)
+* [nanomsg](https://github.com/microsoft/vcpkg/blob/master/ports/nanomsg/portfile.cmake)
+* [uriparser](https://github.com/microsoft/vcpkg/blob/master/ports/uriparser/portfile.cmake)
+#]===]
+
+function(vcpkg_copy_tools)
+ # parse parameters such that semicolons in options arguments to COMMAND don't get erased
+ cmake_parse_arguments(PARSE_ARGV 0 _vct "AUTO_CLEAN" "SEARCH_DIR;DESTINATION" "TOOL_NAMES")
+
+ if(NOT DEFINED _vct_TOOL_NAMES)
+ message(FATAL_ERROR "TOOL_NAMES must be specified.")
+ endif()
+
+ if(NOT DEFINED _vct_DESTINATION)
+ set(_vct_DESTINATION "${CURRENT_PACKAGES_DIR}/tools/${PORT}")
+ endif()
+
+ if(NOT DEFINED _vct_SEARCH_DIR)
+ set(_vct_SEARCH_DIR "${CURRENT_PACKAGES_DIR}/bin")
+ elseif(NOT IS_DIRECTORY ${_vct_SEARCH_DIR})
+ message(FATAL_ERROR "SEARCH_DIR ${_vct_SEARCH_DIR} is supposed to be a directory.")
+ endif()
+
+ foreach(tool_name IN LISTS _vct_TOOL_NAMES)
+ set(tool_path "${_vct_SEARCH_DIR}/${tool_name}${VCPKG_TARGET_EXECUTABLE_SUFFIX}")
+ set(tool_pdb "${_vct_SEARCH_DIR}/${tool_name}.pdb")
+ if(EXISTS "${tool_path}")
+ file(COPY "${tool_path}" DESTINATION "${_vct_DESTINATION}")
+ else()
+ message(FATAL_ERROR "Couldn't find this tool: ${tool_path}.")
+ endif()
+ if(EXISTS "${tool_pdb}")
+ file(COPY "${tool_pdb}" DESTINATION "${_vct_DESTINATION}")
+ endif()
+ endforeach()
+
+ if(_vct_AUTO_CLEAN)
+ vcpkg_clean_executables_in_bin(FILE_NAMES ${_vct_TOOL_NAMES})
+ endif()
+
+ vcpkg_copy_tool_dependencies("${_vct_DESTINATION}")
+endfunction()
diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_download_distfile.cmake b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_download_distfile.cmake new file mode 100644 index 000000000..8dd193f64 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_download_distfile.cmake @@ -0,0 +1,214 @@ +#[===[.md: +# vcpkg_download_distfile + +Download and cache a file needed for this port. + +This helper should always be used instead of CMake's built-in `file(DOWNLOAD)` command. + +## Usage +```cmake +vcpkg_download_distfile( + <OUT_VARIABLE> + URLS <http://mainUrl> <http://mirror1>... + FILENAME <output.zip> + SHA512 <5981de...> +) +``` +## Parameters +### OUT_VARIABLE +This variable will be set to the full path to the downloaded file. This can then immediately be passed in to [`vcpkg_extract_source_archive`](vcpkg_extract_source_archive.md) for sources. + +### URLS +A list of URLs to be consulted. They will be tried in order until one of the downloaded files successfully matches the SHA512 given. + +### FILENAME +The local name for the file. Files are shared between ports, so the file may need to be renamed to make it clearly attributed to this port and avoid conflicts. + +### SHA512 +The expected hash for the file. + +If this doesn't match the downloaded version, the build will be terminated with a message describing the mismatch. + +### QUIET +Suppress output on cache hit + +### SKIP_SHA512 +Skip SHA512 hash check for file. + +This switch is only valid when building with the `--head` command line flag. + +### HEADERS +A list of headers to append to the download request. This can be used for authentication during a download. + +Headers should be specified as "<header-name>: <header-value>". + +## Notes +The helper [`vcpkg_from_github`](vcpkg_from_github.md) should be used for downloading from GitHub projects. + +## Examples + +* [apr](https://github.com/Microsoft/vcpkg/blob/master/ports/apr/portfile.cmake) +* [fontconfig](https://github.com/Microsoft/vcpkg/blob/master/ports/fontconfig/portfile.cmake) +* [freetype](https://github.com/Microsoft/vcpkg/blob/master/ports/freetype/portfile.cmake) +#]===] + +include(vcpkg_execute_in_download_mode) + +function(vcpkg_download_distfile VAR) + set(options SKIP_SHA512 SILENT_EXIT QUIET) + set(oneValueArgs FILENAME SHA512) + set(multipleValuesArgs URLS HEADERS) + # parse parameters such that semicolons in options arguments to COMMAND don't get erased + cmake_parse_arguments(PARSE_ARGV 1 vcpkg_download_distfile "${options}" "${oneValueArgs}" "${multipleValuesArgs}") + + if(NOT DEFINED vcpkg_download_distfile_URLS) + message(FATAL_ERROR "vcpkg_download_distfile requires a URLS argument.") + endif() + if(NOT DEFINED vcpkg_download_distfile_FILENAME) + message(FATAL_ERROR "vcpkg_download_distfile requires a FILENAME argument.") + endif() + if(NOT _VCPKG_INTERNAL_NO_HASH_CHECK) + if(NOT vcpkg_download_distfile_SKIP_SHA512 AND NOT DEFINED vcpkg_download_distfile_SHA512) + message(FATAL_ERROR "vcpkg_download_distfile requires a SHA512 argument. If you do not know the SHA512, add it as 'SHA512 0' and re-run this command.") + endif() + if(vcpkg_download_distfile_SKIP_SHA512 AND DEFINED vcpkg_download_distfile_SHA512) + message(FATAL_ERROR "vcpkg_download_distfile must not be passed both SHA512 and SKIP_SHA512.") + endif() + endif() + + set(downloaded_file_path ${DOWNLOADS}/${vcpkg_download_distfile_FILENAME}) + set(download_file_path_part "${DOWNLOADS}/temp/${vcpkg_download_distfile_FILENAME}") + + # Works around issue #3399 + if(IS_DIRECTORY "${DOWNLOADS}/temp") + # Delete "temp0" directory created by the old version of vcpkg + file(REMOVE_RECURSE "${DOWNLOADS}/temp0") + + file(GLOB temp_files "${DOWNLOADS}/temp") + file(REMOVE_RECURSE ${temp_files}) + else() + file(MAKE_DIRECTORY "${DOWNLOADS}/temp") + endif() + + function(test_hash FILE_PATH FILE_KIND CUSTOM_ERROR_ADVICE) + if(_VCPKG_INTERNAL_NO_HASH_CHECK) + # When using the internal hash skip, do not output an explicit message. + return() + endif() + if(vcpkg_download_distfile_SKIP_SHA512) + message(STATUS "Skipping hash check for ${FILE_PATH}.") + return() + endif() + + file(SHA512 ${FILE_PATH} FILE_HASH) + if(NOT FILE_HASH STREQUAL vcpkg_download_distfile_SHA512) + message(FATAL_ERROR + "\nFile does not have expected hash:\n" + " File path: [ ${FILE_PATH} ]\n" + " Expected hash: [ ${vcpkg_download_distfile_SHA512} ]\n" + " Actual hash: [ ${FILE_HASH} ]\n" + "${CUSTOM_ERROR_ADVICE}\n") + endif() + endfunction() + + if(EXISTS "${downloaded_file_path}") + if(NOT vcpkg_download_distfile_QUIET) + message(STATUS "Using cached ${downloaded_file_path}") + endif() + test_hash("${downloaded_file_path}" "cached file" "Please delete the file and retry if this file should be downloaded again.") + else() + if(_VCPKG_NO_DOWNLOADS) + message(FATAL_ERROR "Downloads are disabled, but '${downloaded_file_path}' does not exist.") + endif() + + # Tries to download the file. + list(GET vcpkg_download_distfile_URLS 0 SAMPLE_URL) + if(_VCPKG_DOWNLOAD_TOOL STREQUAL "ARIA2" AND NOT SAMPLE_URL MATCHES "aria2") + vcpkg_find_acquire_program("ARIA2") + message(STATUS "Downloading ${vcpkg_download_distfile_FILENAME}...") + if(vcpkg_download_distfile_HEADERS) + foreach(header ${vcpkg_download_distfile_HEADERS}) + list(APPEND request_headers "--header=${header}") + endforeach() + endif() + vcpkg_execute_in_download_mode( + COMMAND ${ARIA2} ${vcpkg_download_distfile_URLS} + -o temp/${vcpkg_download_distfile_FILENAME} + -l download-${vcpkg_download_distfile_FILENAME}-detailed.log + ${request_headers} + OUTPUT_FILE download-${vcpkg_download_distfile_FILENAME}-out.log + ERROR_FILE download-${vcpkg_download_distfile_FILENAME}-err.log + RESULT_VARIABLE error_code + WORKING_DIRECTORY ${DOWNLOADS} + ) + if (NOT "${error_code}" STREQUAL "0") + message(STATUS + "Downloading ${vcpkg_download_distfile_FILENAME}... Failed.\n" + " Exit Code: ${error_code}\n" + " See logs for more information:\n" + " ${DOWNLOADS}/download-${vcpkg_download_distfile_FILENAME}-out.log\n" + " ${DOWNLOADS}/download-${vcpkg_download_distfile_FILENAME}-err.log\n" + " ${DOWNLOADS}/download-${vcpkg_download_distfile_FILENAME}-detailed.log\n" + ) + set(download_success 0) + else() + file(REMOVE + ${DOWNLOADS}/download-${vcpkg_download_distfile_FILENAME}-out.log + ${DOWNLOADS}/download-${vcpkg_download_distfile_FILENAME}-err.log + ${DOWNLOADS}/download-${vcpkg_download_distfile_FILENAME}-detailed.log + ) + set(download_success 1) + endif() + else() + foreach(url IN LISTS vcpkg_download_distfile_URLS) + message(STATUS "Downloading ${url} -> ${vcpkg_download_distfile_FILENAME}...") + if(vcpkg_download_distfile_HEADERS) + foreach(header ${vcpkg_download_distfile_HEADERS}) + list(APPEND request_headers HTTPHEADER ${header}) + endforeach() + endif() + file(DOWNLOAD "${url}" "${download_file_path_part}" STATUS download_status ${request_headers}) + list(GET download_status 0 status_code) + if (NOT "${status_code}" STREQUAL "0") + message(STATUS "Downloading ${url}... Failed. Status: ${download_status}") + set(download_success 0) + else() + set(download_success 1) + break() + endif() + endforeach(url) + endif() + + if (NOT vcpkg_download_distfile_SILENT_EXIT) + if (NOT download_success) + message(FATAL_ERROR + " \n" + " Failed to download file.\n" + " If you use a proxy, please set the HTTPS_PROXY and HTTP_PROXY environment\n" + " variables to \"https://user:password@your-proxy-ip-address:port/\".\n" + " \n" + " If error with status 4 (Issue #15434),\n" + " try setting \"http://user:password@your-proxy-ip-address:port/\".\n" + " \n" + " Otherwise, please submit an issue at https://github.com/Microsoft/vcpkg/issues\n") + else() + test_hash("${download_file_path_part}" "downloaded file" "The file may have been corrupted in transit. This can be caused by proxies. If you use a proxy, please set the HTTPS_PROXY and HTTP_PROXY environment variables to \"https://user:password@your-proxy-ip-address:port/\".\n") + get_filename_component(downloaded_file_dir "${downloaded_file_path}" DIRECTORY) + file(MAKE_DIRECTORY "${downloaded_file_dir}") + file(RENAME ${download_file_path_part} ${downloaded_file_path}) + endif() + else() + if (NOT download_success) + message(WARNING + " \n" + " Failed to download file.\n") + else() + test_hash("${download_file_path_part}" "downloaded file" "The file may have been corrupted in transit. This can be caused by proxies. If you use a proxy, please set the HTTPS_PROXY and HTTP_PROXY environment variables to \"https://user:password@your-proxy-ip-address:port/\".\n") + get_filename_component(downloaded_file_dir "${downloaded_file_path}" DIRECTORY) + file(MAKE_DIRECTORY "${downloaded_file_dir}") + file(RENAME ${download_file_path_part} ${downloaded_file_path}) + endif() + endif() + endif() + set(${VAR} ${downloaded_file_path} PARENT_SCOPE) +endfunction() diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_execute_build_process.cmake b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_execute_build_process.cmake new file mode 100644 index 000000000..52c03e445 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_execute_build_process.cmake @@ -0,0 +1,153 @@ +#[===[.md: +# vcpkg_execute_build_process + +Execute a required build process + +## Usage +```cmake +vcpkg_execute_build_process( + COMMAND <cmd> [<args>...] + [NO_PARALLEL_COMMAND <cmd> [<args>...]] + WORKING_DIRECTORY </path/to/dir> + LOGNAME <log_name> +) +``` +## Parameters +### COMMAND +The command to be executed, along with its arguments. + +### NO_PARALLEL_COMMAND +Optional parameter which specifies a non-parallel command to attempt if a +failure potentially due to parallelism is detected. + +### WORKING_DIRECTORY +The directory to execute the command in. + +### LOGNAME +The prefix to use for the log files. + +This should be a unique name for different triplets so that the logs don't +conflict when building multiple at once. + +## Examples + +* [icu](https://github.com/Microsoft/vcpkg/blob/master/ports/icu/portfile.cmake) +#]===] + +function(vcpkg_execute_build_process) + # parse parameters such that semicolons in options arguments to COMMAND don't get erased + cmake_parse_arguments(PARSE_ARGV 0 _ebp "" "WORKING_DIRECTORY;LOGNAME" "COMMAND;NO_PARALLEL_COMMAND") + + set(LOG_OUT "${CURRENT_BUILDTREES_DIR}/${_ebp_LOGNAME}-out.log") + set(LOG_ERR "${CURRENT_BUILDTREES_DIR}/${_ebp_LOGNAME}-err.log") + + execute_process( + COMMAND ${_ebp_COMMAND} + WORKING_DIRECTORY ${_ebp_WORKING_DIRECTORY} + OUTPUT_FILE ${LOG_OUT} + ERROR_FILE ${LOG_ERR} + RESULT_VARIABLE error_code + ) + + if(error_code) + file(READ ${LOG_OUT} out_contents) + file(READ ${LOG_ERR} err_contents) + + if(out_contents) + list(APPEND LOGS ${LOG_OUT}) + endif() + if(err_contents) + list(APPEND LOGS ${LOG_ERR}) + endif() + + if(out_contents MATCHES "LINK : fatal error LNK1102:" OR out_contents MATCHES " fatal error C1060: " + OR err_contents MATCHES "LINK : fatal error LNK1102:" OR err_contents MATCHES " fatal error C1060: " + OR out_contents MATCHES "LINK : fatal error LNK1318: Unexpected PDB error; ACCESS_DENIED" + OR out_contents MATCHES "LINK : fatal error LNK1104:" + OR out_contents MATCHES "LINK : fatal error LNK1201:" + # The linker ran out of memory during execution. We will try continuing once more, with parallelism disabled. + OR err_contents MATCHES "Cannot create parent directory" OR err_contents MATCHES "Cannot write file" + # Multiple threads using the same directory at the same time cause conflicts, will try again. + OR err_contents MATCHES "Can't open" + # Multiple threads caused the wrong order of creating folders and creating files in folders + ) + message(STATUS "Restarting Build without parallelism because memory exceeded") + set(LOG_OUT "${CURRENT_BUILDTREES_DIR}/${_ebp_LOGNAME}-out-1.log") + set(LOG_ERR "${CURRENT_BUILDTREES_DIR}/${_ebp_LOGNAME}-err-1.log") + + if(_ebp_NO_PARALLEL_COMMAND) + execute_process( + COMMAND ${_ebp_NO_PARALLEL_COMMAND} + WORKING_DIRECTORY ${_ebp_WORKING_DIRECTORY} + OUTPUT_FILE ${LOG_OUT} + ERROR_FILE ${LOG_ERR} + RESULT_VARIABLE error_code + ) + else() + execute_process( + COMMAND ${_ebp_COMMAND} + WORKING_DIRECTORY ${_ebp_WORKING_DIRECTORY} + OUTPUT_FILE ${LOG_OUT} + ERROR_FILE ${LOG_ERR} + RESULT_VARIABLE error_code + ) + endif() + + if(error_code) + file(READ ${LOG_OUT} out_contents) + file(READ ${LOG_ERR} err_contents) + + if(out_contents) + list(APPEND LOGS ${LOG_OUT}) + endif() + if(err_contents) + list(APPEND LOGS ${LOG_ERR}) + endif() + endif() + elseif(out_contents MATCHES "mt : general error c101008d: " OR out_contents MATCHES "mt.exe : general error c101008d: ") + # Antivirus workaround - occasionally files are locked and cause mt.exe to fail + message(STATUS "mt.exe has failed. This may be the result of anti-virus. Disabling anti-virus on the buildtree folder may improve build speed") + set(ITERATION 0) + while (ITERATION LESS 3 AND (out_contents MATCHES "mt : general error c101008d: " OR out_contents MATCHES "mt.exe : general error c101008d: ")) + MATH(EXPR ITERATION "${ITERATION}+1") + message(STATUS "Restarting Build ${TARGET_TRIPLET}-${SHORT_BUILDTYPE} because of mt.exe file locking issue. Iteration: ${ITERATION}") + execute_process( + COMMAND ${_ebp_COMMAND} + OUTPUT_FILE "${LOGPREFIX}-out-${ITERATION}.log" + ERROR_FILE "${LOGPREFIX}-err-${ITERATION}.log" + RESULT_VARIABLE error_code + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${SHORT_BUILDTYPE}) + + if(error_code) + file(READ "${LOGPREFIX}-out-${ITERATION}.log" out_contents) + file(READ "${LOGPREFIX}-err-${ITERATION}.log" err_contents) + + if(out_contents) + list(APPEND LOGS "${LOGPREFIX}-out-${ITERATION}.log") + endif() + if(err_contents) + list(APPEND LOGS "${LOGPREFIX}-err-${ITERATION}.log") + endif() + else() + break() + endif() + endwhile() + elseif(out_contents MATCHES "fatal error: ld terminated with signal 9 [Killed]") + message(WARNING "ld was terminated with signal 9 [killed], please ensure your system has sufficient hard disk space and memory.") + endif() + + if(error_code) + set(STRINGIFIED_LOGS) + foreach(LOG ${LOGS}) + file(TO_NATIVE_PATH "${LOG}" NATIVE_LOG) + list(APPEND STRINGIFIED_LOGS " ${NATIVE_LOG}\n") + endforeach() + z_vcpkg_prettify_command_line(_ebp_COMMAND_PRETTY ${_ebp_COMMAND}) + message(FATAL_ERROR + " Command failed: ${_ebp_COMMAND_PRETTY}\n" + " Working Directory: ${_ebp_WORKING_DIRECTORY}\n" + " See logs for more information:\n" + ${STRINGIFIED_LOGS}) + endif(error_code) + endif(error_code) +endfunction(vcpkg_execute_build_process) diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_execute_in_download_mode.cmake b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_execute_in_download_mode.cmake new file mode 100644 index 000000000..8ef773729 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_execute_in_download_mode.cmake @@ -0,0 +1,67 @@ +#[===[.md: +# vcpkg_execute_in_download_mode + +Execute a process even in download mode. + +## Usage +```cmake +vcpkg_execute_in_download_mode( + COMMAND <cmd> [<arguments>] + [WORKING_DIRECTORY <dir>] + [TIMEOUT <seconds>] + [RESULT_VARIABLE <variable>] + [OUTPUT_VARIABLE <variable>] + [ERROR_VARIABLE <variable>] + [INPUT_FILE <file>] + [OUTPUT_FILE <file>] + [ERROR_FILE <file>] + [OUTPUT_QUIET] + [ERROR_QUIET] + [OUTPUT_STRIP_TRAILING_WHITESPACE] + [ERROR_STRIP_TRAILING_WHITESPACE] + [ENCODING <name>] +) +``` + +The signature of this function is identical to `execute_process()` except that +it only accepts one COMMAND argument, i.e., does not support chaining multiple +commands with pipes. + +See [`execute_process()`] for a detailed description of the parameters. + +[`execute_process()`]: https://cmake.org/cmake/help/latest/command/execute_process.html +#]===] + +function(vcpkg_execute_in_download_mode) + # parse parameters such that semicolons in options arguments to COMMAND don't get erased + cmake_parse_arguments(PARSE_ARGV 0 vcpkg_execute_in_download_mode + "OUTPUT_QUIET;ERROR_QUIET;OUTPUT_STRIP_TRAILING_WHITESPACE;ERROR_STRIP_TRAILING_WHITESPACE" + "WORKING_DIRECTORY;TIMEOUT;RESULT_VARIABLE;RESULTS_VARIABLE;OUTPUT_VARIABLE;ERROR_VARIABLE;INPUT_FILE;OUTPUT_FILE;ERROR_FILE;ENCODING" + "COMMAND") + + # collect all other present parameters + set(other_args "") + foreach(arg OUTPUT_QUIET ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_STRIP_TRAILING_WHITESPACE) + if(vcpkg_execute_in_download_mode_${arg}) + list(APPEND other_args ${arg}) + endif() + endforeach() + foreach(arg WORKING_DIRECTORY TIMEOUT RESULT_VARIABLE RESULTS_VARIABLE OUTPUT_VARIABLE ERROR_VARIABLE INPUT_FILE OUTPUT_FILE ERROR_FILE ENCODING) + if(vcpkg_execute_in_download_mode_${arg}) + list(APPEND other_args ${arg} ${vcpkg_execute_in_download_mode_${arg}}) + endif() + endforeach() + + if (DEFINED VCPKG_DOWNLOAD_MODE) + _execute_process(COMMAND ${vcpkg_execute_in_download_mode_COMMAND} ${other_args}) + else() + execute_process(COMMAND ${vcpkg_execute_in_download_mode_COMMAND} ${other_args}) + endif() + + # pass output parameters back to caller's scope + foreach(arg RESULT_VARIABLE RESULTS_VARIABLE OUTPUT_VARIABLE ERROR_VARIABLE) + if(vcpkg_execute_in_download_mode_${arg}) + set(${vcpkg_execute_in_download_mode_${arg}} ${${vcpkg_execute_in_download_mode_${arg}}} PARENT_SCOPE) + endif() + endforeach() +endfunction() diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_execute_required_process.cmake b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_execute_required_process.cmake new file mode 100644 index 000000000..c38fd2ed8 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_execute_required_process.cmake @@ -0,0 +1,119 @@ +#[===[.md: +# vcpkg_execute_required_process + +Execute a process with logging and fail the build if the command fails. + +## Usage +```cmake +vcpkg_execute_required_process( + COMMAND <${PERL}> [<arguments>...] + WORKING_DIRECTORY <${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg> + LOGNAME <build-${TARGET_TRIPLET}-dbg> + [TIMEOUT <seconds>] + [OUTPUT_VARIABLE <var>] + [ERROR_VARIABLE <var>] +) +``` +## Parameters +### ALLOW_IN_DOWNLOAD_MODE +Allows the command to execute in Download Mode. +[See execute_process() override](../../scripts/cmake/execute_process.cmake). + +### COMMAND +The command to be executed, along with its arguments. + +### WORKING_DIRECTORY +The directory to execute the command in. + +### LOGNAME +The prefix to use for the log files. + +### TIMEOUT +Optional timeout after which to terminate the command. + +### OUTPUT_VARIABLE +Optional variable to receive stdout of the command. + +### ERROR_VARIABLE +Optional variable to receive stderr of the command. + +This should be a unique name for different triplets so that the logs don't conflict when building multiple at once. + +## Examples + +* [ffmpeg](https://github.com/Microsoft/vcpkg/blob/master/ports/ffmpeg/portfile.cmake) +* [openssl](https://github.com/Microsoft/vcpkg/blob/master/ports/openssl/portfile.cmake) +* [boost](https://github.com/Microsoft/vcpkg/blob/master/ports/boost/portfile.cmake) +* [qt5](https://github.com/Microsoft/vcpkg/blob/master/ports/qt5/portfile.cmake) +#]===] + +function(vcpkg_execute_required_process) + # parse parameters such that semicolons in options arguments to COMMAND don't get erased + cmake_parse_arguments(PARSE_ARGV 0 vcpkg_execute_required_process "ALLOW_IN_DOWNLOAD_MODE" "WORKING_DIRECTORY;LOGNAME;TIMEOUT;OUTPUT_VARIABLE;ERROR_VARIABLE" "COMMAND") + set(LOG_OUT "${CURRENT_BUILDTREES_DIR}/${vcpkg_execute_required_process_LOGNAME}-out.log") + set(LOG_ERR "${CURRENT_BUILDTREES_DIR}/${vcpkg_execute_required_process_LOGNAME}-err.log") + + if(vcpkg_execute_required_process_TIMEOUT) + set(TIMEOUT_PARAM "TIMEOUT;${vcpkg_execute_required_process_TIMEOUT}") + else() + set(TIMEOUT_PARAM "") + endif() + if(vcpkg_execute_required_process_OUTPUT_VARIABLE) + set(OUTPUT_VARIABLE_PARAM "OUTPUT_VARIABLE;${vcpkg_execute_required_process_OUTPUT_VARIABLE}") + else() + set(OUTPUT_VARIABLE_PARAM "") + endif() + if(vcpkg_execute_required_process_ERROR_VARIABLE) + set(ERROR_VARIABLE_PARAM "ERROR_VARIABLE;${vcpkg_execute_required_process_ERROR_VARIABLE}") + else() + set(ERROR_VARIABLE_PARAM "") + endif() + + if (DEFINED VCPKG_DOWNLOAD_MODE AND NOT vcpkg_execute_required_process_ALLOW_IN_DOWNLOAD_MODE) + message(FATAL_ERROR +[[ +This command cannot be executed in Download Mode. +Halting portfile execution. +]]) + endif() + + vcpkg_execute_in_download_mode( + COMMAND ${vcpkg_execute_required_process_COMMAND} + OUTPUT_FILE ${LOG_OUT} + ERROR_FILE ${LOG_ERR} + RESULT_VARIABLE error_code + WORKING_DIRECTORY ${vcpkg_execute_required_process_WORKING_DIRECTORY} + ${TIMEOUT_PARAM} + ${OUTPUT_VARIABLE_PARAM} + ${ERROR_VARIABLE_PARAM}) + if(error_code) + set(LOGS) + file(READ "${LOG_OUT}" out_contents) + file(READ "${LOG_ERR}" err_contents) + if(out_contents) + list(APPEND LOGS "${LOG_OUT}") + endif() + if(err_contents) + list(APPEND LOGS "${LOG_ERR}") + endif() + set(STRINGIFIED_LOGS) + foreach(LOG ${LOGS}) + file(TO_NATIVE_PATH "${LOG}" NATIVE_LOG) + list(APPEND STRINGIFIED_LOGS " ${NATIVE_LOG}\n") + endforeach() + z_vcpkg_prettify_command_line(vcpkg_execute_required_process_COMMAND_PRETTY ${vcpkg_execute_required_process_COMMAND}) + message(FATAL_ERROR + " Command failed: ${vcpkg_execute_required_process_COMMAND_PRETTY}\n" + " Working Directory: ${vcpkg_execute_required_process_WORKING_DIRECTORY}\n" + " Error code: ${error_code}\n" + " See logs for more information:\n" + ${STRINGIFIED_LOGS} + ) + endif() + # pass output parameters back to caller's scope + foreach(arg OUTPUT_VARIABLE ERROR_VARIABLE) + if(vcpkg_execute_required_process_${arg}) + set(${vcpkg_execute_required_process_${arg}} ${${vcpkg_execute_required_process_${arg}}} PARENT_SCOPE) + endif() + endforeach() +endfunction() diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_execute_required_process_repeat.cmake b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_execute_required_process_repeat.cmake new file mode 100644 index 000000000..3e63a998c --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_execute_required_process_repeat.cmake @@ -0,0 +1,53 @@ +#[===[.md: +# vcpkg_execute_required_process_repeat + +Execute a process until the command succeeds, or until the COUNT is reached. + +## Usage +```cmake +vcpkg_execute_required_process_repeat( + COUNT <num> + COMMAND <cmd> [<arguments>] + WORKING_DIRECTORY <directory> + LOGNAME <name> +) +``` +#]===] + +function(vcpkg_execute_required_process_repeat) + # parse parameters such that semicolons in options arguments to COMMAND don't get erased + cmake_parse_arguments(PARSE_ARGV 0 vcpkg_execute_required_process_repeat "ALLOW_IN_DOWNLOAD_MODE" "COUNT;WORKING_DIRECTORY;LOGNAME" "COMMAND") + #debug_message("vcpkg_execute_required_process_repeat(${vcpkg_execute_required_process_repeat_COMMAND})") + if (DEFINED VCPKG_DOWNLOAD_MODE AND NOT vcpkg_execute_required_process_repeat_ALLOW_IN_DOWNLOAD_MODE) + message(FATAL_ERROR +[[ +This command cannot be executed in Download Mode. +Halting portfile execution. +]]) + endif() + set(SUCCESSFUL_EXECUTION FALSE) + foreach(loop_count RANGE ${vcpkg_execute_required_process_repeat_COUNT}) + vcpkg_execute_in_download_mode( + COMMAND ${vcpkg_execute_required_process_repeat_COMMAND} + OUTPUT_FILE ${CURRENT_BUILDTREES_DIR}/${vcpkg_execute_required_process_repeat_LOGNAME}-out-${loop_count}.log + ERROR_FILE ${CURRENT_BUILDTREES_DIR}/${vcpkg_execute_required_process_repeat_LOGNAME}-err-${loop_count}.log + RESULT_VARIABLE error_code + WORKING_DIRECTORY ${vcpkg_execute_required_process_repeat_WORKING_DIRECTORY}) + #debug_message("error_code=${error_code}") + file(TO_NATIVE_PATH "${CURRENT_BUILDTREES_DIR}" NATIVE_BUILDTREES_DIR) + if(NOT error_code) + set(SUCCESSFUL_EXECUTION TRUE) + break() + endif() + endforeach(loop_count) + if (NOT SUCCESSFUL_EXECUTION) + z_vcpkg_prettify_command_line(vcpkg_execute_required_process_repeat_COMMAND_PRETTY ${vcpkg_execute_required_process_repeat_COMMAND}) + message(FATAL_ERROR + " Command failed: ${vcpkg_execute_required_process_repeat_COMMAND_PRETTY}\n" + " Working Directory: ${vcpkg_execute_required_process_repeat_WORKING_DIRECTORY}\n" + " See logs for more information:\n" + " ${NATIVE_BUILDTREES_DIR}\\${vcpkg_execute_required_process_repeat_LOGNAME}-out.log\n" + " ${NATIVE_BUILDTREES_DIR}\\${vcpkg_execute_required_process_repeat_LOGNAME}-err.log\n" + ) + endif() +endfunction() diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_extract_source_archive.cmake b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_extract_source_archive.cmake new file mode 100644 index 000000000..631d6da59 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_extract_source_archive.cmake @@ -0,0 +1,54 @@ +#[===[.md: +# vcpkg_extract_source_archive + +Extract an archive into the source directory. Deprecated in favor of [`vcpkg_extract_source_archive_ex`](vcpkg_extract_source_archive_ex.md). + +## Usage +```cmake +vcpkg_extract_source_archive( + <${ARCHIVE}> [<${TARGET_DIRECTORY}>] +) +``` +## Parameters +### ARCHIVE +The full path to the archive to be extracted. + +This is usually obtained from calling [`vcpkg_download_distfile`](vcpkg_download_distfile.md). + +### TARGET_DIRECTORY +If specified, the archive will be extracted into the target directory instead of `${CURRENT_BUILDTREES_DIR}/src/`. + +This can be used to mimic git submodules, by extracting into a subdirectory of another archive. + +## Notes +This command will also create a tracking file named <FILENAME>.extracted in the TARGET_DIRECTORY. This file, when present, will suppress the extraction of the archive. + +## Examples + +* [libraw](https://github.com/Microsoft/vcpkg/blob/master/ports/libraw/portfile.cmake) +* [protobuf](https://github.com/Microsoft/vcpkg/blob/master/ports/protobuf/portfile.cmake) +* [msgpack](https://github.com/Microsoft/vcpkg/blob/master/ports/msgpack/portfile.cmake) +#]===] + +include(vcpkg_execute_required_process) + +function(vcpkg_extract_source_archive ARCHIVE) + if(NOT ARGC EQUAL 2) + set(WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/src") + else() + set(WORKING_DIRECTORY ${ARGV1}) + endif() + + get_filename_component(ARCHIVE_FILENAME "${ARCHIVE}" NAME) + if(NOT EXISTS ${WORKING_DIRECTORY}/${ARCHIVE_FILENAME}.extracted) + message(STATUS "Extracting source ${ARCHIVE}") + file(MAKE_DIRECTORY ${WORKING_DIRECTORY}) + vcpkg_execute_required_process( + ALLOW_IN_DOWNLOAD_MODE + COMMAND ${CMAKE_COMMAND} -E tar xjf ${ARCHIVE} + WORKING_DIRECTORY ${WORKING_DIRECTORY} + LOGNAME extract + ) + file(WRITE ${WORKING_DIRECTORY}/${ARCHIVE_FILENAME}.extracted) + endif() +endfunction() diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_extract_source_archive_ex.cmake b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_extract_source_archive_ex.cmake new file mode 100644 index 000000000..633b40b1a --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_extract_source_archive_ex.cmake @@ -0,0 +1,157 @@ +#[===[.md:
+# vcpkg_extract_source_archive_ex
+
+Extract an archive into the source directory. Replaces [`vcpkg_extract_source_archive`](vcpkg_extract_source_archive.md).
+
+## Usage
+```cmake
+vcpkg_extract_source_archive_ex(
+ SKIP_PATCH_CHECK
+ OUT_SOURCE_PATH <SOURCE_PATH>
+ ARCHIVE <${ARCHIVE}>
+ [REF <1.0.0>]
+ [NO_REMOVE_ONE_LEVEL]
+ [WORKING_DIRECTORY <${CURRENT_BUILDTREES_DIR}/src>]
+ [PATCHES <a.patch>...]
+)
+```
+## Parameters
+### SKIP_PATCH_CHECK
+If this option is set the failure to apply a patch is ignored.
+
+### OUT_SOURCE_PATH
+Specifies the out-variable that will contain the extracted location.
+
+This should be set to `SOURCE_PATH` by convention.
+
+### ARCHIVE
+The full path to the archive to be extracted.
+
+This is usually obtained from calling [`vcpkg_download_distfile`](vcpkg_download_distfile.md).
+
+### REF
+A friendly name that will be used instead of the filename of the archive. If more than 10 characters it will be truncated.
+
+By convention, this is set to the version number or tag fetched
+
+### WORKING_DIRECTORY
+If specified, the archive will be extracted into the working directory instead of `${CURRENT_BUILDTREES_DIR}/src/`.
+
+Note that the archive will still be extracted into a subfolder underneath that directory (`${WORKING_DIRECTORY}/${REF}-${HASH}/`).
+
+### PATCHES
+A list of patches to be applied to the extracted sources.
+
+Relative paths are based on the port directory.
+
+### NO_REMOVE_ONE_LEVEL
+Specifies that the default removal of the top level folder should not occur.
+
+## Examples
+
+* [bzip2](https://github.com/Microsoft/vcpkg/blob/master/ports/bzip2/portfile.cmake)
+* [sqlite3](https://github.com/Microsoft/vcpkg/blob/master/ports/sqlite3/portfile.cmake)
+* [cairo](https://github.com/Microsoft/vcpkg/blob/master/ports/cairo/portfile.cmake)
+#]===]
+
+include(vcpkg_extract_source_archive)
+
+function(vcpkg_extract_source_archive_ex)
+ # parse parameters such that semicolons in options arguments to COMMAND don't get erased
+ cmake_parse_arguments(
+ PARSE_ARGV 0
+ _vesae
+ "NO_REMOVE_ONE_LEVEL;SKIP_PATCH_CHECK"
+ "OUT_SOURCE_PATH;ARCHIVE;REF;WORKING_DIRECTORY"
+ "PATCHES"
+ )
+
+ if(NOT _vesae_ARCHIVE)
+ message(FATAL_ERROR "Must specify ARCHIVE parameter to vcpkg_extract_source_archive_ex()")
+ endif()
+
+ if(NOT DEFINED _vesae_OUT_SOURCE_PATH)
+ message(FATAL_ERROR "Must specify OUT_SOURCE_PATH parameter to vcpkg_extract_source_archive_ex()")
+ endif()
+
+ if(NOT DEFINED _vesae_WORKING_DIRECTORY)
+ set(_vesae_WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/src)
+ endif()
+
+ if(NOT DEFINED _vesae_REF)
+ get_filename_component(_vesae_REF ${_vesae_ARCHIVE} NAME_WE)
+ endif()
+
+ string(REPLACE "/" "-" SANITIZED_REF "${_vesae_REF}")
+
+ # Take the last 10 chars of the REF
+ set(REF_MAX_LENGTH 10)
+ string(LENGTH ${SANITIZED_REF} REF_LENGTH)
+ math(EXPR FROM_REF ${REF_LENGTH}-${REF_MAX_LENGTH})
+ if(FROM_REF LESS 0)
+ set(FROM_REF 0)
+ endif()
+ string(SUBSTRING ${SANITIZED_REF} ${FROM_REF} ${REF_LENGTH} SHORTENED_SANITIZED_REF)
+
+ # Hash the archive hash along with the patches. Take the first 10 chars of the hash
+ file(SHA512 ${_vesae_ARCHIVE} PATCHSET_HASH)
+ foreach(PATCH IN LISTS _vesae_PATCHES)
+ get_filename_component(ABSOLUTE_PATCH "${PATCH}" ABSOLUTE BASE_DIR "${CURRENT_PORT_DIR}")
+ file(SHA512 ${ABSOLUTE_PATCH} CURRENT_HASH)
+ string(APPEND PATCHSET_HASH ${CURRENT_HASH})
+ endforeach()
+
+ string(SHA512 PATCHSET_HASH ${PATCHSET_HASH})
+ string(SUBSTRING ${PATCHSET_HASH} 0 10 PATCHSET_HASH)
+ set(SOURCE_PATH "${_vesae_WORKING_DIRECTORY}/${SHORTENED_SANITIZED_REF}-${PATCHSET_HASH}")
+ if (NOT _VCPKG_EDITABLE)
+ string(APPEND SOURCE_PATH ".clean")
+ if(EXISTS ${SOURCE_PATH})
+ message(STATUS "Cleaning sources at ${SOURCE_PATH}. Use --editable to skip cleaning for the packages you specify.")
+ file(REMOVE_RECURSE ${SOURCE_PATH})
+ endif()
+ endif()
+
+ if(NOT EXISTS ${SOURCE_PATH})
+ set(TEMP_DIR "${_vesae_WORKING_DIRECTORY}/${SHORTENED_SANITIZED_REF}-${PATCHSET_HASH}.tmp")
+ file(REMOVE_RECURSE ${TEMP_DIR})
+ vcpkg_extract_source_archive("${_vesae_ARCHIVE}" "${TEMP_DIR}")
+
+ if(_vesae_NO_REMOVE_ONE_LEVEL)
+ set(TEMP_SOURCE_PATH ${TEMP_DIR})
+ else()
+ file(GLOB _ARCHIVE_FILES "${TEMP_DIR}/*")
+ list(LENGTH _ARCHIVE_FILES _NUM_ARCHIVE_FILES)
+ set(TEMP_SOURCE_PATH)
+ foreach(dir IN LISTS _ARCHIVE_FILES)
+ if (IS_DIRECTORY ${dir})
+ set(TEMP_SOURCE_PATH "${dir}")
+ break()
+ endif()
+ endforeach()
+
+ if(NOT _NUM_ARCHIVE_FILES EQUAL 2 OR NOT TEMP_SOURCE_PATH)
+ message(FATAL_ERROR "Could not unwrap top level directory from archive. Pass NO_REMOVE_ONE_LEVEL to disable this.")
+ endif()
+ endif()
+
+ if (_vesae_SKIP_PATCH_CHECK)
+ set (QUIET QUIET)
+ else()
+ set (QUIET)
+ endif()
+
+ z_vcpkg_apply_patches(
+ ${QUIET}
+ SOURCE_PATH ${TEMP_SOURCE_PATH}
+ PATCHES ${_vesae_PATCHES}
+ )
+
+ file(RENAME ${TEMP_SOURCE_PATH} ${SOURCE_PATH})
+ file(REMOVE_RECURSE ${TEMP_DIR})
+ endif()
+
+ set(${_vesae_OUT_SOURCE_PATH} "${SOURCE_PATH}" PARENT_SCOPE)
+ message(STATUS "Using source at ${SOURCE_PATH}")
+ return()
+endfunction()
diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_fail_port_install.cmake b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_fail_port_install.cmake new file mode 100644 index 000000000..9e919aa02 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_fail_port_install.cmake @@ -0,0 +1,99 @@ +#[===[.md:
+# vcpkg_fail_port_install
+
+Checks common requirements and fails the current portfile with a (default) error message
+
+## Usage
+```cmake
+vcpkg_fail_port_install(
+ [ALWAYS]
+ [MESSAGE <"Reason for failure">]
+ [ON_TARGET <Windows> [<OSX> ...]]
+ [ON_ARCH <x64> [<arm> ...]]
+ [ON_CRT_LINKAGE <static> [<dynamic> ...]])
+ [ON_LIBRARY_LINKAGE <static> [<dynamic> ...]]
+)
+```
+
+## Parameters
+### MESSAGE
+Additional failure message. If none is given, a default message will be displayed depending on the failure condition.
+
+### ALWAYS
+Will always fail early
+
+### ON_TARGET
+Targets for which the build should fail early. Valid targets are `<target>` from `VCPKG_IS_TARGET_<target>` (see `vcpkg_common_definitions.cmake`).
+
+### ON_ARCH
+Architecture for which the build should fail early.
+
+### ON_CRT_LINKAGE
+CRT linkage for which the build should fail early.
+
+### ON_LIBRARY_LINKAGE
+Library linkage for which the build should fail early.
+
+## Examples
+
+* [aws-lambda-cpp](https://github.com/Microsoft/vcpkg/blob/master/ports/aws-lambda-cpp/portfile.cmake)
+#]===]
+
+function(vcpkg_fail_port_install)
+ # parse parameters such that semicolons in options arguments to COMMAND don't get erased
+ cmake_parse_arguments(PARSE_ARGV 0 _csc "ALWAYS" "MESSAGE" "ON_TARGET;ON_ARCH;ON_CRT_LINKAGE;ON_LIBRARY_LINKAGE")
+ if(DEFINED _csc_UNPARSED_ARGUMENTS)
+ message(FATAL_ERROR "Unknown arguments passed to vcpkg_fail_port_install. Please correct the portfile!")
+ endif()
+ if(DEFINED _csc_MESSAGE)
+ set(_csc_MESSAGE "${_csc_MESSAGE}\n")
+ else()
+ set(_csc_MESSAGE "")
+ endif()
+
+ unset(_fail_port)
+ #Target fail check
+ if(DEFINED _csc_ON_TARGET)
+ foreach(_target ${_csc_ON_TARGET})
+ string(TOUPPER ${_target} _target_upper)
+ if(VCPKG_TARGET_IS_${_target_upper})
+ set(_fail_port TRUE)
+ set(_csc_MESSAGE "${_csc_MESSAGE}Target '${_target}' not supported by ${PORT}!\n")
+ endif()
+ endforeach()
+ endif()
+
+ #Architecture fail check
+ if(DEFINED _csc_ON_ARCH)
+ foreach(_arch ${_csc_ON_ARCH})
+ if(${VCPKG_TARGET_ARCHITECTURE} MATCHES ${_arch})
+ set(_fail_port TRUE)
+ set(_csc_MESSAGE "${_csc_MESSAGE}Architecture '${_arch}' not supported by ${PORT}!\n")
+ endif()
+ endforeach()
+ endif()
+
+ #CRT linkage fail check
+ if(DEFINED _csc_ON_CRT_LINKAGE)
+ foreach(_crt_link ${_csc_ON_CRT_LINKAGE})
+ if("${VCPKG_CRT_LINKAGE}" MATCHES "${_crt_link}")
+ set(_fail_port TRUE)
+ set(_csc_MESSAGE "${_csc_MESSAGE}CRT linkage '${VCPKG_CRT_LINKAGE}' not supported by ${PORT}!\n")
+ endif()
+ endforeach()
+ endif()
+
+ #Library linkage fail check
+ if(DEFINED _csc_ON_LIBRARY_LINKAGE)
+ foreach(_lib_link ${_csc_ON_LIBRARY_LINKAGE})
+ if("${VCPKG_LIBRARY_LINKAGE}" MATCHES "${_lib_link}")
+ set(_fail_port TRUE)
+ set(_csc_MESSAGE "${_csc_MESSAGE}Library linkage '${VCPKG_LIBRARY_LINKAGE}' not supported by ${PORT}!\n")
+ endif()
+ endforeach()
+ endif()
+
+ if(_fail_port OR _csc_ALWAYS)
+ message(FATAL_ERROR ${_csc_MESSAGE})
+ endif()
+endfunction()
diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_find_acquire_program.cmake b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_find_acquire_program.cmake new file mode 100644 index 000000000..aea148e45 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_find_acquire_program.cmake @@ -0,0 +1,598 @@ +#[===[.md: +# vcpkg_find_acquire_program + +Download or find a well-known tool. + +## Usage +```cmake +vcpkg_find_acquire_program(<VAR>) +``` +## Parameters +### VAR +This variable specifies both the program to be acquired as well as the out parameter that will be set to the path of the program executable. + +## Notes +The current list of programs includes: + +* 7Z +* ARIA2 (Downloader) +* BISON +* CLANG +* DARK +* DOXYGEN +* FLEX +* GASPREPROCESSOR +* GPERF +* PERL +* PYTHON2 +* PYTHON3 +* GIT +* GN +* GO +* JOM +* MESON +* NASM +* NINJA +* NUGET +* SCONS +* SWIG +* YASM + +Note that msys2 has a dedicated helper function: [`vcpkg_acquire_msys`](vcpkg_acquire_msys.md). + +## Examples + +* [ffmpeg](https://github.com/Microsoft/vcpkg/blob/master/ports/ffmpeg/portfile.cmake) +* [openssl](https://github.com/Microsoft/vcpkg/blob/master/ports/openssl/portfile.cmake) +* [qt5](https://github.com/Microsoft/vcpkg/blob/master/ports/qt5/portfile.cmake) +#]===] + +include(vcpkg_execute_in_download_mode) + +function(vcpkg_find_acquire_program VAR) + set(EXPANDED_VAR ${${VAR}}) + if(EXPANDED_VAR) + return() + endif() + + unset(NOEXTRACT) + unset(_vfa_RENAME) + unset(SUBDIR) + unset(PROG_PATH_SUBDIR) + unset(REQUIRED_INTERPRETER) + unset(_vfa_SUPPORTED) + unset(POST_INSTALL_COMMAND) + unset(PATHS) + + if(VAR MATCHES "PERL") + set(PROGNAME perl) + set(PERL_VERSION 5.30.0.1) + set(SUBDIR ${PERL_VERSION}) + set(PATHS ${DOWNLOADS}/tools/perl/${SUBDIR}/perl/bin) + set(BREW_PACKAGE_NAME "perl") + set(APT_PACKAGE_NAME "perl") + set(URL + "https://strawberryperl.com/download/${PERL_VERSION}/strawberry-perl-${PERL_VERSION}-32bit.zip" + ) + set(ARCHIVE "strawberry-perl-${PERL_VERSION}-32bit.zip") + set(HASH d353d3dc743ebdc6d1e9f6f2b7a6db3c387c1ce6c890bae8adc8ae5deae8404f4c5e3cf249d1e151e7256d4c5ee9cd317e6c41f3b6f244340de18a24b938e0c4) + elseif(VAR MATCHES "NASM") + set(PROGNAME nasm) + set(NASM_VERSION 2.15.05) + set(PATHS ${DOWNLOADS}/tools/nasm/nasm-${NASM_VERSION}) + set(BREW_PACKAGE_NAME "nasm") + set(APT_PACKAGE_NAME "nasm") + set(URL + "https://www.nasm.us/pub/nasm/releasebuilds/${NASM_VERSION}/win32/nasm-${NASM_VERSION}-win32.zip" + "https://fossies.org/windows/misc/nasm-${NASM_VERSION}-win32.zip" + ) + set(ARCHIVE "nasm-${NASM_VERSION}-win32.zip") + set(HASH 9412b8caa07e15eac8f500f6f8fab9f038d95dc25e0124b08a80645607cf5761225f98546b52eac7b894420d64f26c3cbf22c19cd286bbe583f7c964256c97ed) + elseif(VAR MATCHES "YASM") + set(PROGNAME yasm) + set(YASM_VERSION 1.3.0.6.g1962) + set(SUBDIR 1.3.0.6) + set(BREW_PACKAGE_NAME "yasm") + set(APT_PACKAGE_NAME "yasm") + set(URL "https://www.tortall.net/projects/yasm/snapshots/v${YASM_VERSION}/yasm-${YASM_VERSION}.exe") + set(ARCHIVE "yasm-${YASM_VERSION}.exe") + set(_vfa_RENAME "yasm.exe") + set(NOEXTRACT ON) + set(HASH c1945669d983b632a10c5ff31e86d6ecbff143c3d8b2c433c0d3d18f84356d2b351f71ac05fd44e5403651b00c31db0d14615d7f9a6ecce5750438d37105c55b) + elseif(VAR MATCHES "GIT") + set(PROGNAME git) + if(CMAKE_HOST_WIN32) + set(GIT_VERSION 2.26.2) + set(SUBDIR "git-${GIT_VERSION}-1-windows") + set(URL "https://github.com/git-for-windows/git/releases/download/v${GIT_VERSION}.windows.1/PortableGit-${GIT_VERSION}-32-bit.7z.exe") + set(ARCHIVE "PortableGit-${GIT_VERSION}-32-bit.7z.exe") + set(HASH d3cb60d62ca7b5d05ab7fbed0fa7567bec951984568a6c1646842a798c4aaff74bf534cf79414a6275c1927081a11b541d09931c017bf304579746e24fe57b36) + set(PATHS + "${DOWNLOADS}/tools/${SUBDIR}/mingw32/bin" + "${DOWNLOADS}/tools/git/${SUBDIR}/mingw32/bin") + else() + set(BREW_PACKAGE_NAME "git") + set(APT_PACKAGE_NAME "git") + endif() + elseif(VAR MATCHES "GN") + set(PROGNAME gn) + set(_vfa_RENAME "gn") + set(CIPD_DOWNLOAD_GN "https://chrome-infra-packages.appspot.com/dl/gn/gn") + if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux") + set(_vfa_SUPPORTED ON) + set(GN_VERSION "xus7xtaPhpv5vCmKFOnsBVoB-PKmhZvRsSTjbQAuF0MC") + set(GN_PLATFORM "linux-amd64") + set(HASH "871e75d7f3597b74fb99e36bb41fe5a9f8ce8a4d9f167f4729fc6e444807a59f35ec8aca70c2274a99c79d70a1108272be1ad991678a8ceb39e30f77abb13135") + elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin") + set(_vfa_SUPPORTED ON) + set(GN_VERSION "qhxILDNcJ2H44HfHmfiU-XIY3E_SIXvFqLd2wvbIgOoC") + set(GN_PLATFORM "mac-amd64") + set(HASH "03ee64cb15bae7fceb412900d470601090bce147cfd45eb9b46683ac1a5dca848465a5d74c55a47df7f0e334d708151249a6d37bb021de74dd48b97ed4a07937") + else() + set(GN_VERSION "qUkAhy9J0P7c5racy-9wB6AHNK_btS18im8S06_ehhwC") + set(GN_PLATFORM "windows-amd64") + set(HASH "263e02bd79eee0cb7b664831b7898565c5656a046328d8f187ef7ae2a4d766991d477b190c9b425fcc960ab76f381cd3e396afb85cba7408ca9e74eb32c175db") + endif() + set(SUBDIR "${GN_VERSION}") + set(URL "${CIPD_DOWNLOAD_GN}/${GN_PLATFORM}/+/${GN_VERSION}") + set(ARCHIVE "gn-${GN_PLATFORM}.zip") + elseif(VAR MATCHES "GO") + set(PROGNAME go) + set(SUBDIR 1.13.1.windows-386) + set(PATHS ${DOWNLOADS}/tools/go/${SUBDIR}/go/bin) + set(BREW_PACKAGE_NAME "go") + set(APT_PACKAGE_NAME "golang-go") + set(URL "https://dl.google.com/go/go${SUBDIR}.zip") + set(ARCHIVE "go${SUBDIR}.zip") + set(HASH 2ab0f07e876ad98d592351a8808c2de42351ab387217e088bc4c5fa51d6a835694c501e2350802323b55a27dc0157f8b70045597f789f9e50f5ceae50dea3027) + elseif(VAR MATCHES "PYTHON3") + if(CMAKE_HOST_WIN32) + set(PROGNAME python) + set(PYTHON_VERSION 3.9.2) + if (VCPKG_TARGET_ARCHITECTURE STREQUAL x86) + set(SUBDIR "python-${PYTHON_VERSION}-x86") + set(URL "https://www.python.org/ftp/python/${PYTHON_VERSION}/python-${PYTHON_VERSION}-embed-win32.zip") + set(ARCHIVE "python-${PYTHON_VERSION}-embed-win32.zip") + set(HASH d792c6179887120ec3e945764b95ae8187032e1779f327feb90ded40ebd39cb78d000056df947f28c9e4257b60dd95ee43a3f77f47a1d8878cbe37ebc20f87a3) + else() + set(SUBDIR "python-${PYTHON_VERSION}-x64") + set(URL "https://www.python.org/ftp/python/${PYTHON_VERSION}/python-${PYTHON_VERSION}-embed-amd64.zip") + set(ARCHIVE "python-${PYTHON_VERSION}-embed-amd64.zip") + set(HASH 30f36938d264d160136eb7062846924b980b4f8f4373dab4fbc054c764041149f56760370de571be10410363563c5688a3f1f9ac19be5bb40ae914ddbdcb3c62) + endif() + set(PATHS ${DOWNLOADS}/tools/python/${SUBDIR}) + set(POST_INSTALL_COMMAND ${CMAKE_COMMAND} -E rm python39._pth) + else() + set(PROGNAME python3) + set(BREW_PACKAGE_NAME "python") + set(APT_PACKAGE_NAME "python3") + endif() + elseif(VAR MATCHES "PYTHON2") + if(CMAKE_HOST_WIN32) + set(PROGNAME python) + set(PYTHON_VERSION 2.7.16) + if (VCPKG_TARGET_ARCHITECTURE STREQUAL x86) + set(SUBDIR "python-${PYTHON_VERSION}-x86") + set(URL "https://www.python.org/ftp/python/${PYTHON_VERSION}/python-${PYTHON_VERSION}.msi") + set(ARCHIVE "python-${PYTHON_VERSION}.msi") + set(HASH c34a6fa2438682104dccb53650a2bdb79eac7996deff075201a0f71bb835d60d3ed866652a1931f15a29510fe8e1009ac04e423b285122d2e5747fefc4c10254) + else() + set(SUBDIR "python-${PYTHON_VERSION}-x64") + set(URL "https://www.python.org/ftp/python/${PYTHON_VERSION}/python-${PYTHON_VERSION}.amd64.msi") + set(ARCHIVE "python-${PYTHON_VERSION}.amd64.msi") + set(HASH 47c1518d1da939e3ba6722c54747778b93a44c525bcb358b253c23b2510374a49a43739c8d0454cedade858f54efa6319763ba33316fdc721305bc457efe4ffb) + endif() + set(PATHS ${DOWNLOADS}/tools/python/${SUBDIR}) + elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin") + # macOS includes Python 2.7 built-in as `python` + set(PROGNAME python) + set(BREW_PACKAGE_NAME "python2") + else() + set(PROGNAME python2) + set(APT_PACKAGE_NAME "python") + endif() + elseif(VAR MATCHES "RUBY") + set(PROGNAME "ruby") + set(PATHS ${DOWNLOADS}/tools/ruby/rubyinstaller-2.6.3-1-x86/bin) + set(URL https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.6.3-1/rubyinstaller-2.6.3-1-x86.7z) + set(ARCHIVE rubyinstaller-2.6.3-1-x86.7z) + set(HASH 4322317dd02ce13527bf09d6e6a7787ca3814ea04337107d28af1ac360bd272504b32e20ed3ea84eb5b21dae7b23bfe5eb0e529b6b0aa21a1a2bbb0a542d7aec) + elseif(VAR MATCHES "JOM") + set(PROGNAME jom) + set(SUBDIR "jom-1.1.3") + set(PATHS ${DOWNLOADS}/tools/jom/${SUBDIR}) + set(URL + "https://download.qt.io/official_releases/jom/jom_1_1_3.zip" + "https://mirrors.ocf.berkeley.edu/qt/official_releases/jom/jom_1_1_3.zip" + ) + set(ARCHIVE "jom_1_1_3.zip") + set(HASH 5b158ead86be4eb3a6780928d9163f8562372f30bde051d8c281d81027b766119a6e9241166b91de0aa6146836cea77e5121290e62e31b7a959407840fc57b33) + elseif(VAR MATCHES "7Z") + set(PROGNAME 7z) + set(PATHS "${DOWNLOADS}/tools/7z/Files/7-Zip") + set(URL "https://7-zip.org/a/7z1900.msi") + set(ARCHIVE "7z1900.msi") + set(HASH f73b04e2d9f29d4393fde572dcf3c3f0f6fa27e747e5df292294ab7536ae24c239bf917689d71eb10cc49f6b9a4ace26d7c122ee887d93cc935f268c404e9067) + elseif(VAR MATCHES "NINJA") + set(PROGNAME ninja) + set(NINJA_VERSION 1.10.1) + set(_vfa_SUPPORTED ON) + if(CMAKE_HOST_WIN32) + set(ARCHIVE "ninja-win-${NINJA_VERSION}.zip") + set(SUBDIR "${NINJA_VERSION}-windows") + set(URL "https://github.com/ninja-build/ninja/releases/download/v${NINJA_VERSION}/ninja-win.zip") + set(HASH 0120054f0fea6eea4035866201f69fba1c039f681f680cfcbbefcaee97419815d092a6e2f3823ea6c3928ad296395f36029e337127ee977270000b35df5f9c40) + elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin") + set(ARCHIVE "ninja-mac-${NINJA_VERSION}.zip") + set(URL "https://github.com/ninja-build/ninja/releases/download/v${NINJA_VERSION}/ninja-mac.zip") + set(SUBDIR "${NINJA_VERSION}-osx") + set(PATHS "${DOWNLOADS}/tools/ninja-${NINJA_VERSION}-osx") + set(HASH 99f5ccca2461a4d340f4528a8eef6d81180757da78313f1f9412ed13a7bbaf6df537a342536fd053db00524bcb734d205af5f6fde419a1eb2e6f77ee8b7860fe) + elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "FreeBSD") + set(PATHS "${DOWNLOADS}/tools/${SUBDIR}-freebsd") + set(_vfa_SUPPORTED OFF) + else() + set(ARCHIVE "ninja-linux-${NINJA_VERSION}.zip") + set(URL "https://github.com/ninja-build/ninja/releases/download/v${NINJA_VERSION}/ninja-linux.zip") + set(SUBDIR "${NINJA_VERSION}-linux") + set(PATHS "${DOWNLOADS}/tools/ninja-${NINJA_VERSION}-linux") + set(HASH 9820c76fde6fac398743766e7ea0fe8a7d6e4191a77512a2d2f51c2ddcc947fcd91ac08522742281a285418c114e760b0158a968305f8dc854bb9693883b7f1e) + endif() + set(VERSION_CMD --version) + elseif(VAR MATCHES "NUGET") + set(PROGNAME nuget) + set(SUBDIR "5.5.1") + set(PATHS "${DOWNLOADS}/tools/nuget-${SUBDIR}-windows") + set(BREW_PACKAGE_NAME "nuget") + set(URL "https://dist.nuget.org/win-x86-commandline/v5.5.1/nuget.exe") + set(_vfa_RENAME "nuget.exe") + set(ARCHIVE "nuget.5.5.1.exe") + set(NOEXTRACT ON) + set(HASH 22ea847d8017cd977664d0b13c889cfb13c89143212899a511be217345a4e243d4d8d4099700114a11d26a087e83eb1a3e2b03bdb5e0db48f10403184cd26619) + elseif(VAR MATCHES "MESON") + set(MESON_VERSION 0.58.0) + set(PROGNAME meson) + set(REQUIRED_INTERPRETER PYTHON3) + set(APT_PACKAGE_NAME "meson") + set(BREW_PACKAGE_NAME "meson") + set(SCRIPTNAME meson meson.py) + set(REF 753954be868ed78b3e339e8811fd1d29eb2af237) + set(PATHS ${DOWNLOADS}/tools/meson/meson-${REF}) + set(URL "https://github.com/mesonbuild/meson/archive/${REF}.tar.gz") + set(ARCHIVE "meson-${REF}.tar.gz") + #set(PATHS ${DOWNLOADS}/tools/meson/meson-${MESON_VERSION}) + #set(URL "https://github.com/mesonbuild/meson/releases/download/${MESON_VERSION}/meson-${MESON_VERSION}.tar.gz") + #set(ARCHIVE "meson-${MESON_VERSION}.tar.gz") + set(HASH 1e5b5ac216cb41af40b3e72240f3cb319772a02aaea39f672085aafb41c3c732c932c9d0c4e8deb5b4b1ec1112860e6a3ddad59898bebbd165ed7876c87728b3) + set(_vfa_SUPPORTED ON) + set(VERSION_CMD --version) + elseif(VAR MATCHES "FLEX" OR VAR MATCHES "BISON") + if(CMAKE_HOST_WIN32) + set(SOURCEFORGE_ARGS + REPO winflexbison + FILENAME winflexbison-2.5.16.zip + SHA512 0a14154bff5d998feb23903c46961528f8ccb4464375d5384db8c4a7d230c0c599da9b68e7a32f3217a0a0735742242eaf3769cb4f03e00931af8640250e9123 + NO_REMOVE_ONE_LEVEL + WORKING_DIRECTORY "${DOWNLOADS}/tools/winflexbison" + ) + if(VAR MATCHES "FLEX") + set(PROGNAME win_flex) + else() + set(PROGNAME win_bison) + endif() + set(PATHS ${DOWNLOADS}/tools/winflexbison/0a14154bff-a8cf65db07) + if(NOT EXISTS "${PATHS}/data/m4sugar/m4sugar.m4") + file(REMOVE_RECURSE "${PATHS}") + endif() + elseif(VAR MATCHES "FLEX") + set(PROGNAME flex) + set(APT_PACKAGE_NAME flex) + set(BREW_PACKAGE_NAME flex) + else() + set(PROGNAME bison) + set(APT_PACKAGE_NAME bison) + set(BREW_PACKAGE_NAME bison) + if (APPLE) + set(PATHS /usr/local/opt/bison/bin) + endif() + endif() + elseif(VAR MATCHES "CLANG") + set(PROGNAME clang) + set(SUBDIR "clang-10.0.0") + if(CMAKE_HOST_WIN32) + set(PATHS + # Support LLVM in Visual Studio 2019 + "$ENV{LLVMInstallDir}/x64/bin" + "$ENV{LLVMInstallDir}/bin" + "$ENV{VCINSTALLDIR}/Tools/Llvm/x64/bin" + "$ENV{VCINSTALLDIR}/Tools/Llvm/bin" + "${DOWNLOADS}/tools/${SUBDIR}-windows/bin" + "${DOWNLOADS}/tools/clang/${SUBDIR}/bin") + + if(DEFINED ENV{PROCESSOR_ARCHITEW6432}) + set(HOST_ARCH_ $ENV{PROCESSOR_ARCHITEW6432}) + else() + set(HOST_ARCH_ $ENV{PROCESSOR_ARCHITECTURE}) + endif() + + if(HOST_ARCH_ MATCHES "64") + set(URL "https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.0/LLVM-10.0.0-win64.exe") + set(ARCHIVE "LLVM-10.0.0-win64.7z.exe") + set(HASH 3603a4be3548dabc7dda94f3ed4384daf8a94337e44ee62c0d54776c79f802b0cb98fc106e902409942e841c39bc672cc6d61153737ad1cc386b609ef25db71c) + else() + set(URL "https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.0/LLVM-10.0.0-win32.exe") + set(ARCHIVE "LLVM-10.0.0-win32.7z.exe") + set(HASH 8494922b744ca0dc8d075a1d3a35a0db5a9287544afd5c4984fa328bc26f291209f6030175896b4895019126f5832045e06d8ad48072b549916df29a2228348b) + endif() + endif() + set(BREW_PACKAGE_NAME "llvm") + set(APT_PACKAGE_NAME "clang") + elseif(VAR MATCHES "GPERF") + set(PROGNAME gperf) + set(GPERF_VERSION 3.0.1) + set(PATHS ${DOWNLOADS}/tools/gperf/bin) + set(URL "https://sourceforge.net/projects/gnuwin32/files/gperf/${GPERF_VERSION}/gperf-${GPERF_VERSION}-bin.zip/download") + set(ARCHIVE "gperf-${GPERF_VERSION}-bin.zip") + set(HASH 3f2d3418304390ecd729b85f65240a9e4d204b218345f82ea466ca3d7467789f43d0d2129fcffc18eaad3513f49963e79775b10cc223979540fa2e502fe7d4d9) + elseif(VAR MATCHES "GASPREPROCESSOR") + set(NOEXTRACT true) + set(PROGNAME gas-preprocessor) + set(SUBDIR "4daa6115") + set(REQUIRED_INTERPRETER PERL) + set(SCRIPTNAME "gas-preprocessor.pl") + set(PATHS ${DOWNLOADS}/tools/gas-preprocessor/${SUBDIR}) + set(_vfa_RENAME "gas-preprocessor.pl") + set(URL "https://raw.githubusercontent.com/FFmpeg/gas-preprocessor/4daa611556a0558dfe537b4f7ad80f7e50a079c1/gas-preprocessor.pl") + set(ARCHIVE "gas-preprocessor-${SUBDIR}.pl") + set(HASH 2737ba3c1cf85faeb1fbfe015f7bad170f43a857a50a1b3d81fa93ba325d481f73f271c5a886ff8b7eef206662e19f0e9ef24861dfc608b67b8ea8a2062dc061) + elseif(VAR MATCHES "DARK") + set(PROGNAME dark) + set(SUBDIR "wix311-binaries") + set(PATHS ${DOWNLOADS}/tools/dark/${SUBDIR}) + set(URL "https://github.com/wixtoolset/wix3/releases/download/wix311rtm/wix311-binaries.zip") + set(ARCHIVE "wix311-binaries.zip") + set(HASH 74f0fa29b5991ca655e34a9d1000d47d4272e071113fada86727ee943d913177ae96dc3d435eaf494d2158f37560cd4c2c5274176946ebdb17bf2354ced1c516) + elseif(VAR MATCHES "SCONS") + set(PROGNAME scons) + set(SCONS_VERSION 3.0.1) + set(SUBDIR ${SCONS_VERSION}) + set(REQUIRED_INTERPRETER PYTHON2) + set(SCRIPTNAME "scons.py") + set(URL "https://sourceforge.net/projects/scons/files/scons-local-${SCONS_VERSION}.zip/download") + set(ARCHIVE "scons-local-${SCONS_VERSION}.zip") + set(HASH fe121b67b979a4e9580c7f62cfdbe0c243eba62a05b560d6d513ac7f35816d439b26d92fc2d7b7d7241c9ce2a49ea7949455a17587ef53c04a5f5125ac635727) + elseif(VAR MATCHES "SWIG") + set(SWIG_VERSION 4.0.2) + set(PROGNAME swig) + if(CMAKE_HOST_WIN32) + set(SOURCEFORGE_ARGS + REPO swig/swigwin + REF swigwin-${SWIG_VERSION} + FILENAME "swigwin-${SWIG_VERSION}.zip" + SHA512 b8f105f9b9db6acc1f6e3741990915b533cd1bc206eb9645fd6836457fd30789b7229d2e3219d8e35f2390605ade0fbca493ae162ec3b4bc4e428b57155db03d + NO_REMOVE_ONE_LEVEL + WORKING_DIRECTORY "${DOWNLOADS}/tools/swig" + ) + set(SUBDIR b8f105f9b9-f0518bc3b7/swigwin-${SWIG_VERSION}) + else() + set(APT_PACKAGE_NAME "swig") + set(BREW_PACKAGE_NAME "swig") + endif() + + elseif(VAR MATCHES "DOXYGEN") + set(PROGNAME doxygen) + set(DOXYGEN_VERSION 1.8.17) + set(SOURCEFORGE_ARGS + REPO doxygen + REF rel-${DOXYGEN_VERSION} + FILENAME "doxygen-${DOXYGEN_VERSION}.windows.bin.zip" + SHA512 6bac47ec552486783a70cc73b44cf86b4ceda12aba6b52835c2221712bd0a6c845cecec178c9ddaa88237f5a781f797add528f47e4ed017c7888eb1dd2bc0b4b + NO_REMOVE_ONE_LEVEL + WORKING_DIRECTORY "${DOWNLOADS}/tools/doxygen" + ) + set(SUBDIR 6bac47ec55-25c819fd77) + elseif(VAR MATCHES "BAZEL") + set(PROGNAME bazel) + set(BAZEL_VERSION 3.7.0) + set(_vfa_RENAME "bazel") + if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux") + set(_vfa_SUPPORTED ON) + set(SUBDIR ${BAZEL_VERSION}-linux) + set(URL "https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/bazel-${SUBDIR}-x86_64") + set(ARCHIVE "bazel-${SUBDIR}-x86_64") + set(NOEXTRACT ON) + set(HASH 1118eb939627cc5570616f7bd41c72a90df9bb4a3c802eb8149b5b2eebf27090535c029590737557e270c5a8556267b8c1843eb0ff55dc9e4b82581a64e07ec1) + elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin") + set(_vfa_SUPPORTED ON) + set(SUBDIR ${BAZEL_VERSION}-darwin) + set(URL "https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/bazel-${SUBDIR}-x86_64") + set(ARCHIVE "bazel-${SUBDIR}-x86_64") + set(NOEXTRACT ON) + set(HASH e2d792f0fc03a4a57a4c2c8345141d86a2dc25a09757f26cb18534426f73d10b4de021e2a3d439956a92d2a712aae9ad75357db24d02f9b0890cc643615a997c) + else() + set(SUBDIR ${BAZEL_VERSION}-windows) + set(URL "https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/bazel-${SUBDIR}-x86_64.zip") + set(ARCHIVE "bazel-${SUBDIR}-x86_64.zip") + set(HASH 410b6788f624b3b0b9f13f5b4d12c1b24447f133210a68e2f110aff8d95bb954e40ea1d863a8cc3473402d1c2f15c38042e6af0cb207056811e4cc7bd0b9ca00) + endif() + elseif(VAR MATCHES "ARIA2") + set(PROGNAME aria2c) + set(ARIA2_VERSION 1.34.0) + set(PATHS ${DOWNLOADS}/tools/aria2c/aria2-${ARIA2_VERSION}-win-32bit-build1) + set(URL "https://github.com/aria2/aria2/releases/download/release-${ARIA2_VERSION}/aria2-${ARIA2_VERSION}-win-32bit-build1.zip") + set(ARCHIVE "aria2-${ARIA2_VERSION}-win-32bit-build1.zip") + set(HASH 2a5480d503ac6e8203040c7e516a3395028520da05d0ebf3a2d56d5d24ba5d17630e8f318dd4e3cc2094cc4668b90108fb58e8b986b1ffebd429995058063c27) + elseif(VAR MATCHES "PKGCONFIG") + set(PROGNAME pkg-config) + if(ENV{PKG_CONFIG}) + debug_message(STATUS "PKG_CONFIG found in ENV! Using $ENV{PKG_CONFIG}") + set(PKGCONFIG $ENV{PKG_CONFIG} PARENT_SCOPE) + return() + elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "OpenBSD") + # As of 6.8, the OpenBSD specific pkg-config doesn't support {pcfiledir} + set(_vfa_SUPPORTED ON) + set(_vfa_RENAME "pkg-config") + set(PKGCONFIG_VERSION 0.29.2.1) + set(NOEXTRACT ON) + set(ARCHIVE "pkg-config.openbsd") + set(SUBDIR "openbsd") + set(URL "https://raw.githubusercontent.com/jgilje/pkg-config-openbsd/master/pkg-config") + set(HASH b7ec9017b445e00ae1377e36e774cf3f5194ab262595840b449832707d11e443a102675f66d8b7e8b2e2f28cebd6e256835507b1e0c69644cc9febab8285080b) + set(VERSION_CMD --version) + elseif(CMAKE_HOST_WIN32) + if(NOT EXISTS "${PKGCONFIG}") + set(VERSION 0.29.2-2) + set(LIBWINPTHREAD_VERSION git-8.0.0.5906.c9a21571-1) + vcpkg_acquire_msys( + PKGCONFIG_ROOT + NO_DEFAULT_PACKAGES + DIRECT_PACKAGES + "https://repo.msys2.org/mingw/i686/mingw-w64-i686-pkg-config-${VERSION}-any.pkg.tar.zst" + 54f8dad3b1a36a4515db47825a3214fbd2bd82f604aec72e7fb8d79068095fda3c836fb2296acd308522d6e12ce15f69e0c26dcf4eb0681fd105d057d912cdb7 + "https://repo.msys2.org/mingw/i686/mingw-w64-i686-libwinpthread-${LIBWINPTHREAD_VERSION}-any.pkg.tar.zst" + 2c3d9e6b2eee6a4c16fd69ddfadb6e2dc7f31156627d85845c523ac85e5c585d4cfa978659b1fe2ec823d44ef57bc2b92a6127618ff1a8d7505458b794f3f01c + ) + endif() + set(${VAR} "${PKGCONFIG_ROOT}/mingw32/bin/pkg-config.exe" PARENT_SCOPE) + return() + else() + set(BREW_PACKAGE_NAME pkg-config) + set(APT_PACKAGE_NAME pkg-config) + set(PATHS "/bin" "/usr/bin" "/usr/local/bin") + endif() + else() + message(FATAL "unknown tool ${VAR} -- unable to acquire.") + endif() + + macro(do_version_check) + if(VERSION_CMD) + vcpkg_execute_in_download_mode( + COMMAND ${${VAR}} ${VERSION_CMD} + WORKING_DIRECTORY ${VCPKG_ROOT_DIR} + OUTPUT_VARIABLE ${VAR}_VERSION_OUTPUT + ) + string(STRIP "${${VAR}_VERSION_OUTPUT}" ${VAR}_VERSION_OUTPUT) + #TODO: REGEX MATCH case for more complex cases! + if(NOT ${VAR}_VERSION_OUTPUT VERSION_GREATER_EQUAL ${VAR}_VERSION) + message(STATUS "Found ${PROGNAME}('${${VAR}_VERSION_OUTPUT}') but at least version ${${VAR}_VERSION} is required! Trying to use internal version if possible!") + set(${VAR} "${VAR}-NOTFOUND" CACHE INTERNAL "") + else() + message(STATUS "Found external ${PROGNAME}('${${VAR}_VERSION_OUTPUT}').") + endif() + endif() + endmacro() + + macro(do_find) + if(NOT DEFINED REQUIRED_INTERPRETER) + find_program(${VAR} ${PROGNAME} PATHS ${PATHS} NO_DEFAULT_PATH) + if(NOT ${VAR}) + find_program(${VAR} ${PROGNAME}) + if(${VAR} AND NOT ${VAR}_VERSION_CHECKED) + do_version_check() + set(${VAR}_VERSION_CHECKED ON) + elseif(${VAR}_VERSION_CHECKED) + message(FATAL_ERROR "Unable to find ${PROGNAME} with min version of ${${VAR}_VERSION}") + endif() + endif() + else() + vcpkg_find_acquire_program(${REQUIRED_INTERPRETER}) + find_file(SCRIPT_${VAR} NAMES ${SCRIPTNAME} PATHS ${PATHS} NO_DEFAULT_PATH) + if(NOT SCRIPT_${VAR}) + find_file(SCRIPT_${VAR} NAMES ${SCRIPTNAME}) + if(SCRIPT_${VAR} AND NOT ${VAR}_VERSION_CHECKED) + set(${VAR} ${${REQUIRED_INTERPRETER}} ${SCRIPT_${VAR}}) + do_version_check() + set(${VAR}_VERSION_CHECKED ON) + if(NOT ${VAR}) + unset(SCRIPT_${VAR} CACHE) + endif() + elseif(${VAR}_VERSION_CHECKED) + message(FATAL_ERROR "Unable to find ${PROGNAME} with min version of ${${VAR}_VERSION}") + endif() + endif() + if(SCRIPT_${VAR}) + set(${VAR} ${${REQUIRED_INTERPRETER}} ${SCRIPT_${VAR}}) + endif() + endif() + endmacro() + + if(NOT DEFINED PROG_PATH_SUBDIR) + set(PROG_PATH_SUBDIR "${DOWNLOADS}/tools/${PROGNAME}/${SUBDIR}") + endif() + if(DEFINED SUBDIR) + list(APPEND PATHS ${PROG_PATH_SUBDIR}) + endif() + + do_find() + if(NOT ${VAR}) + if(NOT CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows" AND NOT _vfa_SUPPORTED) + set(EXAMPLE ".") + if(DEFINED BREW_PACKAGE_NAME AND CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin") + set(EXAMPLE ":\n brew install ${BREW_PACKAGE_NAME}") + elseif(DEFINED APT_PACKAGE_NAME AND CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux") + set(EXAMPLE ":\n sudo apt-get install ${APT_PACKAGE_NAME}") + endif() + message(FATAL_ERROR "Could not find ${PROGNAME}. Please install it via your package manager${EXAMPLE}") + endif() + + if(DEFINED SOURCEFORGE_ARGS) + # Locally change editable to suppress re-extraction each time + set(_VCPKG_EDITABLE 1) + vcpkg_from_sourceforge(OUT_SOURCE_PATH SFPATH ${SOURCEFORGE_ARGS}) + unset(_VCPKG_EDITABLE) + else() + vcpkg_download_distfile(ARCHIVE_PATH + URLS ${URL} + SHA512 ${HASH} + FILENAME ${ARCHIVE} + ) + + file(MAKE_DIRECTORY ${PROG_PATH_SUBDIR}) + if(DEFINED NOEXTRACT) + if(DEFINED _vfa_RENAME) + file(INSTALL ${ARCHIVE_PATH} DESTINATION ${PROG_PATH_SUBDIR} RENAME ${_vfa_RENAME} FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) + else() + file(COPY ${ARCHIVE_PATH} DESTINATION ${PROG_PATH_SUBDIR} FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) + endif() + else() + get_filename_component(ARCHIVE_EXTENSION ${ARCHIVE} LAST_EXT) + string(TOLOWER "${ARCHIVE_EXTENSION}" ARCHIVE_EXTENSION) + if(ARCHIVE_EXTENSION STREQUAL ".msi") + file(TO_NATIVE_PATH "${ARCHIVE_PATH}" ARCHIVE_NATIVE_PATH) + file(TO_NATIVE_PATH "${PROG_PATH_SUBDIR}" DESTINATION_NATIVE_PATH) + vcpkg_execute_in_download_mode( + COMMAND msiexec /a ${ARCHIVE_NATIVE_PATH} /qn TARGETDIR=${DESTINATION_NATIVE_PATH} + WORKING_DIRECTORY ${DOWNLOADS} + ) + elseif("${ARCHIVE_PATH}" MATCHES ".7z.exe$") + vcpkg_find_acquire_program(7Z) + vcpkg_execute_in_download_mode( + COMMAND ${7Z} x "${ARCHIVE_PATH}" "-o${PROG_PATH_SUBDIR}" -y -bso0 -bsp0 + WORKING_DIRECTORY ${PROG_PATH_SUBDIR} + ) + else() + vcpkg_execute_in_download_mode( + COMMAND ${CMAKE_COMMAND} -E tar xzf ${ARCHIVE_PATH} + WORKING_DIRECTORY ${PROG_PATH_SUBDIR} + ) + endif() + endif() + endif() + + if(DEFINED POST_INSTALL_COMMAND) + vcpkg_execute_required_process( + ALLOW_IN_DOWNLOAD_MODE + COMMAND ${POST_INSTALL_COMMAND} + WORKING_DIRECTORY ${PROG_PATH_SUBDIR} + LOGNAME ${VAR}-tool-post-install + ) + endif() + unset(${VAR} CACHE) + do_find() + if(NOT ${VAR}) + message(FATAL_ERROR "Unable to find ${VAR}") + endif() + endif() + + set(${VAR} "${${VAR}}" PARENT_SCOPE) +endfunction() diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_find_fortran.cmake b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_find_fortran.cmake new file mode 100644 index 000000000..fd359d0ee --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_find_fortran.cmake @@ -0,0 +1,131 @@ +#[===[.md:
+# vcpkg_find_fortran
+
+Checks if a Fortran compiler can be found.
+Windows(x86/x64) Only: If not it will switch/enable MinGW gfortran
+ and return required cmake args for building.
+
+## Usage
+```cmake
+vcpkg_find_fortran(<additional_cmake_args_out>)
+```
+#]===]
+
+function(vcpkg_find_fortran additional_cmake_args_out)
+ set(ARGS_OUT)
+ set(CMAKE_BINARY_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}")
+ set(CMAKE_CURRENT_BINARY_DIR "${CMAKE_BINARY_DIR}")
+ set(CMAKE_PLATFORM_INFO_DIR "${CMAKE_BINARY_DIR}/Platform")
+ include(CMakeDetermineFortranCompiler)
+ if(NOT CMAKE_Fortran_COMPILER AND NOT VCPKG_CHAINLOAD_TOOLCHAIN_FILE)
+ # This intentionally breaks users with a custom toolchain which do not have a Fortran compiler setup
+ # because they either need to use a port-overlay (for e.g. lapack), remove the toolchain for the port using fortran
+ # or setup fortran in their VCPKG_CHAINLOAD_TOOLCHAIN_FILE themselfs!
+ if(WIN32)
+ message(STATUS "No Fortran compiler found on the PATH. Using MinGW gfortran!")
+ # If no Fortran compiler is on the path we switch to use gfortan from MinGW within vcpkg
+ if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86")
+ set(MINGW_PATH mingw32)
+ set(MACHINE_FLAG -m32)
+ vcpkg_acquire_msys(MSYS_ROOT
+ DIRECT_PACKAGES
+ "https://repo.msys2.org/mingw/i686/mingw-w64-i686-gcc-fortran-10.2.0-1-any.pkg.tar.zst"
+ ddbdaf9ea865181e16a0931b2ec88c2dcef8add34628e479c7b9de4fa2ccb22e09c7239442e58702e0acd3adabc920565e976984f2bcd90a3668bf7f48a245f1
+ "https://repo.msys2.org/mingw/i686/mingw-w64-i686-gcc-libgfortran-10.2.0-1-any.pkg.tar.zst"
+ 150f355085fcf4c54e8bce8f7f08b90fea9ca7e1f32cff0a2e495faa63cf7723f4bf935f0f4ec77c8dd2ba710ceaed88694cb3da71def5e2088dd65e13c9b002
+ "https://repo.msys2.org/mingw/i686/mingw-w64-i686-gcc-libs-10.2.0-1-any.pkg.tar.zst"
+ 113d8b3b155ea537be8b99688d454f781d70c67c810c2643bc02b83b332d99bfbf3a7fcada6b927fda67ef02cf968d4fdf930466c5909c4338bda64f1f3f483e
+ "https://repo.msys2.org/mingw/i686/mingw-w64-i686-gmp-6.2.0-1-any.pkg.tar.xz"
+ 37747f3f373ebff1a493f5dec099f8cd6d5abdc2254d9cd68a103ad7ba44a81a9a97ccaba76eaee427b4d67b2becb655ee2c379c2e563c8051b6708431e3c588
+ "https://repo.msys2.org/mingw/i686/mingw-w64-i686-libwinpthread-git-8.0.0.5906.c9a21571-1-any.pkg.tar.zst"
+ 2c3d9e6b2eee6a4c16fd69ddfadb6e2dc7f31156627d85845c523ac85e5c585d4cfa978659b1fe2ec823d44ef57bc2b92a6127618ff1a8d7505458b794f3f01c
+ "https://repo.msys2.org/mingw/i686/mingw-w64-i686-winpthreads-git-8.0.0.5906.c9a21571-1-any.pkg.tar.zst"
+ e87ad4f4071c6b5bba3b13a85abf6657bb494b73c57ebe65bc5a92e2cef1d9de354e6858d1338ee72809e3dc742ba69ce090aaad4560ae1d3479a61dbebf03c6
+ "https://repo.msys2.org/mingw/i686/mingw-w64-i686-mpc-1.1.0-1-any.pkg.tar.xz"
+ d236b815ec3cf569d24d96a386eca9f69a2b1e8af18e96c3f1e5a4d68a3598d32768c7fb3c92207ecffe531259822c1a421350949f2ffabd8ee813654f1af864
+ "https://repo.msys2.org/mingw/i686/mingw-w64-i686-mpfr-4.1.0-2-any.pkg.tar.zst"
+ caac5cb73395082b479597a73c7398bf83009dbc0051755ef15157dc34996e156d4ed7881ef703f9e92861cfcad000888c4c32e4bf38b2596c415a19aafcf893
+ "https://repo.msys2.org/mingw/i686/mingw-w64-i686-gcc-10.2.0-1-any.pkg.tar.zst"
+ 3085e744e716301ba8e4c8a391ab09c2d51e587e0a2df5dab49f83b403a32160f8d713cf1a42c1d962885b4c6ee3b6ed36ef40de15c4be2b69dbc3f12f974c3c
+ "https://repo.msys2.org/mingw/i686/mingw-w64-i686-binutils-2.34-3-any.pkg.tar.zst"
+ ff06b2adebe6e9b278b63ca5638ff704750a346faad1cdc40089431b0a308edb6f2a131815e0577673a19878ec1bd8d5a4fa592aa227de769496c1fd3aedbc85
+ "https://repo.msys2.org/mingw/i686/mingw-w64-i686-crt-git-8.0.0.5966.f5da805f-1-any.pkg.tar.zst"
+ 120c943ce173719e48400fa18299f3458bc9db4cf18bb5a4dda8a91cc3f816510b337a92f7388077c65b50bbbeae9078793891ceaad631d780b10fde19ad3649
+ "https://repo.msys2.org/mingw/i686/mingw-w64-i686-headers-git-8.0.0.5966.f5da805f-1-any.pkg.tar.zst"
+ dbb9f8258da306a3441f9882faa472c3665a67b2ea68657f3e8a1402dcfacf9787a886a3daf0eefe4946f04557bc166eb15b21c1093ad85c909002daadba1923
+ "https://repo.msys2.org/mingw/i686/mingw-w64-i686-libiconv-1.16-1-any.pkg.tar.xz"
+ ba236e1efc990cb91d459f938be6ca6fc2211be95e888d73f8de301bce55d586f9d2b6be55dacb975ec1afa7952b510906284eff70210238919e341dffbdbeb8
+ "https://repo.msys2.org/mingw/i686/mingw-w64-i686-windows-default-manifest-6.4-3-any.pkg.tar.xz"
+ 5b99abc55eaa74cf85ca64a9c91542554cb5c1098bc71effba9bd36242694cfd348503fcd3507fb9ba97486108c092c925e2f38cd744493386b3dc9ab28bc526
+ "https://repo.msys2.org/mingw/i686/mingw-w64-i686-zlib-1.2.11-7-any.pkg.tar.xz"
+ 459850a8c42b1d497268736629ef713beee70cd0d3161d02c7a9fad08aca4560f4e17ba02d5cabda8a19d7c614f7e0ef5a6ec13afd91dd3004057139a5469c8f
+ "https://repo.msys2.org/mingw/i686/mingw-w64-i686-zstd-1.4.5-1-any.pkg.tar.zst"
+ 68f431073717b59549ab0fd26be8df8afcb43f3dd85be2ffcbc7d1a629999eed924656a7fc3f50937b2e6605a5067542d016181106b7bc3408b89b268ced5d23
+ )
+ elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64")
+ set(MINGW_PATH mingw64)
+ set(MACHINE_FLAG -m64)
+ vcpkg_acquire_msys(MSYS_ROOT
+ DIRECT_PACKAGES
+ "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-gcc-fortran-10.2.0-1-any.pkg.tar.zst"
+ 0de02db791e978ae21577e675ee9676f741336c9a5ceb5614dbdfc793e2c1c4749b394f41362af7b069e970302fddf8c6772ebd8445fe1c360861606b1784b4d
+ "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-gcc-libgfortran-10.2.0-1-any.pkg.tar.zst"
+ c2dee2957356fa51aae39d907d0cc07f966028b418f74a1ea7ea551ff001c175d86781f980c0cf994207794322dcd369fa122ab78b6c6d0f0ab01e39a754e780
+ "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-gcc-libs-10.2.0-1-any.pkg.tar.zst"
+ d17eff08c83d08ef020d999a2ead0d25036ada1c1bf6ed7c02bad9b56840ee5a3304acd790d86f52b83b09c1e788f0cecdf7254dc6760c3c7e478f65882cd32d
+ "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-gmp-6.2.0-1-any.pkg.tar.xz"
+ 0b22b7363e27cec706eb79ee0c45b5fe7088a5ca69e0868e7366481ed2ea9b3f6623d340cebba0b5ed3d79e4dfc7cf15f53530eb260c6d4057bfc3d92eb8c7bc
+ "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-libwinpthread-git-8.0.0.5906.c9a21571-1-any.pkg.tar.zst"
+ a6969a5db1c55ba458c1a047d0a2a9d2db6cc24266ea47f740598b149a601995d2de734a0984ac5e57ee611d5982cbc03fd6fc0f498435e8d6401bf15724caad
+ "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-winpthreads-git-8.0.0.5906.c9a21571-1-any.pkg.tar.zst"
+ 87ae090a8de855de5580f158f4007f88d6dad341429620685dc736be55b1f060487552040327a76003618e214a11c1f8e5105ca2c7abe164908121627449d679
+ "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-mpc-1.1.0-1-any.pkg.tar.xz"
+ db075a1406690935db5780af293660385f56699881a1b2cd25ab252183643d71d646b0dadf1e34174df8f0744d51ce8b56dccd719e049efcaf9b7e08e80a7ef6
+ "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-mpfr-4.1.0-2-any.pkg.tar.zst"
+ 14739667242b8852f0d26547eb3297899a51fd1edafc7101b4e7489273e1efb9cb8422fc067361e3c3694c2afcc6c49fc89537f9f811ad5b9b595873112ee890
+ "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-gcc-10.2.0-1-any.pkg.tar.zst"
+ 7a08c7923f688ca8f06d55e1e91b9059a933ee56e27075ea073e6e58ae220310fb5f79869886a61b6987ab08993c9f962a4bfc50b6ea80473e933ce5551f3930
+ "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-binutils-2.34-3-any.pkg.tar.zst"
+ 4efd5586c344802110ea0061867469a23571df88529d66a943f86add1287f85ef53b6a9a9b16af2cb67bd09e0760a6f290c3b04ba70c0d5861d8a9f79f0ac209
+ "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-crt-git-8.0.0.5966.f5da805f-1-any.pkg.tar.zst"
+ 0142e4a44c59d17380a4fc7b101a2152486781621d5f9f930045b8f9c4bb2c93ea88211e7d8f8f233e0ae09595c6c8bc948ae80b9673f231e715b0d04c8a1e54
+ "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-headers-git-8.0.0.5966.f5da805f-1-any.pkg.tar.zst"
+ b547091a45ea7df8182b627edc9a7c91a23f01c0d4e02634a590c02f24311741cad92ceb67b7e4432ffbe4266f135a5289eb3560cc90ffa5c57612c8537a1588
+ "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-libiconv-1.16-1-any.pkg.tar.xz"
+ c8e2fda532c753e0b1004596bf737c3669355f32af9b45d96c23fcef14994ba21ddf4f75138bdecc94cbf8a8c449eff530d24b74a0da47793e24ce92d154f411
+ "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-windows-default-manifest-6.4-3-any.pkg.tar.xz"
+ 77d02121416e42ff32a702e21266ce9031b4d8fc9ecdb5dc049d92570b658b3099b65d167ca156367d17a76e53e172ca52d468e440c2cdfd14701da210ffea37
+ "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-zlib-1.2.11-7-any.pkg.tar.xz"
+ bbd4a549efc2a5f4b1e9f1be00331e8726d80401a9c6117afa9d5dd92f4ac42a06cf2ce491a988e5c6ed7a6e536f8f1746081f4944bc6d473ccd16390fea27fe
+ "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-zstd-1.4.5-1-any.pkg.tar.zst"
+ dc2c7289fb206966829c98f6bf4389b423784415532ca3d627a22ae9d756a4fe2faf9844994b3093d814d129d20b2b79897e702aa9569978f58431ea66b55feb
+ )
+ else()
+ message(FATAL_ERROR "Unknown architecture '${VCPKG_TARGET_ARCHITECTURE}' for MinGW Fortran build!")
+ endif()
+
+ set(MINGW_BIN "${MSYS_ROOT}/${MINGW_PATH}/bin")
+ vcpkg_add_to_path(PREPEND "${MINGW_BIN}")
+ list(APPEND ARGS_OUT -DCMAKE_GNUtoMS=ON
+ "-DCMAKE_Fortran_COMPILER=${MINGW_BIN}/gfortran.exe"
+ "-DCMAKE_C_COMPILER=${MINGW_BIN}/gcc.exe"
+ "-DCMAKE_Fortran_FLAGS_INIT:STRING= -mabi=ms ${MACHINE_FLAG} ${VCPKG_Fortran_FLAGS}")
+ # This is for private use by vcpkg-gfortran
+ set(vcpkg_find_fortran_MSYS_ROOT "${MSYS_ROOT}" PARENT_SCOPE)
+ set(VCPKG_USE_INTERNAL_Fortran TRUE PARENT_SCOPE)
+ set(VCPKG_POLICY_SKIP_DUMPBIN_CHECKS enabled PARENT_SCOPE)
+ set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${SCRIPTS}/toolchains/mingw.cmake" PARENT_SCOPE) # Switching to MinGW toolchain for Fortran
+ if(VCPKG_CRT_LINKAGE STREQUAL "static")
+ set(VCPKG_CRT_LINKAGE dynamic PARENT_SCOPE)
+ message(STATUS "VCPKG_CRT_LINKAGE linkage for ${PORT} using vcpkg's internal gfortran cannot be static due to linking against MinGW libraries. Forcing dynamic CRT linkage")
+ endif()
+ if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
+ set(VCPKG_LIBRARY_LINKAGE dynamic PARENT_SCOPE)
+ message(STATUS "VCPKG_LIBRARY_LINKAGE linkage for ${PORT} using vcpkg's internal gfortran cannot be static due to linking against MinGW libraries. Forcing dynamic library linkage")
+ endif()
+ else()
+ message(FATAL_ERROR "Unable to find a Fortran compiler using 'CMakeDetermineFortranCompiler'. Please install one (e.g. gfortran) and make it available on the PATH!")
+ endif()
+ endif()
+ set(${additional_cmake_args_out} ${ARGS_OUT} PARENT_SCOPE)
+endfunction()
diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_fixup_cmake_targets.cmake b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_fixup_cmake_targets.cmake new file mode 100644 index 000000000..e6fbe785b --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_fixup_cmake_targets.cmake @@ -0,0 +1,245 @@ +# DEPRECATED BY ports/vcpkg-cmake-config/vcpkg_cmake_config_fixup +#[===[.md: +# vcpkg_fixup_cmake_targets + +Merge release and debug CMake targets and configs to support multiconfig generators. + +Additionally corrects common issues with targets, such as absolute paths and incorrectly placed binaries. + +## Usage +```cmake +vcpkg_fixup_cmake_targets([CONFIG_PATH <share/${PORT}>] + [TARGET_PATH <share/${PORT}>] + [TOOLS_PATH <tools/${PORT}>] + [DO_NOT_DELETE_PARENT_CONFIG_PATH]) +``` + +## Parameters + +### CONFIG_PATH +Subpath currently containing `*.cmake` files subdirectory (like `lib/cmake/${PORT}`). Should be relative to `${CURRENT_PACKAGES_DIR}`. + +Defaults to `share/${PORT}`. + +### TARGET_PATH +Subpath to which the above `*.cmake` files should be moved. Should be relative to `${CURRENT_PACKAGES_DIR}`. +This needs to be specified if the port name differs from the `find_package()` name. + +Defaults to `share/${PORT}`. + +### DO_NOT_DELETE_PARENT_CONFIG_PATH +By default the parent directory of CONFIG_PATH is removed if it is named "cmake". +Passing this option disable such behavior, as it is convenient for ports that install +more than one CMake package configuration file. + +### NO_PREFIX_CORRECTION +Disables the correction of_IMPORT_PREFIX done by vcpkg due to moving the targets. +Currently the correction does not take into account how the files are moved and applies +I rather simply correction which in some cases will yield the wrong results. + +### TOOLS_PATH +Define the base path to tools. Default: `tools/<PORT>` + +## Notes +Transform all `/debug/<CONFIG_PATH>/*targets-debug.cmake` files and move them to `/<TARGET_PATH>`. +Removes all `/debug/<CONFIG_PATH>/*targets.cmake` and `/debug/<CONFIG_PATH>/*config.cmake`. + +Transform all references matching `/bin/*.exe` to `/${TOOLS_PATH}/*.exe` on Windows. +Transform all references matching `/bin/*` to `/${TOOLS_PATH}/*` on other platforms. + +Fix `${_IMPORT_PREFIX}` in auto generated targets to be one folder deeper. +Replace `${CURRENT_INSTALLED_DIR}` with `${_IMPORT_PREFIX}` in configs and targets. + +## Examples + +* [concurrentqueue](https://github.com/Microsoft/vcpkg/blob/master/ports/concurrentqueue/portfile.cmake) +* [curl](https://github.com/Microsoft/vcpkg/blob/master/ports/curl/portfile.cmake) +* [nlohmann-json](https://github.com/Microsoft/vcpkg/blob/master/ports/nlohmann-json/portfile.cmake) +#]===] + +function(vcpkg_fixup_cmake_targets) + if(Z_VCPKG_CMAKE_CONFIG_FIXUP_GUARD) + message(FATAL_ERROR "The ${PORT} port already depends on vcpkg-cmake-config; using both vcpkg-cmake-config and vcpkg_fixup_cmake_targets in the same port is unsupported.") + endif() + + cmake_parse_arguments(PARSE_ARGV 0 arg "DO_NOT_DELETE_PARENT_CONFIG_PATH" "CONFIG_PATH;TARGET_PATH;NO_PREFIX_CORRECTION;TOOLS_PATH" "") + + if(arg_UNPARSED_ARGUMENTS) + message(FATAL_ERROR "vcpkg_fixup_cmake_targets was passed extra arguments: ${arg_UNPARSED_ARGUMENTS}") + endif() + + if(NOT arg_TARGET_PATH) + set(arg_TARGET_PATH share/${PORT}) + endif() + + if(NOT arg_TOOLS_PATH) + set(arg_TOOLS_PATH tools/${PORT}) + endif() + + string(REPLACE "." "\\." EXECUTABLE_SUFFIX "${VCPKG_TARGET_EXECUTABLE_SUFFIX}") + + set(DEBUG_SHARE ${CURRENT_PACKAGES_DIR}/debug/${arg_TARGET_PATH}) + set(RELEASE_SHARE ${CURRENT_PACKAGES_DIR}/${arg_TARGET_PATH}) + + if(arg_CONFIG_PATH AND NOT RELEASE_SHARE STREQUAL "${CURRENT_PACKAGES_DIR}/${arg_CONFIG_PATH}") + if(arg_CONFIG_PATH STREQUAL "share") + file(RENAME ${CURRENT_PACKAGES_DIR}/debug/share ${CURRENT_PACKAGES_DIR}/debug/share2) + file(RENAME ${CURRENT_PACKAGES_DIR}/share ${CURRENT_PACKAGES_DIR}/share2) + set(arg_CONFIG_PATH share2) + endif() + + set(DEBUG_CONFIG ${CURRENT_PACKAGES_DIR}/debug/${arg_CONFIG_PATH}) + set(RELEASE_CONFIG ${CURRENT_PACKAGES_DIR}/${arg_CONFIG_PATH}) + if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") + if(NOT EXISTS ${DEBUG_CONFIG}) + message(FATAL_ERROR "'${DEBUG_CONFIG}' does not exist.") + endif() + + # This roundabout handling enables CONFIG_PATH share + file(MAKE_DIRECTORY ${DEBUG_SHARE}) + file(GLOB FILES ${DEBUG_CONFIG}/*) + file(COPY ${FILES} DESTINATION ${DEBUG_SHARE}) + file(REMOVE_RECURSE ${DEBUG_CONFIG}) + endif() + + file(GLOB FILES ${RELEASE_CONFIG}/*) + file(COPY ${FILES} DESTINATION ${RELEASE_SHARE}) + file(REMOVE_RECURSE ${RELEASE_CONFIG}) + + if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") + get_filename_component(DEBUG_CONFIG_DIR_NAME ${DEBUG_CONFIG} NAME) + string(TOLOWER "${DEBUG_CONFIG_DIR_NAME}" DEBUG_CONFIG_DIR_NAME) + if(DEBUG_CONFIG_DIR_NAME STREQUAL "cmake" AND NOT arg_DO_NOT_DELETE_PARENT_CONFIG_PATH) + file(REMOVE_RECURSE ${DEBUG_CONFIG}) + else() + get_filename_component(DEBUG_CONFIG_PARENT_DIR ${DEBUG_CONFIG} DIRECTORY) + get_filename_component(DEBUG_CONFIG_DIR_NAME ${DEBUG_CONFIG_PARENT_DIR} NAME) + string(TOLOWER "${DEBUG_CONFIG_DIR_NAME}" DEBUG_CONFIG_DIR_NAME) + if(DEBUG_CONFIG_DIR_NAME STREQUAL "cmake" AND NOT arg_DO_NOT_DELETE_PARENT_CONFIG_PATH) + file(REMOVE_RECURSE ${DEBUG_CONFIG_PARENT_DIR}) + endif() + endif() + endif() + + get_filename_component(RELEASE_CONFIG_DIR_NAME ${RELEASE_CONFIG} NAME) + string(TOLOWER "${RELEASE_CONFIG_DIR_NAME}" RELEASE_CONFIG_DIR_NAME) + if(RELEASE_CONFIG_DIR_NAME STREQUAL "cmake" AND NOT arg_DO_NOT_DELETE_PARENT_CONFIG_PATH) + file(REMOVE_RECURSE ${RELEASE_CONFIG}) + else() + get_filename_component(RELEASE_CONFIG_PARENT_DIR ${RELEASE_CONFIG} DIRECTORY) + get_filename_component(RELEASE_CONFIG_DIR_NAME ${RELEASE_CONFIG_PARENT_DIR} NAME) + string(TOLOWER "${RELEASE_CONFIG_DIR_NAME}" RELEASE_CONFIG_DIR_NAME) + if(RELEASE_CONFIG_DIR_NAME STREQUAL "cmake" AND NOT arg_DO_NOT_DELETE_PARENT_CONFIG_PATH) + file(REMOVE_RECURSE ${RELEASE_CONFIG_PARENT_DIR}) + endif() + endif() + endif() + + if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") + if(NOT EXISTS "${DEBUG_SHARE}") + message(FATAL_ERROR "'${DEBUG_SHARE}' does not exist.") + endif() + endif() + + file(GLOB_RECURSE UNUSED_FILES + "${DEBUG_SHARE}/*[Tt]argets.cmake" + "${DEBUG_SHARE}/*[Cc]onfig.cmake" + "${DEBUG_SHARE}/*[Cc]onfigVersion.cmake" + "${DEBUG_SHARE}/*[Cc]onfig-version.cmake" + ) + if(UNUSED_FILES) + file(REMOVE ${UNUSED_FILES}) + endif() + + file(GLOB_RECURSE RELEASE_TARGETS + "${RELEASE_SHARE}/*-release.cmake" + ) + foreach(RELEASE_TARGET IN LISTS RELEASE_TARGETS) + file(READ ${RELEASE_TARGET} _contents) + string(REPLACE "${CURRENT_INSTALLED_DIR}" "\${_IMPORT_PREFIX}" _contents "${_contents}") + string(REGEX REPLACE "\\\${_IMPORT_PREFIX}/bin/([^ \"]+${EXECUTABLE_SUFFIX})" "\${_IMPORT_PREFIX}/${arg_TOOLS_PATH}/\\1" _contents "${_contents}") + file(WRITE ${RELEASE_TARGET} "${_contents}") + endforeach() + + if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") + file(GLOB_RECURSE DEBUG_TARGETS + "${DEBUG_SHARE}/*-debug.cmake" + ) + foreach(DEBUG_TARGET IN LISTS DEBUG_TARGETS) + file(RELATIVE_PATH DEBUG_TARGET_REL "${DEBUG_SHARE}" "${DEBUG_TARGET}") + + file(READ ${DEBUG_TARGET} _contents) + string(REPLACE "${CURRENT_INSTALLED_DIR}" "\${_IMPORT_PREFIX}" _contents "${_contents}") + string(REGEX REPLACE "\\\${_IMPORT_PREFIX}/bin/([^ \";]+${EXECUTABLE_SUFFIX})" "\${_IMPORT_PREFIX}/${arg_TOOLS_PATH}/\\1" _contents "${_contents}") + string(REPLACE "\${_IMPORT_PREFIX}/lib" "\${_IMPORT_PREFIX}/debug/lib" _contents "${_contents}") + string(REPLACE "\${_IMPORT_PREFIX}/bin" "\${_IMPORT_PREFIX}/debug/bin" _contents "${_contents}") + file(WRITE ${RELEASE_SHARE}/${DEBUG_TARGET_REL} "${_contents}") + + file(REMOVE ${DEBUG_TARGET}) + endforeach() + endif() + + #Fix ${_IMPORT_PREFIX} in cmake generated targets and configs; + #Since those can be renamed we have to check in every *.cmake + file(GLOB_RECURSE MAIN_CMAKES "${RELEASE_SHARE}/*.cmake") + + foreach(MAIN_CMAKE IN LISTS MAIN_CMAKES) + file(READ ${MAIN_CMAKE} _contents) + #This correction is not correct for all cases. To make it correct for all cases it needs to consider + #original folder deepness to CURRENT_PACKAGES_DIR in comparison to the moved to folder deepness which + #is always at least (>=) 2, e.g. share/${PORT}. Currently the code assumes it is always 2 although + #this requirement is only true for the *Config.cmake. The targets are not required to be in the same + #folder as the *Config.cmake! + if(NOT arg_NO_PREFIX_CORRECTION) + string(REGEX REPLACE + "get_filename_component\\(_IMPORT_PREFIX \"\\\${CMAKE_CURRENT_LIST_FILE}\" PATH\\)(\nget_filename_component\\(_IMPORT_PREFIX \"\\\${_IMPORT_PREFIX}\" PATH\\))*" + "get_filename_component(_IMPORT_PREFIX \"\${CMAKE_CURRENT_LIST_FILE}\" PATH)\nget_filename_component(_IMPORT_PREFIX \"\${_IMPORT_PREFIX}\" PATH)\nget_filename_component(_IMPORT_PREFIX \"\${_IMPORT_PREFIX}\" PATH)" + _contents "${_contents}") # see #1044 for details why this replacement is necessary. See #4782 why it must be a regex. + string(REGEX REPLACE + "get_filename_component\\(PACKAGE_PREFIX_DIR \"\\\${CMAKE_CURRENT_LIST_DIR}/\\.\\./(\\.\\./)*\" ABSOLUTE\\)" + "get_filename_component(PACKAGE_PREFIX_DIR \"\${CMAKE_CURRENT_LIST_DIR}/../../\" ABSOLUTE)" + _contents "${_contents}") + string(REGEX REPLACE + "get_filename_component\\(PACKAGE_PREFIX_DIR \"\\\${CMAKE_CURRENT_LIST_DIR}/\\.\\.((\\\\|/)\\.\\.)*\" ABSOLUTE\\)" + "get_filename_component(PACKAGE_PREFIX_DIR \"\${CMAKE_CURRENT_LIST_DIR}/../../\" ABSOLUTE)" + _contents "${_contents}") # This is a meson-related workaround, see https://github.com/mesonbuild/meson/issues/6955 + endif() + + #Fix wrongly absolute paths to install dir with the correct dir using ${_IMPORT_PREFIX} + #This happens if vcpkg built libraries are directly linked to a target instead of using + #an imported target for it. We could add more logic here to identify defect target files. + #Since the replacement here in a multi config build always requires a generator expression + #in front of the absoulte path to ${CURRENT_INSTALLED_DIR}. So the match should always be at + #least >:${CURRENT_INSTALLED_DIR}. + #In general the following generator expressions should be there: + #\$<\$<CONFIG:DEBUG>:${CURRENT_INSTALLED_DIR}/debug/lib/somelib> + #and/or + #\$<\$<NOT:\$<CONFIG:DEBUG>>:${CURRENT_INSTALLED_DIR}/lib/somelib> + #with ${CURRENT_INSTALLED_DIR} being fully expanded + string(REPLACE "${CURRENT_INSTALLED_DIR}" [[${_IMPORT_PREFIX}]] _contents "${_contents}") + file(WRITE ${MAIN_CMAKE} "${_contents}") + endforeach() + + # Remove /debug/<target_path>/ if it's empty. + file(GLOB_RECURSE REMAINING_FILES "${DEBUG_SHARE}/*") + if(NOT REMAINING_FILES) + file(REMOVE_RECURSE ${DEBUG_SHARE}) + endif() + + # Remove /debug/share/ if it's empty. + file(GLOB_RECURSE REMAINING_FILES "${CURRENT_PACKAGES_DIR}/debug/share/*") + if(NOT REMAINING_FILES) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) + endif() + + # Patch out any remaining absolute references + file(TO_CMAKE_PATH "${CURRENT_PACKAGES_DIR}" CMAKE_CURRENT_PACKAGES_DIR) + file(GLOB CMAKE_FILES ${RELEASE_SHARE}/*.cmake) + foreach(CMAKE_FILE IN LISTS CMAKE_FILES) + file(READ ${CMAKE_FILE} _contents) + string(REPLACE "${CMAKE_CURRENT_PACKAGES_DIR}" "\${CMAKE_CURRENT_LIST_DIR}/../.." _contents "${_contents}") + file(WRITE ${CMAKE_FILE} "${_contents}") + endforeach() +endfunction() + + diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_fixup_pkgconfig.cmake b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_fixup_pkgconfig.cmake new file mode 100644 index 000000000..a629ac8c9 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_fixup_pkgconfig.cmake @@ -0,0 +1,191 @@ +#[===[.md: +# vcpkg_fixup_pkgconfig + +Fix common paths in *.pc files and make everything relative to $(prefix) + +## Usage +```cmake +vcpkg_fixup_pkgconfig( + [RELEASE_FILES <PATHS>...] + [DEBUG_FILES <PATHS>...] + [SKIP_CHECK] +) +``` + +## Parameters +### RELEASE_FILES +Specifies a list of files to apply the fixes for release paths. +Defaults to every *.pc file in the folder ${CURRENT_PACKAGES_DIR} without ${CURRENT_PACKAGES_DIR}/debug/ + +### DEBUG_FILES +Specifies a list of files to apply the fixes for debug paths. +Defaults to every *.pc file in the folder ${CURRENT_PACKAGES_DIR}/debug/ + +### SKIP_CHECK +Skips the library checks in vcpkg_fixup_pkgconfig. Only use if the script itself has unhandled cases. + +### SYSTEM_PACKAGES (deprecated) +This argument has been deprecated and has no effect. + +### SYSTEM_LIBRARIES (deprecated) +This argument has been deprecated and has no effect. + +### IGNORE_FLAGS (deprecated) +This argument has been deprecated and has no effect. + +## Notes +Still work in progress. If there are more cases which can be handled here feel free to add them + +## Examples + +* [brotli](https://github.com/Microsoft/vcpkg/blob/master/ports/brotli/portfile.cmake) +#]===] + +function(vcpkg_fixup_pkgconfig_check_files pkg_cfg_cmd _file _config) + set(PATH_SUFFIX_DEBUG /debug) + set(PATH_SUFFIX_RELEASE) + set(PKGCONFIG_INSTALLED_DIR "${CURRENT_INSTALLED_DIR}${PATH_SUFFIX_${_config}}/lib/pkgconfig") + set(PKGCONFIG_INSTALLED_SHARE_DIR "${CURRENT_INSTALLED_DIR}/share/pkgconfig") + set(PKGCONFIG_PACKAGES_DIR "${CURRENT_PACKAGES_DIR}${PATH_SUFFIX_${_config}}/lib/pkgconfig") + set(PKGCONFIG_PACKAGES_SHARE_DIR "${CURRENT_PACKAGES_DIR}/share/pkgconfig") + + if(DEFINED ENV{PKG_CONFIG_PATH}) + set(BACKUP_ENV_PKG_CONFIG_PATH "$ENV{PKG_CONFIG_PATH}") + else() + unset(BACKUP_ENV_PKG_CONFIG_PATH) + endif() + if(DEFINED ENV{PKG_CONFIG_PATH} AND NOT ENV{PKG_CONFIG_PATH} STREQUAL "") + set(ENV{PKG_CONFIG_PATH} "${PKGCONFIG_INSTALLED_DIR}${VCPKG_HOST_PATH_SEPARATOR}${PKGCONFIG_INSTALLED_SHARE_DIR}${VCPKG_HOST_PATH_SEPARATOR}${PKGCONFIG_PACKAGES_DIR}${VCPKG_HOST_PATH_SEPARATOR}${PKGCONFIG_PACKAGES_SHARE_DIR}${VCPKG_HOST_PATH_SEPARATOR}$ENV{PKG_CONFIG_PATH}") + else() + set(ENV{PKG_CONFIG_PATH} "${PKGCONFIG_INSTALLED_DIR}${VCPKG_HOST_PATH_SEPARATOR}${PKGCONFIG_INSTALLED_SHARE_DIR}${VCPKG_HOST_PATH_SEPARATOR}${PKGCONFIG_PACKAGES_DIR}${VCPKG_HOST_PATH_SEPARATOR}${PKGCONFIG_PACKAGES_SHARE_DIR}") + endif() + + # First make sure everything is ok with the package and its deps + get_filename_component(_package_name "${_file}" NAME_WLE) + debug_message("Checking package (${_config}): ${_package_name}") + execute_process(COMMAND "${pkg_cfg_cmd}" --print-errors --exists ${_package_name} + WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}" + RESULT_VARIABLE _pkg_error_var + OUTPUT_VARIABLE _pkg_output + ERROR_VARIABLE _pkg_error_out + OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_STRIP_TRAILING_WHITESPACE + ) + if(NOT _pkg_error_var EQUAL 0) + message(STATUS "pkg_cfg_cmd call with:${pkg_cfg_cmd} --exists ${_package_name} failed") + message(STATUS "ENV{PKG_CONFIG_PATH}:$ENV{PKG_CONFIG_PATH}") + message(STATUS "pkg-config call failed with error code:${_pkg_error_var}") + message(STATUS "pkg-config output:${_pkg_output}") + message(FATAL_ERROR "pkg-config error output:${_pkg_error_out}") + else() + debug_message("pkg-config returned:${_pkg_error_var}") + debug_message("pkg-config output:${_pkg_output}") + debug_message("pkg-config error output:${_pkg_error_out}") + endif() + if(DEFINED BACKUP_ENV_PKG_CONFIG_PATH) + set(ENV{PKG_CONFIG_PATH} "${BACKUP_ENV_PKG_CONFIG_PATH}") + else() + unset(ENV{PKG_CONFIG_PATH}) + endif() +endfunction() + +function(vcpkg_fixup_pkgconfig) + # parse parameters such that semicolons in options arguments to COMMAND don't get erased + cmake_parse_arguments(PARSE_ARGV 0 _vfpkg "SKIP_CHECK" "" "RELEASE_FILES;DEBUG_FILES;SYSTEM_LIBRARIES;SYSTEM_PACKAGES;IGNORE_FLAGS") + + if(_vfpkg_UNPARSED_ARGUMENTS) + message(FATAL_ERROR "vcpkg_fixup_pkgconfig() was passed extra arguments: ${_vfct_UNPARSED_ARGUMENTS}") + endif() + + if((DEFINED _vfpkg_RELEASE_FILES AND NOT DEFINED _vfpkg_DEBUG_FILES) OR (NOT DEFINED _vfpkg_RELEASE_FILES AND DEFINED _vfpkg_DEBUG_FILES)) + message(FATAL_ERROR "vcpkg_fixup_pkgconfig() requires both or neither of DEBUG_FILES and RELEASE_FILES") + endif() + + if(NOT DEFINED _vfpkg_RELEASE_FILES) + file(GLOB_RECURSE _vfpkg_RELEASE_FILES "${CURRENT_PACKAGES_DIR}/**/*.pc") + file(GLOB_RECURSE _vfpkg_DEBUG_FILES "${CURRENT_PACKAGES_DIR}/debug/**/*.pc") + if(_vfpkg_DEBUG_FILES) + list(REMOVE_ITEM _vfpkg_RELEASE_FILES ${_vfpkg_DEBUG_FILES}) + endif() + endif() + + vcpkg_find_acquire_program(PKGCONFIG) + debug_message("Using pkg-config from: ${PKGCONFIG}") + + #Absolute Unix like paths + string(REGEX REPLACE "([a-zA-Z]):/" "/\\1/" _VCPKG_PACKAGES_DIR "${CURRENT_PACKAGES_DIR}") + string(REGEX REPLACE "([a-zA-Z]):/" "/\\1/" _VCPKG_INSTALLED_DIR "${CURRENT_INSTALLED_DIR}") + + foreach(CONFIG RELEASE DEBUG) + debug_message("${CONFIG} Files: ${_vfpkg_${CONFIG}_FILES}") + if(VCPKG_BUILD_TYPE STREQUAL "debug" AND CONFIG STREQUAL "RELEASE") + continue() + endif() + if(VCPKG_BUILD_TYPE STREQUAL "release" AND CONFIG STREQUAL "DEBUG") + continue() + endif() + foreach(_file ${_vfpkg_${CONFIG}_FILES}) + message(STATUS "Fixing pkgconfig file: ${_file}") + get_filename_component(PKG_LIB_SEARCH_PATH "${_file}" DIRECTORY) + if(CONFIG STREQUAL "DEBUG") + file(RELATIVE_PATH RELATIVE_PC_PATH "${PKG_LIB_SEARCH_PATH}" "${CURRENT_PACKAGES_DIR}/debug/") + else() + file(RELATIVE_PATH RELATIVE_PC_PATH "${PKG_LIB_SEARCH_PATH}" "${CURRENT_PACKAGES_DIR}") + endif() + # strip trailing slash + string(REGEX REPLACE "/$" "" RELATIVE_PC_PATH "${RELATIVE_PC_PATH}") + #Correct *.pc file + file(READ "${_file}" _contents) + string(REPLACE "${CURRENT_PACKAGES_DIR}" "\${prefix}" _contents "${_contents}") + string(REPLACE "${CURRENT_INSTALLED_DIR}" "\${prefix}" _contents "${_contents}") + string(REPLACE "${_VCPKG_PACKAGES_DIR}" "\${prefix}" _contents "${_contents}") + string(REPLACE "${_VCPKG_INSTALLED_DIR}" "\${prefix}" _contents "${_contents}") + string(REGEX REPLACE "(^|\n)prefix[\t ]*=[^\n]*" "" _contents "${_contents}") + if(CONFIG STREQUAL "DEBUG") + string(REPLACE "}/debug" "}" _contents "${_contents}") + # Prefix points at the debug subfolder + string(REPLACE "\${prefix}/include" "\${prefix}/../include" _contents "${_contents}") + string(REPLACE "\${prefix}/share" "\${prefix}/../share" _contents "${_contents}") + endif() + string(REGEX REPLACE " -L(\\\${[^}]*}[^ \n\t]*)" " -L\"\\1\"" _contents "${_contents}") + string(REGEX REPLACE " -I(\\\${[^}]*}[^ \n\t]*)" " -I\"\\1\"" _contents "${_contents}") + string(REGEX REPLACE " -l(\\\${[^}]*}[^ \n\t]*)" " -l\"\\1\"" _contents "${_contents}") + # This section fuses XYZ.private and XYZ according to VCPKG_LIBRARY_LINKAGE + # + # Pkgconfig searches Requires.private transitively for Cflags in the dynamic case, + # which prevents us from removing it. + # + # Once this transformation is complete, users of vcpkg should never need to pass + # --static. + if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + # Libs comes before Libs.private + string(REGEX REPLACE "(^|\n)(Libs: [^\n]*)(.*)\nLibs.private:( [^\n]*)" "\\1\\2\\4\\3" _contents "${_contents}") + # Libs.private comes before Libs + string(REGEX REPLACE "(^|\n)Libs.private:( [^\n]*)(.*\nLibs: [^\n]*)" "\\3\\2" _contents "${_contents}") + # Only Libs.private + string(REGEX REPLACE "(^|\n)Libs.private: " "\\1Libs: " _contents "${_contents}") + # Requires comes before Requires.private + string(REGEX REPLACE "(^|\n)(Requires: [^\n]*)(.*)\nRequires.private:( [^\n]*)" "\\1\\2\\4\\3" _contents "${_contents}") + # Requires.private comes before Requires + string(REGEX REPLACE "(^|\n)Requires.private:( [^\n]*)(.*\nRequires: [^\n]*)" "\\3\\2" _contents "${_contents}") + # Only Requires.private + string(REGEX REPLACE "(^|\n)Requires.private: " "\\1Requires: " _contents "${_contents}") + endif() + file(WRITE "${_file}" "prefix=\${pcfiledir}/${RELATIVE_PC_PATH}\n${_contents}") + unset(PKG_LIB_SEARCH_PATH) + endforeach() + + if(NOT _vfpkg_SKIP_CHECK) # The check can only run after all files have been corrected! + foreach(_file ${_vfpkg_${CONFIG}_FILES}) + vcpkg_fixup_pkgconfig_check_files("${PKGCONFIG}" "${_file}" "${CONFIG}") + endforeach() + endif() + endforeach() + debug_message("Fixing pkgconfig --- finished") + + set(VCPKG_FIXUP_PKGCONFIG_CALLED TRUE CACHE INTERNAL "See below" FORCE) + # Variable to check if this function has been called! + # Theoreotically vcpkg could look for *.pc files and automatically call this function + # or check if this function has been called if *.pc files are detected. + # The same is true for vcpkg_fixup_cmake_targets +endfunction() diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_from_bitbucket.cmake b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_from_bitbucket.cmake new file mode 100644 index 000000000..a376e8105 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_from_bitbucket.cmake @@ -0,0 +1,201 @@ +#[===[.md: +# vcpkg_from_bitbucket + +Download and extract a project from Bitbucket. +Enables support for installing HEAD `vcpkg.exe install --head <port>`. + +## Usage: +```cmake +vcpkg_from_bitbucket( + OUT_SOURCE_PATH <SOURCE_PATH> + REPO <Microsoft/cpprestsdk> + [REF <v2.0.0>] + [SHA512 <45d0d7f8cc350...>] + [HEAD_REF <master>] + [PATCHES <patch1.patch> <patch2.patch>...] +) +``` + +## Parameters: +### OUT_SOURCE_PATH +Specifies the out-variable that will contain the extracted location. + +This should be set to `SOURCE_PATH` by convention. + +### REPO +The organization or user and repository on GitHub. + +### REF +A stable git commit-ish (ideally a tag) that will not change contents. **This should not be a branch.** + +For repositories without official releases, this can be set to the full commit id of the current latest master. + +If `REF` is specified, `SHA512` must also be specified. + +### SHA512 +The SHA512 hash that should match the archive (https://bitbucket.com/${REPO}/get/${REF}.tar.gz). + +This is most easily determined by first setting it to `1`, then trying to build the port. The error message will contain the full hash, which can be copied back into the portfile. + +### HEAD_REF +The unstable git commit-ish (ideally a branch) to pull for `--head` builds. + +For most projects, this should be `master`. The chosen branch should be one that is expected to be always buildable on all supported platforms. + +### PATCHES +A list of patches to be applied to the extracted sources. + +Relative paths are based on the port directory. + +## Notes: +At least one of `REF` and `HEAD_REF` must be specified, however it is preferable for both to be present. + +This exports the `VCPKG_HEAD_VERSION` variable during head builds. + +## Examples: + +* [blaze](https://github.com/Microsoft/vcpkg/blob/master/ports/blaze/portfile.cmake) +#]===] + +function(vcpkg_from_bitbucket) + set(oneValueArgs OUT_SOURCE_PATH REPO REF SHA512 HEAD_REF) + set(multipleValuesArgs PATCHES) + # parse parameters such that semicolons in options arguments to COMMAND don't get erased + cmake_parse_arguments(PARSE_ARGV 0 _vdud "" "${oneValueArgs}" "${multipleValuesArgs}") + + if(NOT _vdud_OUT_SOURCE_PATH) + message(FATAL_ERROR "OUT_SOURCE_PATH must be specified.") + endif() + + if((_vdud_REF AND NOT _vdud_SHA512) OR (NOT _vdud_REF AND _vdud_SHA512)) + message(FATAL_ERROR "SHA512 must be specified if REF is specified.") + endif() + + if(NOT _vdud_REPO) + message(FATAL_ERROR "The Bitbucket repository must be specified.") + endif() + + if(NOT _vdud_REF AND NOT _vdud_HEAD_REF) + message(FATAL_ERROR "At least one of REF and HEAD_REF must be specified.") + endif() + + string(REGEX REPLACE ".*/" "" REPO_NAME ${_vdud_REPO}) + string(REGEX REPLACE "/.*" "" ORG_NAME ${_vdud_REPO}) + + macro(set_SOURCE_PATH BASE BASEREF) + set(SOURCE_PATH "${BASE}/${ORG_NAME}-${REPO_NAME}-${BASEREF}") + if(EXISTS ${SOURCE_PATH}) + set(${_vdud_OUT_SOURCE_PATH} "${SOURCE_PATH}" PARENT_SCOPE) + else() + # Sometimes GitHub strips a leading 'v' off the REF. + string(REGEX REPLACE "^v" "" REF ${BASEREF}) + set(SOURCE_PATH "${BASE}/${ORG_NAME}-${REPO_NAME}-${REF}") + if(EXISTS ${SOURCE_PATH}) + set(${_vdud_OUT_SOURCE_PATH} "${SOURCE_PATH}" PARENT_SCOPE) + else() + message(FATAL_ERROR "Could not determine source path: '${BASE}/${ORG_NAME}-${REPO_NAME}-${BASEREF}' does not exist") + endif() + endif() + endmacro() + + if(VCPKG_USE_HEAD_VERSION AND NOT _vdud_HEAD_REF) + message(STATUS "Package does not specify HEAD_REF. Falling back to non-HEAD version.") + set(VCPKG_USE_HEAD_VERSION OFF) + endif() + + # Handle --no-head scenarios + if(NOT VCPKG_USE_HEAD_VERSION) + if(NOT _vdud_REF) + message(FATAL_ERROR "Package does not specify REF. It must built using --head.") + endif() + + set(URL "https://bitbucket.com/${ORG_NAME}/${REPO_NAME}/get/${_vdud_REF}.tar.gz") + set(downloaded_file_path "${DOWNLOADS}/${ORG_NAME}-${REPO_NAME}-${_vdud_REF}.tar.gz") + + file(DOWNLOAD "https://api.bitbucket.com/2.0/repositories/${ORG_NAME}/${REPO_NAME}/refs/tags/${_vdud_REF}" + ${downloaded_file_path}.version + STATUS download_status + ) + list(GET download_status 0 status_code) + if ("${status_code}" STREQUAL "0") + # Parse the github refs response with regex. + # TODO: use some JSON swiss-army-knife utility instead. + file(READ "${downloaded_file_path}.version" _contents) + string(REGEX MATCH "\"hash\": \"[a-f0-9]+\"" x "${_contents}") + string(REGEX REPLACE "\"hash\": \"([a-f0-9]+)\"" "\\1" _version ${x}) + string(SUBSTRING ${_version} 0 12 _version) # Get the 12 first numbers from commit hash + else() + string(SUBSTRING ${_vdud_REF} 0 12 _version) # Get the 12 first numbers from commit hash + endif() + + vcpkg_download_distfile(ARCHIVE + URLS "https://bitbucket.com/${ORG_NAME}/${REPO_NAME}/get/${_vdud_REF}.tar.gz" + SHA512 "${_vdud_SHA512}" + FILENAME "${ORG_NAME}-${REPO_NAME}-${_vdud_REF}.tar.gz" + ) + + vcpkg_extract_source_archive_ex( + OUT_SOURCE_PATH SOURCE_PATH + ARCHIVE "${ARCHIVE}" + REF "${_vdud_REF}" + PATCHES ${_vdud_PATCHES} + ) + set(${_vdud_OUT_SOURCE_PATH} "${SOURCE_PATH}" PARENT_SCOPE) + return() + endif() + + # The following is for --head scenarios + set(URL "https://bitbucket.com/${ORG_NAME}/${REPO_NAME}/get/${_vdud_HEAD_REF}.tar.gz") + set(downloaded_file_name "${ORG_NAME}-${REPO_NAME}-${_vdud_HEAD_REF}.tar.gz") + set(downloaded_file_path "${DOWNLOADS}/${downloaded_file_name}") + + if(_VCPKG_NO_DOWNLOADS) + if(NOT EXISTS ${downloaded_file_path} OR NOT EXISTS ${downloaded_file_path}.version) + message(FATAL_ERROR "Downloads are disabled, but '${downloaded_file_path}' does not exist.") + endif() + message(STATUS "Using cached ${downloaded_file_path}") + else() + if(EXISTS ${downloaded_file_path}) + message(STATUS "Purging cached ${downloaded_file_path} to fetch latest (use --no-downloads to suppress)") + file(REMOVE ${downloaded_file_path}) + endif() + if(EXISTS ${downloaded_file_path}.version) + file(REMOVE ${downloaded_file_path}.version) + endif() + if(EXISTS ${CURRENT_BUILDTREES_DIR}/src/head) + file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/src/head) + endif() + + # Try to download the file and version information from bitbucket. + vcpkg_download_distfile(ARCHIVE_VERSION + URLS "https://api.bitbucket.com/2.0/repositories/${ORG_NAME}/${REPO_NAME}/refs/branches/${_vdud_HEAD_REF}" + FILENAME "${downloaded_file_name}.version" + SKIP_SHA512 + ) + + vcpkg_download_distfile(ARCHIVE + URLS "${URL}" + FILENAME "${downloaded_file_name}" + SKIP_SHA512 + ) + endif() + + # Parse the github refs response with regex. + # TODO: use some JSON swiss-army-knife utility instead. + file(READ "${ARCHIVE_VERSION}" _contents) + string(REGEX MATCH "\"hash\": \"[a-f0-9]+\"" x "${_contents}") + string(REGEX REPLACE "\"hash\": \"([a-f0-9]+)\"" "\\1" _version ${x}) + string(SUBSTRING ${_version} 0 12 _vdud_HEAD_REF) # Get the 12 first numbers from commit hash + + # exports VCPKG_HEAD_VERSION to the caller. This will get picked up by ports.cmake after the build. + set(VCPKG_HEAD_VERSION ${_version} PARENT_SCOPE) + + vcpkg_extract_source_archive_ex( + OUT_SOURCE_PATH SOURCE_PATH + ARCHIVE "${downloaded_file_path}" + REF "${_vdud_HEAD_REF}" + WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/src/head" + PATCHES ${_vdud_PATCHES} + ) + set(${_vdud_OUT_SOURCE_PATH} "${SOURCE_PATH}" PARENT_SCOPE) +endfunction() diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_from_git.cmake b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_from_git.cmake new file mode 100644 index 000000000..d2055f82e --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_from_git.cmake @@ -0,0 +1,141 @@ +#[===[.md: +# vcpkg_from_git + +Download and extract a project from git + +## Usage: +```cmake +vcpkg_from_git( + OUT_SOURCE_PATH <SOURCE_PATH> + URL <https://android.googlesource.com/platform/external/fdlibm> + REF <59f7335e4d...> + [TAG <v1.0.2>] + [PATCHES <patch1.patch> <patch2.patch>...] +) +``` + +## Parameters: +### OUT_SOURCE_PATH +Specifies the out-variable that will contain the extracted location. + +This should be set to `SOURCE_PATH` by convention. + +### URL +The url of the git repository. + +### REF +The git sha of the commit to download. + +### TAG +An optional git tag to be verified against the `REF`. If the remote repository's tag does not match the specified `REF`, the build will fail. + +### PATCHES +A list of patches to be applied to the extracted sources. + +Relative paths are based on the port directory. + +### X_OUT_REF (internal only) +This parameter is used for automatic REF updates for certain ports in the central vcpkg catalog. It should not be used by any ports outside the central catalog and within the central catalog it should not be used on any user path. This parameter may change behavior incompatibly or be removed at any time. + +## Notes: +`OUT_SOURCE_PATH`, `REF`, and `URL` must be specified. + +## Examples: + +* [fdlibm](https://github.com/Microsoft/vcpkg/blob/master/ports/fdlibm/portfile.cmake) +#]===] + +include(vcpkg_execute_in_download_mode) + +function(vcpkg_from_git) + set(oneValueArgs OUT_SOURCE_PATH URL REF TAG X_OUT_REF) + set(multipleValuesArgs PATCHES) + # parse parameters such that semicolons in options arguments to COMMAND don't get erased + cmake_parse_arguments(PARSE_ARGV 0 _vdud "" "${oneValueArgs}" "${multipleValuesArgs}") + + if(NOT DEFINED _vdud_OUT_SOURCE_PATH) + message(FATAL_ERROR "OUT_SOURCE_PATH must be specified.") + endif() + + if(NOT DEFINED _vdud_URL) + message(FATAL_ERROR "The git url must be specified") + endif() + + if(NOT DEFINED _vdud_REF) + message(FATAL_ERROR "The git ref must be specified.") + endif() + + if(NOT DEFINED _vdud_TAG) + set(_vdud_TAG ${_vdud_REF}) + endif() + + # using .tar.gz instead of .zip because the hash of the latter is affected by timezone. + string(REPLACE "/" "-" SANITIZED_REF "${_vdud_TAG}") + set(TEMP_ARCHIVE "${DOWNLOADS}/temp/${PORT}-${SANITIZED_REF}.tar.gz") + set(ARCHIVE "${DOWNLOADS}/${PORT}-${SANITIZED_REF}.tar.gz") + set(TEMP_SOURCE_PATH "${CURRENT_BUILDTREES_DIR}/src/${SANITIZED_REF}") + + if(NOT EXISTS "${ARCHIVE}") + if(_VCPKG_NO_DOWNLOADS) + message(FATAL_ERROR "Downloads are disabled, but '${ARCHIVE}' does not exist.") + endif() + message(STATUS "Fetching ${_vdud_URL}...") + find_program(GIT NAMES git git.cmd) + # Note: git init is safe to run multiple times + vcpkg_execute_required_process( + ALLOW_IN_DOWNLOAD_MODE + COMMAND ${GIT} init git-tmp + WORKING_DIRECTORY ${DOWNLOADS} + LOGNAME git-init-${TARGET_TRIPLET} + ) + vcpkg_execute_required_process( + ALLOW_IN_DOWNLOAD_MODE + COMMAND ${GIT} fetch ${_vdud_URL} ${_vdud_TAG} --depth 1 -n + WORKING_DIRECTORY ${DOWNLOADS}/git-tmp + LOGNAME git-fetch-${TARGET_TRIPLET} + ) + vcpkg_execute_in_download_mode( + COMMAND ${GIT} rev-parse FETCH_HEAD + OUTPUT_VARIABLE REV_PARSE_HEAD + ERROR_VARIABLE REV_PARSE_HEAD + RESULT_VARIABLE error_code + WORKING_DIRECTORY ${DOWNLOADS}/git-tmp + ) + if(error_code) + message(FATAL_ERROR "unable to determine FETCH_HEAD after fetching git repository") + endif() + string(REGEX REPLACE "\n$" "" REV_PARSE_HEAD "${REV_PARSE_HEAD}") + if(NOT REV_PARSE_HEAD STREQUAL _vdud_REF AND NOT DEFINED _vdud_X_OUT_REF) + message(STATUS "[Expected : ( ${_vdud_REF} )]") + message(STATUS "[ Actual : ( ${REV_PARSE_HEAD} )]") + message(FATAL_ERROR "REF (${_vdud_REF}) does not match FETCH_HEAD (${REV_PARSE_HEAD})") + elseif(DEFINED _vdud_X_OUT_REF) + set(${_vdud_X_OUT_REF} ${REV_PARSE_HEAD} PARENT_SCOPE) + return() + endif() + + file(MAKE_DIRECTORY "${DOWNLOADS}/temp") + vcpkg_execute_required_process( + ALLOW_IN_DOWNLOAD_MODE + COMMAND ${GIT} archive FETCH_HEAD -o "${TEMP_ARCHIVE}" + WORKING_DIRECTORY ${DOWNLOADS}/git-tmp + LOGNAME git-archive + ) + + get_filename_component(downloaded_file_dir "${ARCHIVE}" DIRECTORY) + file(MAKE_DIRECTORY "${downloaded_file_dir}") + file(RENAME "${TEMP_ARCHIVE}" "${ARCHIVE}") + else() + message(STATUS "Using cached ${ARCHIVE}") + endif() + + vcpkg_extract_source_archive_ex( + OUT_SOURCE_PATH SOURCE_PATH + ARCHIVE "${ARCHIVE}" + REF "${SANITIZED_REF}" + PATCHES ${_vdud_PATCHES} + NO_REMOVE_ONE_LEVEL + ) + + set(${_vdud_OUT_SOURCE_PATH} "${SOURCE_PATH}" PARENT_SCOPE) +endfunction() diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_from_github.cmake b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_from_github.cmake new file mode 100644 index 000000000..1c1b71679 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_from_github.cmake @@ -0,0 +1,231 @@ +#[===[.md: +# vcpkg_from_github + +Download and extract a project from GitHub. Enables support for `install --head`. + +## Usage: +```cmake +vcpkg_from_github( + OUT_SOURCE_PATH <SOURCE_PATH> + REPO <Microsoft/cpprestsdk> + [REF <v2.0.0>] + [SHA512 <45d0d7f8cc350...>] + [HEAD_REF <master>] + [PATCHES <patch1.patch> <patch2.patch>...] + [GITHUB_HOST <https://github.com>] + [AUTHORIZATION_TOKEN <${SECRET_FROM_FILE}>] + [FILE_DISAMBIGUATOR <N>] +) +``` + +## Parameters: +### OUT_SOURCE_PATH +Specifies the out-variable that will contain the extracted location. + +This should be set to `SOURCE_PATH` by convention. + +### REPO +The organization or user and repository on GitHub. + +### REF +A stable git commit-ish (ideally a tag or commit) that will not change contents. **This should not be a branch.** + +For repositories without official releases, this can be set to the full commit id of the current latest master. + +If `REF` is specified, `SHA512` must also be specified. + +### SHA512 +The SHA512 hash that should match the archive (https://github.com/${REPO}/archive/${REF}.tar.gz). + +This is most easily determined by first setting it to `1`, then trying to build the port. The error message will contain the full hash, which can be copied back into the portfile. + +### HEAD_REF +The unstable git commit-ish (ideally a branch) to pull for `--head` builds. + +For most projects, this should be `master`. The chosen branch should be one that is expected to be always buildable on all supported platforms. + +### PATCHES +A list of patches to be applied to the extracted sources. + +Relative paths are based on the port directory. + +### GITHUB_HOST +A replacement host for enterprise GitHub instances. + +This field should contain the scheme, host, and port of the desired URL without a trailing slash. + +### AUTHORIZATION_TOKEN +A token to be passed via the Authorization HTTP header as "token ${AUTHORIZATION_TOKEN}". + +### FILE_DISAMBIGUATOR +A token to uniquely identify the resulting filename if the SHA512 changes even though a git ref does not, to avoid stepping on the same file name. + +## Notes: +At least one of `REF` and `HEAD_REF` must be specified, however it is preferable for both to be present. + +This exports the `VCPKG_HEAD_VERSION` variable during head builds. + +## Examples: + +* [cpprestsdk](https://github.com/Microsoft/vcpkg/blob/master/ports/cpprestsdk/portfile.cmake) +* [ms-gsl](https://github.com/Microsoft/vcpkg/blob/master/ports/ms-gsl/portfile.cmake) +* [beast](https://github.com/Microsoft/vcpkg/blob/master/ports/beast/portfile.cmake) +#]===] + +function(vcpkg_from_github) + set(oneValueArgs OUT_SOURCE_PATH REPO REF SHA512 HEAD_REF GITHUB_HOST AUTHORIZATION_TOKEN FILE_DISAMBIGUATOR) + set(multipleValuesArgs PATCHES) + # parse parameters such that semicolons in options arguments to COMMAND don't get erased + cmake_parse_arguments(PARSE_ARGV 0 _vdud "" "${oneValueArgs}" "${multipleValuesArgs}") + + if(NOT DEFINED _vdud_OUT_SOURCE_PATH) + message(FATAL_ERROR "OUT_SOURCE_PATH must be specified.") + endif() + + if((DEFINED _vdud_REF AND NOT DEFINED _vdud_SHA512) OR (NOT DEFINED _vdud_REF AND DEFINED _vdud_SHA512)) + message(FATAL_ERROR "SHA512 must be specified if REF is specified.") + endif() + + if(NOT DEFINED _vdud_REPO) + message(FATAL_ERROR "The GitHub repository must be specified.") + endif() + + if(NOT DEFINED _vdud_REF AND NOT DEFINED _vdud_HEAD_REF) + message(FATAL_ERROR "At least one of REF and HEAD_REF must be specified.") + endif() + + if(NOT DEFINED _vdud_GITHUB_HOST) + set(GITHUB_HOST https://github.com) + set(GITHUB_API_URL https://api.github.com) + else() + set(GITHUB_HOST "${_vdud_GITHUB_HOST}") + set(GITHUB_API_URL "${_vdud_GITHUB_HOST}/api/v3") + endif() + + if(DEFINED _vdud_AUTHORIZATION_TOKEN) + set(HEADERS "HEADERS" "Authorization: token ${_vdud_AUTHORIZATION_TOKEN}") + else() + set(HEADERS) + endif() + + string(REGEX REPLACE ".*/" "" REPO_NAME "${_vdud_REPO}") + string(REGEX REPLACE "/.*" "" ORG_NAME "${_vdud_REPO}") + + macro(set_TEMP_SOURCE_PATH BASE BASEREF) + set(TEMP_SOURCE_PATH "${BASE}/${REPO_NAME}-${BASEREF}") + if(NOT EXISTS "${TEMP_SOURCE_PATH}") + # Sometimes GitHub strips a leading 'v' off the REF. + string(REGEX REPLACE "^v" "" REF "${BASEREF}") + string(REPLACE "/" "-" REF "${REF}") + set(TEMP_SOURCE_PATH "${BASE}/${REPO_NAME}-${REF}") + if(NOT EXISTS "${TEMP_SOURCE_PATH}") + message(FATAL_ERROR "Could not determine source path: '${BASE}/${REPO_NAME}-${BASEREF}' does not exist") + endif() + endif() + endmacro() + + if(VCPKG_USE_HEAD_VERSION AND NOT DEFINED _vdud_HEAD_REF) + message(STATUS "Package does not specify HEAD_REF. Falling back to non-HEAD version.") + set(VCPKG_USE_HEAD_VERSION OFF) + endif() + + # Handle --no-head scenarios + if(NOT VCPKG_USE_HEAD_VERSION) + if(NOT _vdud_REF) + message(FATAL_ERROR "Package does not specify REF. It must built using --head.") + endif() + + string(REPLACE "/" "-" SANITIZED_REF "${_vdud_REF}") + + set(downloaded_file_name "${ORG_NAME}-${REPO_NAME}-${SANITIZED_REF}") + if (_vdud_FILE_DISAMBIGUATOR) + set(downloaded_file_name "${downloaded_file_name}-${_vdud_FILE_DISAMBIGUATOR}") + endif() + + set(downloaded_file_name "${downloaded_file_name}.tar.gz") + + vcpkg_download_distfile(ARCHIVE + URLS "${GITHUB_HOST}/${ORG_NAME}/${REPO_NAME}/archive/${_vdud_REF}.tar.gz" + SHA512 "${_vdud_SHA512}" + FILENAME "${downloaded_file_name}" + ${HEADERS} + ) + + vcpkg_extract_source_archive_ex( + OUT_SOURCE_PATH SOURCE_PATH + ARCHIVE "${ARCHIVE}" + REF "${SANITIZED_REF}" + PATCHES ${_vdud_PATCHES} + ) + + set(${_vdud_OUT_SOURCE_PATH} "${SOURCE_PATH}" PARENT_SCOPE) + return() + endif() + + # The following is for --head scenarios + set(URL "${GITHUB_HOST}/${ORG_NAME}/${REPO_NAME}/archive/${_vdud_HEAD_REF}.tar.gz") + string(REPLACE "/" "-" SANITIZED_HEAD_REF "${_vdud_HEAD_REF}") + set(downloaded_file_name "${ORG_NAME}-${REPO_NAME}-${SANITIZED_HEAD_REF}") + if (_vdud_FILE_DISAMBIGUATOR) + set(downloaded_file_name "${downloaded_file_name}-${_vdud_FILE_DISAMBIGUATOR}") + endif() + + set(downloaded_file_name "${downloaded_file_name}.tar.gz") + + set(downloaded_file_path "${DOWNLOADS}/${downloaded_file_name}") + + if(_VCPKG_NO_DOWNLOADS) + if(NOT EXISTS "${downloaded_file_path}" OR NOT EXISTS "${downloaded_file_path}.version") + message(FATAL_ERROR "Downloads are disabled, but '${downloaded_file_path}' does not exist.") + endif() + message(STATUS "Using cached ${downloaded_file_path}") + else() + if(EXISTS "${downloaded_file_path}") + message(STATUS "Purging cached ${downloaded_file_path} to fetch latest (use --no-downloads to suppress)") + file(REMOVE "${downloaded_file_path}") + endif() + if(EXISTS "${downloaded_file_path}.version") + file(REMOVE "${downloaded_file_path}.version") + endif() + if(EXISTS "${CURRENT_BUILDTREES_DIR}/src/head") + file(REMOVE_RECURSE "${CURRENT_BUILDTREES_DIR}/src/head") + endif() + + # Try to download the file and version information from github. + vcpkg_download_distfile(ARCHIVE_VERSION + URLS "${GITHUB_API_URL}/repos/${ORG_NAME}/${REPO_NAME}/git/refs/heads/${_vdud_HEAD_REF}" + FILENAME "${downloaded_file_name}.version" + SKIP_SHA512 + ${HEADERS} + ) + + vcpkg_download_distfile(ARCHIVE + URLS ${URL} + FILENAME "${downloaded_file_name}" + SKIP_SHA512 + ${HEADERS} + ) + endif() + + # Parse the github refs response with regex. + # TODO: use some JSON swiss-army-knife utility instead. + file(READ "${downloaded_file_path}.version" _contents) + string(REGEX MATCH "\"sha\": \"[a-f0-9]+\"" x "${_contents}") + string(REGEX REPLACE "\"sha\": \"([a-f0-9]+)\"" "\\1" _version ${x}) + + # exports VCPKG_HEAD_VERSION to the caller. This will get picked up by ports.cmake after the build. + # When multiple vcpkg_from_github's are used after each other, only use the version from the first (hopefully the primary one). + if(NOT DEFINED VCPKG_HEAD_VERSION) + set(VCPKG_HEAD_VERSION "${_version}" PARENT_SCOPE) + endif() + + vcpkg_extract_source_archive_ex( + SKIP_PATCH_CHECK + OUT_SOURCE_PATH SOURCE_PATH + ARCHIVE "${downloaded_file_path}" + REF "${SANITIZED_HEAD_REF}" + WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/src/head" + PATCHES ${_vdud_PATCHES} + ) + set(${_vdud_OUT_SOURCE_PATH} "${SOURCE_PATH}" PARENT_SCOPE) +endfunction() diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_from_gitlab.cmake b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_from_gitlab.cmake new file mode 100644 index 000000000..865c5326e --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_from_gitlab.cmake @@ -0,0 +1,201 @@ +#[===[.md: +# vcpkg_from_gitlab + +Download and extract a project from Gitlab instances. Enables support for `install --head`. + +## Usage: +```cmake +vcpkg_from_gitlab( + GITLAB_URL <https://gitlab.com> + OUT_SOURCE_PATH <SOURCE_PATH> + REPO <gitlab-org/gitlab-ce> + [REF <v10.7.3>] + [SHA512 <45d0d7f8cc350...>] + [HEAD_REF <master>] + [PATCHES <patch1.patch> <patch2.patch>...] + [FILE_DISAMBIGUATOR <N>] +) +``` + +## Parameters: + +### GITLAB_URL +The URL of the Gitlab instance to use. + +### OUT_SOURCE_PATH +Specifies the out-variable that will contain the extracted location. + +This should be set to `SOURCE_PATH` by convention. + +### REPO +The organization or user plus the repository name on the Gitlab instance. + +### REF +A stable git commit-ish (ideally a tag) that will not change contents. **This should not be a branch.** + +For repositories without official releases, this can be set to the full commit id of the current latest master. + +If `REF` is specified, `SHA512` must also be specified. + +### SHA512 +The SHA512 hash that should match the archive (${GITLAB_URL}/${REPO}/-/archive/${REF}/${REPO_NAME}-${REF}.tar.gz). +The REPO_NAME variable is parsed from the value of REPO. + +This is most easily determined by first setting it to `1`, then trying to build the port. The error message will contain the full hash, which can be copied back into the portfile. + +### HEAD_REF +The unstable git commit-ish (ideally a branch) to pull for `--head` builds. + +For most projects, this should be `master`. The chosen branch should be one that is expected to be always buildable on all supported platforms. + +### PATCHES +A list of patches to be applied to the extracted sources. + +Relative paths are based on the port directory. + +### FILE_DISAMBIGUATOR +A token to uniquely identify the resulting filename if the SHA512 changes even though a git ref does not, to avoid stepping on the same file name. + +## Notes: +At least one of `REF` and `HEAD_REF` must be specified, however it is preferable for both to be present. + +This exports the `VCPKG_HEAD_VERSION` variable during head builds. + +## Examples: +* [curl][https://github.com/Microsoft/vcpkg/blob/master/ports/curl/portfile.cmake#L75] +* [folly](https://github.com/Microsoft/vcpkg/blob/master/ports/folly/portfile.cmake#L15) +* [z3](https://github.com/Microsoft/vcpkg/blob/master/ports/z3/portfile.cmake#L13) +#]===] + +include(vcpkg_execute_in_download_mode) + +function(vcpkg_from_gitlab) + set(oneValueArgs OUT_SOURCE_PATH GITLAB_URL USER REPO REF SHA512 HEAD_REF FILE_DISAMBIGUATOR) + set(multipleValuesArgs PATCHES) + # parse parameters such that semicolons in options arguments to COMMAND don't get erased + cmake_parse_arguments(PARSE_ARGV 0 _vdud "" "${oneValueArgs}" "${multipleValuesArgs}") + + if(NOT DEFINED _vdud_GITLAB_URL) + message(FATAL_ERROR "GITLAB_URL must be specified.") + endif() + + if(NOT DEFINED _vdud_OUT_SOURCE_PATH) + message(FATAL_ERROR "OUT_SOURCE_PATH must be specified.") + endif() + + if((DEFINED _vdud_REF AND NOT DEFINED _vdud_SHA512) OR (NOT DEFINED _vdud_REF AND DEFINED _vdud_SHA512)) + message(FATAL_ERROR "SHA512 must be specified if REF is specified.") + endif() + + if(NOT DEFINED _vdud_REPO) + message(FATAL_ERROR "REPO must be specified.") + endif() + + if(NOT DEFINED _vdud_REF AND NOT DEFINED _vdud_HEAD_REF) + message(FATAL_ERROR "At least one of REF and HEAD_REF must be specified.") + endif() + + if(VCPKG_USE_HEAD_VERSION AND NOT DEFINED _vdud_HEAD_REF) + message(STATUS "Package does not specify HEAD_REF. Falling back to non-HEAD version.") + set(VCPKG_USE_HEAD_VERSION OFF) + endif() + + string(REPLACE "/" ";" GITLAB_REPO_LINK ${_vdud_REPO}) + + list(LENGTH GITLAB_REPO_LINK len) + if(${len} EQUAL "2") + list(GET GITLAB_REPO_LINK 0 ORG_NAME) + list(GET GITLAB_REPO_LINK 1 REPO_NAME) + set(GITLAB_LINK ${_vdud_GITLAB_URL}/${ORG_NAME}/${REPO_NAME}) + endif() + + if(${len} EQUAL "3") + list(GET GITLAB_REPO_LINK 0 ORG_NAME) + list(GET GITLAB_REPO_LINK 1 GROUP_NAME) + list(GET GITLAB_REPO_LINK 2 REPO_NAME) + set(GITLAB_LINK ${_vdud_GITLAB_URL}/${ORG_NAME}/${GROUP_NAME}/${REPO_NAME}) + endif() + + # Handle --no-head scenarios + if(NOT VCPKG_USE_HEAD_VERSION) + if(NOT _vdud_REF) + message(FATAL_ERROR "Package does not specify REF. It must built using --head.") + endif() + + string(REPLACE "/" "-" SANITIZED_REF "${_vdud_REF}") + set(downloaded_file_name "${ORG_NAME}-${REPO_NAME}-${SANITIZED_REF}") + if (_vdud_FILE_DISAMBIGUATOR) + set(downloaded_file_name "${downloaded_file_name}-${_vdud_FILE_DISAMBIGUATOR}") + endif() + + set(downloaded_file_name "${downloaded_file_name}.tar.gz") + + vcpkg_download_distfile(ARCHIVE + URLS "${GITLAB_LINK}/-/archive/${_vdud_REF}/${REPO_NAME}-${_vdud_REF}.tar.gz" + SHA512 "${_vdud_SHA512}" + FILENAME "${downloaded_file_name}" + ) + + vcpkg_extract_source_archive_ex( + OUT_SOURCE_PATH SOURCE_PATH + ARCHIVE "${ARCHIVE}" + REF "${SANITIZED_REF}" + PATCHES ${_vdud_PATCHES} + ) + + set(${_vdud_OUT_SOURCE_PATH} "${SOURCE_PATH}" PARENT_SCOPE) + return() + endif() + + # The following is for --head scenarios + set(URL "${GITLAB_LINK}/-/archive/${_vdud_HEAD_REF}/${_vdud_HEAD_REF}.tar.gz") + string(REPLACE "/" "-" SANITIZED_HEAD_REF "${_vdud_HEAD_REF}") + set(downloaded_file_name "${ORG_NAME}-${REPO_NAME}-${SANITIZED_HEAD_REF}.tar.gz") + set(downloaded_file_path "${DOWNLOADS}/${downloaded_file_name}") + + if(_VCPKG_NO_DOWNLOADS) + if(NOT EXISTS ${downloaded_file_path} OR NOT EXISTS ${downloaded_file_path}.version) + message(FATAL_ERROR "Downloads are disabled, but '${downloaded_file_path}' does not exist.") + endif() + message(STATUS "Using cached ${downloaded_file_path}") + else() + if(EXISTS ${downloaded_file_path}) + message(STATUS "Purging cached ${downloaded_file_path} to fetch latest (use --no-downloads to suppress)") + file(REMOVE ${downloaded_file_path}) + endif() + if(EXISTS ${downloaded_file_path}.version) + file(REMOVE ${downloaded_file_path}.version) + endif() + if(EXISTS ${CURRENT_BUILDTREES_DIR}/src/head) + file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/src/head) + endif() + + vcpkg_download_distfile(ARCHIVE + URLS ${URL} + FILENAME ${downloaded_file_name} + SKIP_SHA512 + ) + endif() + + # There are issues with the Gitlab API project paths being URL-escaped, so we use git here to get the head revision + vcpkg_execute_in_download_mode(COMMAND ${GIT} ls-remote + "${GITLAB_LINK}.git" "${_vdud_HEAD_REF}" + RESULT_VARIABLE _git_result + OUTPUT_VARIABLE _git_output + ) + string(REGEX MATCH "[a-f0-9]+" _version "${_git_output}") + # exports VCPKG_HEAD_VERSION to the caller. This will get picked up by ports.cmake after the build. + # When multiple vcpkg_from_gitlab's are used after each other, only use the version from the first (hopefully the primary one). + if(NOT DEFINED VCPKG_HEAD_VERSION) + set(VCPKG_HEAD_VERSION ${_version} PARENT_SCOPE) + endif() + + vcpkg_extract_source_archive_ex( + OUT_SOURCE_PATH SOURCE_PATH + ARCHIVE "${downloaded_file_path}" + REF "${SANITIZED_HEAD_REF}" + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/src/head + PATCHES ${_vdud_PATCHES} + ) + set(${_vdud_OUT_SOURCE_PATH} "${SOURCE_PATH}" PARENT_SCOPE) +endfunction() diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_from_sourceforge.cmake b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_from_sourceforge.cmake new file mode 100644 index 000000000..82286b346 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_from_sourceforge.cmake @@ -0,0 +1,239 @@ +#[===[.md: +# vcpkg_from_sourceforge + +Download and extract a project from sourceforge. + +## Usage: +```cmake +vcpkg_from_sourceforge( + OUT_SOURCE_PATH SOURCE_PATH + REPO <cunit/CUnit> + [REF <2.1-3>] + SHA512 <547b417109332...> + FILENAME <CUnit-2.1-3.tar.bz2> + [DISABLE_SSL] + [NO_REMOVE_ONE_LEVEL] + [PATCHES <patch1.patch> <patch2.patch>...] +) +``` + +## Parameters: +### OUT_SOURCE_PATH +Specifies the out-variable that will contain the extracted location. + +This should be set to `SOURCE_PATH` by convention. + +### REPO +The organization or user and repository (optional) on sourceforge. + +### REF +A stable version number that will not change contents. + +### FILENAME +The local name for the file. Files are shared between ports, so the file may need to be renamed to make it clearly attributed to this port and avoid conflicts. + +For example, we can get the download link: +https://sourceforge.net/settings/mirror_choices?projectname=mad&filename=libmad/0.15.1b/libmad-0.15.1b.tar.gz&selected=nchc +So the REPO is `mad/libmad`, the REF is `0.15.1b`, and the FILENAME is `libmad-0.15.1b.tar.gz` + +For some special links: +https://sourceforge.net/settings/mirror_choices?projectname=soxr&filename=soxr-0.1.3-Source.tar.xz&selected=nchc +The REPO is `soxr`, REF is not exist, and the FILENAME is `soxr-0.1.3-Source.tar.xz` + +### SHA512 +The SHA512 hash that should match the archive. + +### WORKING_DIRECTORY +If specified, the archive will be extracted into the working directory instead of `${CURRENT_BUILDTREES_DIR}/src/`. + +Note that the archive will still be extracted into a subfolder underneath that directory (`${WORKING_DIRECTORY}/${REF}-${HASH}/`). + +### PATCHES +A list of patches to be applied to the extracted sources. + +Relative paths are based on the port directory. + +### DISABLE_SSL +Disable ssl when downloading source. + +### NO_REMOVE_ONE_LEVEL +Specifies that the default removal of the top level folder should not occur. + +## Examples: + +* [cunit](https://github.com/Microsoft/vcpkg/blob/master/ports/cunit/portfile.cmake) +* [polyclipping](https://github.com/Microsoft/vcpkg/blob/master/ports/polyclipping/portfile.cmake) +* [tinyfiledialogs](https://github.com/Microsoft/vcpkg/blob/master/ports/tinyfiledialogs/portfile.cmake) +#]===] + +function(vcpkg_from_sourceforge) + macro(check_file_content) + if (EXISTS ${ARCHIVE}) + file(SIZE ${ARCHIVE} DOWNLOAD_FILE_SIZE) + if (DOWNLOAD_FILE_SIZE LESS_EQUAL 1024) + file(READ ${ARCHIVE} _FILE_CONTENT_) + string(FIND "${_FILE_CONTENT_}" "the Sourceforge site is currently in Disaster Recovery mode." OUT_CONTENT) + message("OUT_CONTENT: ${OUT_CONTENT}") + if (OUT_CONTENT EQUAL -1) + set(download_success 1) + else() + file(REMOVE ${ARCHIVE}) + endif() + endif() + endif() + endmacro() + + macro(check_file_sha512) + file(SHA512 ${ARCHIVE} FILE_HASH) + if(NOT FILE_HASH STREQUAL _vdus_SHA512) + message(FATAL_ERROR + "\nFile does not have expected hash:\n" + " File path: [ ${ARCHIVE} ]\n" + " Expected hash: [ ${_vdus_SHA512} ]\n" + " Actual hash: [ ${FILE_HASH} ]\n" + "${CUSTOM_ERROR_ADVICE}\n") + endif() + endmacro() + + set(booleanValueArgs DISABLE_SSL NO_REMOVE_ONE_LEVEL) + set(oneValueArgs OUT_SOURCE_PATH REPO REF SHA512 FILENAME WORKING_DIRECTORY) + set(multipleValuesArgs PATCHES) + # parse parameters such that semicolons in options arguments to COMMAND don't get erased + cmake_parse_arguments(PARSE_ARGV 0 _vdus "${booleanValueArgs}" "${oneValueArgs}" "${multipleValuesArgs}") + + if(NOT DEFINED _vdus_OUT_SOURCE_PATH) + message(FATAL_ERROR "OUT_SOURCE_PATH must be specified.") + endif() + + if(NOT DEFINED _vdus_SHA512) + message(FATAL_ERROR "SHA512 must be specified.") + endif() + + if(NOT DEFINED _vdus_REPO) + message(FATAL_ERROR "The sourceforge repository must be specified.") + endif() + + if(DEFINED _vdus_WORKING_DIRECTORY) + set(WORKING_DIRECTORY WORKING_DIRECTORY "${_vdus_WORKING_DIRECTORY}") + else() + set(WORKING_DIRECTORY) + endif() + + if (_vdus_DISABLE_SSL) + set(URL_PROTOCOL http:) + else() + set(URL_PROTOCOL https:) + endif() + + set(SOURCEFORGE_HOST ${URL_PROTOCOL}//sourceforge.net/projects) + + string(FIND ${_vdus_REPO} "/" FOUND_ORG) + if (NOT FOUND_ORG EQUAL -1) + string(SUBSTRING "${_vdus_REPO}" 0 ${FOUND_ORG} ORG_NAME) + math(EXPR FOUND_ORG "${FOUND_ORG} + 1") # skip the slash + string(SUBSTRING "${_vdus_REPO}" ${FOUND_ORG} -1 REPO_NAME) + if (REPO_NAME MATCHES "/") + message(FATAL_ERROR "REPO should contain at most one slash (found ${_vdus_REPO}).") + endif() + set(ORG_NAME ${ORG_NAME}/) + else() + set(ORG_NAME ${_vdus_REPO}/) + set(REPO_NAME ) + endif() + + if (DEFINED _vdus_REF) + set(URL "${SOURCEFORGE_HOST}/${ORG_NAME}files/${REPO_NAME}/${_vdus_REF}/${_vdus_FILENAME}") + else() + set(URL "${SOURCEFORGE_HOST}/${ORG_NAME}${REPO_NAME}/files/${_vdus_FILENAME}") + endif() + + set(NO_REMOVE_ONE_LEVEL ) + if (_vdus_NO_REMOVE_ONE_LEVEL) + set(NO_REMOVE_ONE_LEVEL "NO_REMOVE_ONE_LEVEL") + endif() + + string(SUBSTRING "${_vdus_SHA512}" 0 10 SANITIZED_REF) + + list(APPEND SOURCEFORGE_MIRRORS + cfhcable # United States + pilotfiber # New York, NY + gigenet # Chicago, IL + versaweb # Las Vegas, NV + ayera # Modesto, CA + netactuate # Durham, NC + phoenixnap # Tempe, AZ + astuteinternet # Vancouver, BC + freefr # Paris, France + netcologne # Cologne, Germany + deac-riga # Latvia + excellmedia # Hyderabad, India + iweb # Montreal, QC + jaist # Nomi, Japan + jztkft # Mezotur, Hungary + managedway # Detroit, MI + nchc # Taipei, Taiwan + netix # Bulgaria + ufpr # Curitiba, Brazil + tenet # Wynberg, South Africa + ) + + # Try to use auto-select first + set(DOWNLOAD_URL ${URL}/download) + message(STATUS "Trying auto-select mirror...") + vcpkg_download_distfile(ARCHIVE + URLS "${DOWNLOAD_URL}" + SKIP_SHA512 + FILENAME "${_vdus_FILENAME}" + SILENT_EXIT + ) + check_file_content() + if (download_success) + check_file_sha512() + else() + message(STATUS "The default mirror is in Disaster Recovery mode, trying other mirrors...") + endif() + + if (NOT download_success EQUAL 1) + foreach(SOURCEFORGE_MIRROR ${SOURCEFORGE_MIRRORS}) + set(DOWNLOAD_URL ${URL}/download?use_mirror=${SOURCEFORGE_MIRROR}) + message(STATUS "Trying mirror ${SOURCEFORGE_MIRROR}...") + vcpkg_download_distfile(ARCHIVE + URLS "${DOWNLOAD_URL}" + SKIP_SHA512 + FILENAME "${_vdus_FILENAME}" + SILENT_EXIT + ) + + if (EXISTS ${ARCHIVE}) + set(download_success 1) + check_file_content() + if (download_success) + check_file_sha512() + else() + message(STATUS "Mirror ${SOURCEFORGE_MIRROR} is in Disaster Recovery mode, trying other mirrors...") + endif() + break() + endif() + endforeach() + endif() + + if (NOT download_success) + message(FATAL_ERROR [[ + Couldn't download source from any of the sourceforge mirrors, please check your network. + If you use a proxy, please set the HTTPS_PROXY and HTTP_PROXY environment + variables to "http[s]://user:password@your-proxy-ip-address:port/". + Otherwise, please submit an issue at https://github.com/Microsoft/vcpkg/issues + ]]) + endif() + + vcpkg_extract_source_archive_ex( + OUT_SOURCE_PATH SOURCE_PATH + ARCHIVE "${ARCHIVE}" + REF "${SANITIZED_REF}" + ${NO_REMOVE_ONE_LEVEL} + ${WORKING_DIRECTORY} + PATCHES ${_vdus_PATCHES} + ) + + set(${_vdus_OUT_SOURCE_PATH} "${SOURCE_PATH}" PARENT_SCOPE) +endfunction() diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_get_program_files_platform_bitness.cmake b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_get_program_files_platform_bitness.cmake new file mode 100644 index 000000000..7e3a5af52 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_get_program_files_platform_bitness.cmake @@ -0,0 +1,23 @@ +#[===[.md: +# vcpkg_get_program_files_platform_bitness + +Get the Program Files directory of the current platform's bitness: +either `$ENV{ProgramW6432}` on 64-bit windows, +or `$ENV{PROGRAMFILES}` on 32-bit windows. + +## Usage: +```cmake +vcpkg_get_program_files_platform_bitness(<variable>) +``` +#]===] + +function(vcpkg_get_program_files_platform_bitness ret) + + set(ret_temp $ENV{ProgramW6432}) + if (NOT DEFINED ret_temp) + set(ret_temp $ENV{PROGRAMFILES}) + endif() + + set(${ret} ${ret_temp} PARENT_SCOPE) + +endfunction() diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_get_windows_sdk.cmake b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_get_windows_sdk.cmake new file mode 100644 index 000000000..f16d4f53e --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_get_windows_sdk.cmake @@ -0,0 +1,16 @@ +#[===[.md: +# vcpkg_get_windows_sdk + +Get the Windows SDK number. + +## Usage: +```cmake +vcpkg_get_windows_sdk(<variable>) +``` +#]===] + +function(vcpkg_get_windows_sdk ret) + set(WINDOWS_SDK $ENV{WindowsSDKVersion}) + string(REPLACE "\\" "" WINDOWS_SDK "${WINDOWS_SDK}") + set(${ret} ${WINDOWS_SDK} PARENT_SCOPE) +endfunction() diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_install_cmake.cmake b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_install_cmake.cmake new file mode 100644 index 000000000..b94a3a484 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_install_cmake.cmake @@ -0,0 +1,49 @@ +# DEPRECATED BY ports/vcpkg-cmake/vcpkg_cmake_install +#[===[.md: +# vcpkg_install_cmake + +Build and install a cmake project. + +## Usage: +```cmake +vcpkg_install_cmake(...) +``` + +## Parameters: +See [`vcpkg_build_cmake()`](vcpkg_build_cmake.md). + +## Notes: +This command transparently forwards to [`vcpkg_build_cmake()`](vcpkg_build_cmake.md), adding a `TARGET install` +parameter. + +## Examples: + +* [zlib](https://github.com/Microsoft/vcpkg/blob/master/ports/zlib/portfile.cmake) +* [cpprestsdk](https://github.com/Microsoft/vcpkg/blob/master/ports/cpprestsdk/portfile.cmake) +* [poco](https://github.com/Microsoft/vcpkg/blob/master/ports/poco/portfile.cmake) +* [opencv](https://github.com/Microsoft/vcpkg/blob/master/ports/opencv/portfile.cmake) +#]===] + +function(vcpkg_install_cmake) + if(Z_VCPKG_CMAKE_INSTALL_GUARD) + message(FATAL_ERROR "The ${PORT} port already depends on vcpkg-cmake; using both vcpkg-cmake and vcpkg_install_cmake in the same port is unsupported.") + endif() + + cmake_parse_arguments(PARSE_ARGV 0 "arg" "DISABLE_PARALLEL;ADD_BIN_TO_PATH" "" "") + if(DEFINED arg_UNPARSED_ARGUMENTS) + message(FATAL_ERROR "vcpkg_cmake_install was passed extra arguments: ${arg_UNPARSED_ARGUMENTS}") + endif() + + set(args) + foreach(arg IN ITEMS DISABLE_PARALLEL ADD_BIN_TO_PATH) + if(arg_${arg}) + list(APPEND args "${arg}") + endif() + endforeach() + + vcpkg_build_cmake(Z_VCPKG_DISABLE_DEPRECATION MESSAGE + ${args} + LOGFILE_ROOT install + TARGET install + ) +endfunction() diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_install_gn.cmake b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_install_gn.cmake new file mode 100644 index 000000000..8dd83510e --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_install_gn.cmake @@ -0,0 +1,100 @@ +#[===[.md: +# vcpkg_install_gn + +Installs a GN project + +## Usage: +```cmake +vcpkg_install_gn( + SOURCE_PATH <SOURCE_PATH> + [TARGETS <target>...] +) +``` + +## Parameters: +### SOURCE_PATH +The path to the source directory + +### TARGETS +Only install the specified targets. + +Note: includes must be handled separately +#]===] + +function(vcpkg_install_gn) + # parse parameters such that semicolons in options arguments to COMMAND don't get erased + cmake_parse_arguments(PARSE_ARGV 0 _vig "" "SOURCE_PATH" "TARGETS") + + if(NOT DEFINED _vig_SOURCE_PATH) + message(FATAL_ERROR "SOURCE_PATH must be specified.") + endif() + + vcpkg_build_ninja(TARGETS ${_vig_TARGETS}) + + vcpkg_find_acquire_program(GN) + + function(gn_get_target_type OUT_VAR BUILD_DIR TARGET) + execute_process( + COMMAND ${GN} desc "${BUILD_DIR}" "${TARGET}" + WORKING_DIRECTORY "${_vig_SOURCE_PATH}" + OUTPUT_VARIABLE OUTPUT_ + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + string(REGEX MATCH "type: ([A-Za-z0-9_]+)" OUTPUT_ "${OUTPUT_}") + set(${OUT_VAR} ${CMAKE_MATCH_1} PARENT_SCOPE) + endfunction() + + function(gn_desc OUT_VAR BUILD_DIR TARGET WHAT_TO_DISPLAY) + execute_process( + COMMAND ${GN} desc "${BUILD_DIR}" "${TARGET}" "${WHAT_TO_DISPLAY}" + WORKING_DIRECTORY "${_vig_SOURCE_PATH}" + OUTPUT_VARIABLE OUTPUT_ + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + string(REGEX REPLACE "\n|(\r\n)" ";" OUTPUT_ "${OUTPUT_}") + set(${OUT_VAR} ${OUTPUT_} PARENT_SCOPE) + endfunction() + + function(install_ BUILD_DIR INSTALL_DIR) + if(_vig_TARGETS) + foreach(TARGET ${_vig_TARGETS}) + # GN targets must start with a // + gn_desc(OUTPUTS "${BUILD_DIR}" "//${TARGET}" outputs) + gn_get_target_type(TARGET_TYPE "${BUILD_DIR}" "//${TARGET}") + foreach(OUTPUT ${OUTPUTS}) + if(NOT EXISTS "${OUTPUT}") + if(OUTPUT MATCHES "^//") + # relative path (e.g. //out/Release/target.lib) + string(REGEX REPLACE "^//" "${_vig_SOURCE_PATH}/" OUTPUT "${OUTPUT}") + elseif(OUTPUT MATCHES "^/" AND CMAKE_HOST_WIN32) + # absolute path (e.g. /C:/path/to/target.lib) + string(REGEX REPLACE "^/" "" OUTPUT "${OUTPUT}") + endif() + endif() + + if(NOT EXISTS "${OUTPUT}") + message(STATUS "Output for target, ${TARGET} doesn't exist: ${OUTPUT}.") + continue() + endif() + + if(TARGET_TYPE STREQUAL "executable") + file(INSTALL "${OUTPUT}" DESTINATION "${INSTALL_DIR}/tools") + elseif("${OUTPUT}" MATCHES "(\\.dll|\\.pdb)$") + file(INSTALL "${OUTPUT}" DESTINATION "${INSTALL_DIR}/bin") + else() + file(INSTALL "${OUTPUT}" DESTINATION "${INSTALL_DIR}/lib") + endif() + endforeach() + endforeach() + endif() + endfunction() + + if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") + install_("${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg" "${CURRENT_PACKAGES_DIR}/debug") + endif() + + if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") + install_("${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel" "${CURRENT_PACKAGES_DIR}") + endif() + +endfunction() diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_install_make.cmake b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_install_make.cmake new file mode 100644 index 000000000..ce8a782d3 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_install_make.cmake @@ -0,0 +1,27 @@ +#[===[.md:
+# vcpkg_install_make
+
+Build and install a make project.
+
+## Usage:
+```cmake
+vcpkg_install_make(...)
+```
+
+## Parameters:
+See [`vcpkg_build_make()`](vcpkg_build_make.md).
+
+## Notes:
+This command transparently forwards to [`vcpkg_build_make()`](vcpkg_build_make.md), adding `ENABLE_INSTALL`
+
+## Examples
+
+* [x264](https://github.com/Microsoft/vcpkg/blob/master/ports/x264/portfile.cmake)
+* [tcl](https://github.com/Microsoft/vcpkg/blob/master/ports/tcl/portfile.cmake)
+* [freexl](https://github.com/Microsoft/vcpkg/blob/master/ports/freexl/portfile.cmake)
+* [libosip2](https://github.com/Microsoft/vcpkg/blob/master/ports/libosip2/portfile.cmake)
+#]===]
+
+function(vcpkg_install_make)
+ vcpkg_build_make(${ARGN} LOGFILE_ROOT ENABLE_INSTALL)
+endfunction()
diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_install_meson.cmake b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_install_meson.cmake new file mode 100644 index 000000000..6310a96cd --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_install_meson.cmake @@ -0,0 +1,105 @@ +#[===[.md: +# vcpkg_install_meson + +Builds a meson project previously configured with `vcpkg_configure_meson()`. + +## Usage +```cmake +vcpkg_install_meson([ADD_BIN_TO_PATH]) +``` + +## Parameters: +### ADD_BIN_TO_PATH +Adds the appropriate Release and Debug `bin\` directories to the path during the build such that executables can run against the in-tree DLLs. + +## Examples + +* [fribidi](https://github.com/Microsoft/vcpkg/blob/master/ports/fribidi/portfile.cmake) +* [libepoxy](https://github.com/Microsoft/vcpkg/blob/master/ports/libepoxy/portfile.cmake) +#]===] + +function(vcpkg_install_meson) + vcpkg_find_acquire_program(NINJA) + unset(ENV{DESTDIR}) # installation directory was already specified with '--prefix' option + cmake_parse_arguments(PARSE_ARGV 0 _im "ADD_BIN_TO_PATH" "" "") + + if(VCPKG_TARGET_IS_OSX) + if(DEFINED ENV{SDKROOT}) + set(_VCPKG_ENV_SDKROOT_BACKUP $ENV{SDKROOT}) + endif() + set(ENV{SDKROOT} "${VCPKG_DETECTED_CMAKE_OSX_SYSROOT}") + + if(DEFINED ENV{MACOSX_DEPLOYMENT_TARGET}) + set(_VCPKG_ENV_MACOSX_DEPLOYMENT_TARGET_BACKUP $ENV{MACOSX_DEPLOYMENT_TARGET}) + endif() + set(ENV{MACOSX_DEPLOYMENT_TARGET} "${VCPKG_DETECTED_CMAKE_OSX_DEPLOYMENT_TARGET}") + endif() + + foreach(BUILDTYPE "debug" "release") + if(DEFINED VCPKG_BUILD_TYPE AND NOT VCPKG_BUILD_TYPE STREQUAL BUILDTYPE) + continue() + endif() + + if(BUILDTYPE STREQUAL "debug") + set(SHORT_BUILDTYPE "dbg") + else() + set(SHORT_BUILDTYPE "rel") + endif() + + message(STATUS "Package ${TARGET_TRIPLET}-${SHORT_BUILDTYPE}") + if(_im_ADD_BIN_TO_PATH) + set(_BACKUP_ENV_PATH "$ENV{PATH}") + if(BUILDTYPE STREQUAL "debug") + vcpkg_add_to_path(PREPEND "${CURRENT_INSTALLED_DIR}/debug/bin") + else() + vcpkg_add_to_path(PREPEND "${CURRENT_INSTALLED_DIR}/bin") + endif() + endif() + vcpkg_execute_required_process( + COMMAND ${NINJA} install -v + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${SHORT_BUILDTYPE} + LOGNAME package-${TARGET_TRIPLET}-${SHORT_BUILDTYPE} + ) + if(_im_ADD_BIN_TO_PATH) + set(ENV{PATH} "${_BACKUP_ENV_PATH}") + endif() + endforeach() + + set(RENAMED_LIBS) + if(VCPKG_TARGET_IS_WINDOWS AND VCPKG_LIBRARY_LINKAGE STREQUAL static) + # Meson names all static libraries lib<name>.a which basically breaks the world + file(GLOB_RECURSE LIBRARIES "${CURRENT_PACKAGES_DIR}*/**/lib*.a") + foreach(_library IN LISTS LIBRARIES) + get_filename_component(LIBDIR "${_library}" DIRECTORY ) + get_filename_component(LIBNAME "${_library}" NAME) + string(REGEX REPLACE ".a$" ".lib" LIBNAMENEW "${LIBNAME}") + string(REGEX REPLACE "^lib" "" LIBNAMENEW "${LIBNAMENEW}") + file(RENAME "${_library}" "${LIBDIR}/${LIBNAMENEW}") + # For cmake fixes. + string(REGEX REPLACE ".a$" "" LIBRAWNAMEOLD "${LIBNAME}") + string(REGEX REPLACE ".lib$" "" LIBRAWNAMENEW "${LIBNAMENEW}") + list(APPEND RENAMED_LIBS ${LIBRAWNAMENEW}) + set(${LIBRAWNAME}_OLD ${LIBRAWNAMEOLD}) + set(${LIBRAWNAME}_NEW ${LIBRAWNAMENEW}) + endforeach() + file(GLOB_RECURSE CMAKE_FILES "${CURRENT_PACKAGES_DIR}*/*.cmake") + foreach(_cmake IN LISTS CMAKE_FILES) + foreach(_lib IN LISTS RENAMED_LIBS) + vcpkg_replace_string("${_cmake}" "${${_lib}_OLD}" "${${_lib}_NEW}") + endforeach() + endforeach() + endif() + + if(VCPKG_TARGET_IS_OSX) + if(DEFINED _VCPKG_ENV_SDKROOT_BACKUP) + set(ENV{SDKROOT} "${_VCPKG_ENV_SDKROOT_BACKUP}") + else() + unset(ENV{SDKROOT}) + endif() + if(DEFINED _VCPKG_ENV_MACOSX_DEPLOYMENT_TARGET_BACKUP) + set(ENV{MACOSX_DEPLOYMENT_TARGET} "${_VCPKG_ENV_MACOSX_DEPLOYMENT_TARGET_BACKUP}") + else() + unset(ENV{MACOSX_DEPLOYMENT_TARGET}) + endif() + endif() +endfunction() diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_install_msbuild.cmake b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_install_msbuild.cmake new file mode 100644 index 000000000..ec3a713a5 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_install_msbuild.cmake @@ -0,0 +1,234 @@ +#[===[.md: +# vcpkg_install_msbuild + +Build and install a msbuild-based project. This replaces `vcpkg_build_msbuild()`. + +## Usage +```cmake +vcpkg_install_msbuild( + SOURCE_PATH <${SOURCE_PATH}> + PROJECT_SUBPATH <port.sln> + [INCLUDES_SUBPATH <include>] + [LICENSE_SUBPATH <LICENSE>] + [RELEASE_CONFIGURATION <Release>] + [DEBUG_CONFIGURATION <Debug>] + [TARGET <Build>] + [TARGET_PLATFORM_VERSION <10.0.15063.0>] + [PLATFORM <${TRIPLET_SYSTEM_ARCH}>] + [PLATFORM_TOOLSET <${VCPKG_PLATFORM_TOOLSET}>] + [OPTIONS </p:ZLIB_INCLUDE_PATH=X>...] + [OPTIONS_RELEASE </p:ZLIB_LIB=X>...] + [OPTIONS_DEBUG </p:ZLIB_LIB=X>...] + [USE_VCPKG_INTEGRATION] + [ALLOW_ROOT_INCLUDES | REMOVE_ROOT_INCLUDES] +) +``` + +## Parameters +### SOURCE_PATH +The path to the root of the source tree. + +Because MSBuild uses in-source builds, the source tree will be copied into a temporary location for the build. This +parameter is the base for that copy and forms the base for all XYZ_SUBPATH options. + +### USE_VCPKG_INTEGRATION +Apply the normal `integrate install` integration for building the project. + +By default, projects built with this command will not automatically link libraries or have header paths set. + +### PROJECT_SUBPATH +The subpath to the solution (`.sln`) or project (`.vcxproj`) file relative to `SOURCE_PATH`. + +### LICENSE_SUBPATH +The subpath to the license file relative to `SOURCE_PATH`. + +### INCLUDES_SUBPATH +The subpath to the includes directory relative to `SOURCE_PATH`. + +This parameter should be a directory and should not end in a trailing slash. + +### ALLOW_ROOT_INCLUDES +Indicates that top-level include files (e.g. `include/zlib.h`) should be allowed. + +### REMOVE_ROOT_INCLUDES +Indicates that top-level include files (e.g. `include/Makefile.am`) should be removed. + +### SKIP_CLEAN +Indicates that the intermediate files should not be removed. + +Ports using this option should later call [`vcpkg_clean_msbuild()`](vcpkg_clean_msbuild.md) to manually clean up. + +### RELEASE_CONFIGURATION +The configuration (``/p:Configuration`` msbuild parameter) used for Release builds. + +### DEBUG_CONFIGURATION +The configuration (``/p:Configuration`` msbuild parameter) used for Debug builds. + +### TARGET_PLATFORM_VERSION +The WindowsTargetPlatformVersion (``/p:WindowsTargetPlatformVersion`` msbuild parameter) + +### TARGET +The MSBuild target to build. (``/t:<TARGET>``) + +### PLATFORM +The platform (``/p:Platform`` msbuild parameter) used for the build. + +### PLATFORM_TOOLSET +The platform toolset (``/p:PlatformToolset`` msbuild parameter) used for the build. + +### OPTIONS +Additional options passed to msbuild for all builds. + +### OPTIONS_RELEASE +Additional options passed to msbuild for Release builds. These are in addition to `OPTIONS`. + +### OPTIONS_DEBUG +Additional options passed to msbuild for Debug builds. These are in addition to `OPTIONS`. + +## Examples + +* [xalan-c](https://github.com/Microsoft/vcpkg/blob/master/ports/xalan-c/portfile.cmake) +* [libimobiledevice](https://github.com/Microsoft/vcpkg/blob/master/ports/libimobiledevice/portfile.cmake) +#]===] + +include(vcpkg_clean_msbuild) + +function(vcpkg_install_msbuild) + # parse parameters such that semicolons in options arguments to COMMAND don't get erased + cmake_parse_arguments( + PARSE_ARGV 0 + _csc + "USE_VCPKG_INTEGRATION;ALLOW_ROOT_INCLUDES;REMOVE_ROOT_INCLUDES;SKIP_CLEAN" + "SOURCE_PATH;PROJECT_SUBPATH;INCLUDES_SUBPATH;LICENSE_SUBPATH;RELEASE_CONFIGURATION;DEBUG_CONFIGURATION;PLATFORM;PLATFORM_TOOLSET;TARGET_PLATFORM_VERSION;TARGET" + "OPTIONS;OPTIONS_RELEASE;OPTIONS_DEBUG" + ) + + if(NOT DEFINED _csc_RELEASE_CONFIGURATION) + set(_csc_RELEASE_CONFIGURATION Release) + endif() + if(NOT DEFINED _csc_DEBUG_CONFIGURATION) + set(_csc_DEBUG_CONFIGURATION Debug) + endif() + if(NOT DEFINED _csc_PLATFORM) + if(VCPKG_TARGET_ARCHITECTURE STREQUAL x64) + set(_csc_PLATFORM x64) + elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL x86) + set(_csc_PLATFORM Win32) + elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL ARM) + set(_csc_PLATFORM ARM) + elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL arm64) + set(_csc_PLATFORM arm64) + else() + message(FATAL_ERROR "Unsupported target architecture") + endif() + endif() + if(NOT DEFINED _csc_PLATFORM_TOOLSET) + set(_csc_PLATFORM_TOOLSET ${VCPKG_PLATFORM_TOOLSET}) + endif() + if(NOT DEFINED _csc_TARGET_PLATFORM_VERSION) + vcpkg_get_windows_sdk(_csc_TARGET_PLATFORM_VERSION) + endif() + if(NOT DEFINED _csc_TARGET) + set(_csc_TARGET Rebuild) + endif() + + list(APPEND _csc_OPTIONS + /t:${_csc_TARGET} + /p:Platform=${_csc_PLATFORM} + /p:PlatformToolset=${_csc_PLATFORM_TOOLSET} + /p:VCPkgLocalAppDataDisabled=true + /p:UseIntelMKL=No + /p:WindowsTargetPlatformVersion=${_csc_TARGET_PLATFORM_VERSION} + /p:VcpkgTriplet=${TARGET_TRIPLET} + "/p:VcpkgInstalledDir=${_VCPKG_INSTALLED_DIR}" + /p:VcpkgManifestInstall=false + /m + ) + + if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + # Disable LTCG for static libraries because this setting introduces ABI incompatibility between minor compiler versions + # TODO: Add a way for the user to override this if they want to opt-in to incompatibility + list(APPEND _csc_OPTIONS /p:WholeProgramOptimization=false) + endif() + + if(_csc_USE_VCPKG_INTEGRATION) + list(APPEND _csc_OPTIONS /p:ForceImportBeforeCppTargets=${SCRIPTS}/buildsystems/msbuild/vcpkg.targets /p:VcpkgApplocalDeps=false) + endif() + + get_filename_component(SOURCE_PATH_SUFFIX "${_csc_SOURCE_PATH}" NAME) + if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") + message(STATUS "Building ${_csc_PROJECT_SUBPATH} for Release") + file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) + file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) + file(COPY ${_csc_SOURCE_PATH} DESTINATION ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) + set(SOURCE_COPY_PATH ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/${SOURCE_PATH_SUFFIX}) + vcpkg_execute_required_process( + COMMAND msbuild ${SOURCE_COPY_PATH}/${_csc_PROJECT_SUBPATH} + /p:Configuration=${_csc_RELEASE_CONFIGURATION} + ${_csc_OPTIONS} + ${_csc_OPTIONS_RELEASE} + WORKING_DIRECTORY ${SOURCE_COPY_PATH} + LOGNAME build-${TARGET_TRIPLET}-rel + ) + file(GLOB_RECURSE LIBS ${SOURCE_COPY_PATH}/*.lib) + file(GLOB_RECURSE DLLS ${SOURCE_COPY_PATH}/*.dll) + file(GLOB_RECURSE EXES ${SOURCE_COPY_PATH}/*.exe) + if(LIBS) + file(COPY ${LIBS} DESTINATION ${CURRENT_PACKAGES_DIR}/lib) + endif() + if(DLLS) + file(COPY ${DLLS} DESTINATION ${CURRENT_PACKAGES_DIR}/bin) + endif() + if(EXES) + file(COPY ${EXES} DESTINATION ${CURRENT_PACKAGES_DIR}/tools/${PORT}) + vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/${PORT}) + endif() + endif() + + if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") + message(STATUS "Building ${_csc_PROJECT_SUBPATH} for Debug") + file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) + file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) + file(COPY ${_csc_SOURCE_PATH} DESTINATION ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) + set(SOURCE_COPY_PATH ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/${SOURCE_PATH_SUFFIX}) + vcpkg_execute_required_process( + COMMAND msbuild ${SOURCE_COPY_PATH}/${_csc_PROJECT_SUBPATH} + /p:Configuration=${_csc_DEBUG_CONFIGURATION} + ${_csc_OPTIONS} + ${_csc_OPTIONS_DEBUG} + WORKING_DIRECTORY ${SOURCE_COPY_PATH} + LOGNAME build-${TARGET_TRIPLET}-dbg + ) + file(GLOB_RECURSE LIBS ${SOURCE_COPY_PATH}/*.lib) + file(GLOB_RECURSE DLLS ${SOURCE_COPY_PATH}/*.dll) + if(LIBS) + file(COPY ${LIBS} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) + endif() + if(DLLS) + file(COPY ${DLLS} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin) + endif() + endif() + + vcpkg_copy_pdbs() + + if(NOT _csc_SKIP_CLEAN) + vcpkg_clean_msbuild() + endif() + + if(DEFINED _csc_INCLUDES_SUBPATH) + file(COPY ${_csc_SOURCE_PATH}/${_csc_INCLUDES_SUBPATH}/ DESTINATION ${CURRENT_PACKAGES_DIR}/include/) + file(GLOB ROOT_INCLUDES LIST_DIRECTORIES false ${CURRENT_PACKAGES_DIR}/include/*) + if(ROOT_INCLUDES) + if(_csc_REMOVE_ROOT_INCLUDES) + file(REMOVE ${ROOT_INCLUDES}) + elseif(_csc_ALLOW_ROOT_INCLUDES) + else() + message(FATAL_ERROR "Top-level files were found in ${CURRENT_PACKAGES_DIR}/include; this may indicate a problem with the call to `vcpkg_install_msbuild()`.\nTo avoid conflicts with other libraries, it is recommended to not put includes into the root `include/` directory.\nPass either ALLOW_ROOT_INCLUDES or REMOVE_ROOT_INCLUDES to handle these files.\n") + endif() + endif() + endif() + + if(DEFINED _csc_LICENSE_SUBPATH) + file(INSTALL ${_csc_SOURCE_PATH}/${_csc_LICENSE_SUBPATH} DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) + endif() +endfunction() diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_install_nmake.cmake b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_install_nmake.cmake new file mode 100644 index 000000000..5aebdae90 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_install_nmake.cmake @@ -0,0 +1,96 @@ +#[===[.md:
+# vcpkg_install_nmake
+
+Build and install a msvc makefile project.
+
+## Usage:
+```cmake
+vcpkg_install_nmake(
+ SOURCE_PATH <${SOURCE_PATH}>
+ [NO_DEBUG]
+ [TARGET <all>]
+ PROJECT_SUBPATH <${SUBPATH}>
+ PROJECT_NAME <${MAKEFILE_NAME}>
+ [PRERUN_SHELL <${SHELL_PATH}>]
+ [PRERUN_SHELL_DEBUG <${SHELL_PATH}>]
+ [PRERUN_SHELL_RELEASE <${SHELL_PATH}>]
+ [OPTIONS <-DUSE_THIS_IN_ALL_BUILDS=1>...]
+ [OPTIONS_RELEASE <-DOPTIMIZE=1>...]
+ [OPTIONS_DEBUG <-DDEBUGGABLE=1>...]
+```
+
+## Parameters
+### SOURCE_PATH
+Specifies the directory containing the source files.
+By convention, this is usually set in the portfile as the variable `SOURCE_PATH`.
+
+### PROJECT_SUBPATH
+Specifies the sub directory containing the `makefile.vc`/`makefile.mak`/`makefile.msvc` or other msvc makefile.
+
+### PROJECT_NAME
+Specifies the name of msvc makefile name.
+Default is makefile.vc
+
+### NO_DEBUG
+This port doesn't support debug mode.
+
+### PRERUN_SHELL
+Script that needs to be called before build
+
+### PRERUN_SHELL_DEBUG
+Script that needs to be called before debug build
+
+### PRERUN_SHELL_RELEASE
+Script that needs to be called before release build
+
+### OPTIONS
+Additional options passed to generate during the generation.
+
+### OPTIONS_RELEASE
+Additional options passed to generate during the Release generation. These are in addition to `OPTIONS`.
+
+### OPTIONS_DEBUG
+Additional options passed to generate during the Debug generation. These are in addition to `OPTIONS`.
+
+## Parameters:
+See [`vcpkg_build_nmake()`](vcpkg_build_nmake.md).
+
+## Notes:
+This command transparently forwards to [`vcpkg_build_nmake()`](vcpkg_build_nmake.md), adding `ENABLE_INSTALL`
+
+## Examples
+
+* [tcl](https://github.com/Microsoft/vcpkg/blob/master/ports/tcl/portfile.cmake)
+* [freexl](https://github.com/Microsoft/vcpkg/blob/master/ports/freexl/portfile.cmake)
+#]===]
+
+function(vcpkg_install_nmake)
+ # parse parameters such that semicolons in options arguments to COMMAND don't get erased
+ cmake_parse_arguments(PARSE_ARGV 0 _in
+ "NO_DEBUG"
+ "SOURCE_PATH;PROJECT_SUBPATH;PROJECT_NAME"
+ "OPTIONS;OPTIONS_RELEASE;OPTIONS_DEBUG;PRERUN_SHELL;PRERUN_SHELL_DEBUG;PRERUN_SHELL_RELEASE;TARGET"
+ )
+
+ if (NOT CMAKE_HOST_WIN32)
+ message(FATAL_ERROR "vcpkg_install_nmake only support windows.")
+ endif()
+
+ if (_in_NO_DEBUG)
+ set(NO_DEBUG NO_DEBUG)
+ endif()
+
+ if (NOT _in_TARGET)
+ set(INSTALL_TARGET "all")
+ else()
+ set(INSTALL_TARGET "${_in_TARGET}")
+ endif()
+
+ vcpkg_build_nmake(LOGFILE_ROOT ENABLE_INSTALL
+ ${NO_DEBUG}
+ TARGET "${INSTALL_TARGET}"
+ SOURCE_PATH ${_in_SOURCE_PATH} PROJECT_SUBPATH ${_in_PROJECT_SUBPATH} PROJECT_NAME ${_in_PROJECT_NAME}
+ PRERUN_SHELL ${_in_PRERUN_SHELL} PRERUN_SHELL_DEBUG ${_in_PRERUN_SHELL_DEBUG} PRERUN_SHELL_RELEASE ${_in_PRERUN_SHELL_RELEASE}
+ OPTIONS ${_in_OPTIONS} OPTIONS_RELEASE ${_in_OPTIONS_RELEASE} OPTIONS_DEBUG ${_in_OPTIONS_DEBUG}
+ )
+endfunction()
diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_install_qmake.cmake b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_install_qmake.cmake new file mode 100644 index 000000000..d8362697a --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_install_qmake.cmake @@ -0,0 +1,66 @@ +#[===[.md:
+# vcpkg_install_qmake
+
+Build and install a qmake project.
+
+## Usage:
+```cmake
+vcpkg_install_qmake(...)
+```
+
+## Parameters:
+See [`vcpkg_build_qmake()`](vcpkg_build_qmake.md).
+
+## Notes:
+This command transparently forwards to [`vcpkg_build_qmake()`](vcpkg_build_qmake.md).
+
+Additionally, this command will copy produced .libs/.dlls/.as/.dylibs/.sos to the appropriate
+staging directories.
+
+## Examples
+
+* [libqglviewer](https://github.com/Microsoft/vcpkg/blob/master/ports/libqglviewer/portfile.cmake)
+#]===]
+
+function(vcpkg_install_qmake)
+ vcpkg_build_qmake(${ARGN})
+ file(GLOB_RECURSE RELEASE_LIBS
+ ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/*.lib
+ ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/*.a
+ ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/*.so
+ ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/*.so.*
+ ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/*.dylib
+ )
+ file(GLOB_RECURSE RELEASE_BINS
+ ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/*.dll
+ )
+ file(GLOB_RECURSE DEBUG_LIBS
+ ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/*.lib
+ ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/*.a
+ ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/*.so
+ ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/*.so.*
+ ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/*.dylib
+ )
+ file(GLOB_RECURSE DEBUG_BINS
+ ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/*.dll
+ )
+ if(NOT RELEASE_LIBS AND NOT DEBUG_LIBS)
+ message(FATAL_ERROR "Build did not appear to produce any libraries. If this is intended, use `vcpkg_build_qmake()` directly.")
+ endif()
+ if(RELEASE_LIBS)
+ file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/lib)
+ file(COPY ${RELEASE_LIBS} DESTINATION ${CURRENT_PACKAGES_DIR}/lib)
+ endif()
+ if(DEBUG_LIBS)
+ file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/lib)
+ file(COPY ${DEBUG_LIBS} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib)
+ endif()
+ if(RELEASE_BINS)
+ file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/bin)
+ file(COPY ${RELEASE_BINS} DESTINATION ${CURRENT_PACKAGES_DIR}/bin)
+ endif()
+ if(DEBUG_BINS)
+ file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/bin)
+ file(COPY ${DEBUG_BINS} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin)
+ endif()
+endfunction()
diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_internal_escape_regex_control_characters.cmake b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_internal_escape_regex_control_characters.cmake new file mode 100644 index 000000000..0655f93db --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_internal_escape_regex_control_characters.cmake @@ -0,0 +1,4 @@ +function(vcpkg_internal_escape_regex_control_characters out_var string_with_regex_characters) + string(REGEX REPLACE "[][+.*()^\\$?|]" "\\\\\\0" _escaped_content "${string_with_regex_characters}") + set(${out_var} "${_escaped_content}" PARENT_SCOPE) +endfunction() diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_internal_get_cmake_vars.cmake b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_internal_get_cmake_vars.cmake new file mode 100644 index 000000000..6c705ae8f --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_internal_get_cmake_vars.cmake @@ -0,0 +1,67 @@ +#[===[.md:
+# vcpkg_internal_get_cmake_vars
+
+**Only for internal use in vcpkg helpers. Behavior and arguments will change without notice.**
+Runs a cmake configure with a dummy project to extract certain cmake variables
+
+## Usage
+```cmake
+vcpkg_internal_get_cmake_vars(
+ [OUTPUT_FILE <output_file_with_vars>]
+ [OPTIONS <-DUSE_THIS_IN_ALL_BUILDS=1>...]
+)
+```
+
+## Parameters
+### OPTIONS
+Additional options to pass to the test configure call
+
+### OUTPUT_FILE
+Variable to return the path to the generated cmake file with the detected `CMAKE_` variables set as `VCKPG_DETECTED_`
+
+## Notes
+If possible avoid usage in portfiles.
+
+## Examples
+
+* [vcpkg_configure_make](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_configure_make.cmake)
+#]===]
+
+function(vcpkg_internal_get_cmake_vars)
+ cmake_parse_arguments(PARSE_ARGV 0 _gcv "" "OUTPUT_FILE" "OPTIONS")
+
+ if(_gcv_UNPARSED_ARGUMENTS)
+ message(FATAL_ERROR "${CMAKE_CURRENT_FUNCTION} was passed unparsed arguments: '${_gcv_UNPARSED_ARGUMENTS}'")
+ endif()
+
+ if(NOT _gcv_OUTPUT_FILE)
+ message(FATAL_ERROR "${CMAKE_CURRENT_FUNCTION} requires parameter OUTPUT_FILE!")
+ endif()
+
+ if(${_gcv_OUTPUT_FILE})
+ debug_message("OUTPUT_FILE ${${_gcv_OUTPUT_FILE}}")
+ else()
+ set(DEFAULT_OUT "${CURRENT_BUILDTREES_DIR}/cmake-vars-${TARGET_TRIPLET}.cmake.log") # So that the file gets included in CI artifacts.
+ set(${_gcv_OUTPUT_FILE} "${DEFAULT_OUT}" PARENT_SCOPE)
+ set(${_gcv_OUTPUT_FILE} "${DEFAULT_OUT}")
+ endif()
+
+ vcpkg_configure_cmake(
+ SOURCE_PATH "${SCRIPTS}/get_cmake_vars"
+ OPTIONS ${_gcv_OPTIONS} "-DVCPKG_BUILD_TYPE=${VCPKG_BUILD_TYPE}"
+ OPTIONS_DEBUG "-DVCPKG_OUTPUT_FILE:PATH=${CURRENT_BUILDTREES_DIR}/cmake-vars-${TARGET_TRIPLET}-dbg.cmake.log"
+ OPTIONS_RELEASE "-DVCPKG_OUTPUT_FILE:PATH=${CURRENT_BUILDTREES_DIR}/cmake-vars-${TARGET_TRIPLET}-rel.cmake.log"
+ PREFER_NINJA
+ LOGNAME get-cmake-vars-${TARGET_TRIPLET}
+ )
+
+ set(_include_string)
+ if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
+ string(APPEND _include_string "include(\"${CURRENT_BUILDTREES_DIR}/cmake-vars-${TARGET_TRIPLET}-rel.cmake.log\")\n")
+ endif()
+ if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
+ string(APPEND _include_string "include(\"${CURRENT_BUILDTREES_DIR}/cmake-vars-${TARGET_TRIPLET}-dbg.cmake.log\")\n")
+ endif()
+ file(WRITE "${${_gcv_OUTPUT_FILE}}" "${_include_string}")
+
+endfunction()
diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_minimum_required.cmake b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_minimum_required.cmake new file mode 100644 index 000000000..202935b89 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_minimum_required.cmake @@ -0,0 +1,49 @@ +#[===[.md: +# vcpkg_minimum_required + +Asserts that the version of the vcpkg program being used to build a port is later than the supplied date, inclusive. + +## Usage +```cmake +vcpkg_minimum_required(VERSION 2021-01-13) +``` + +## Parameters +### VERSION +The date-version to check against. +#]===] + +function(vcpkg_minimum_required) + cmake_parse_arguments(PARSE_ARGV 0 _vcpkg "" "VERSION" "") + if (NOT DEFINED VCPKG_BASE_VERSION) + message(FATAL_ERROR + "Your vcpkg executable is outdated and is not compatible with the current CMake scripts. " + "Please re-acquire vcpkg by running bootstrap-vcpkg." + ) + endif() + + set(_vcpkg_date_regex "^[12][0-9][0-9][0-9]-[01][0-9]-[0-3][0-9]$") + if (NOT VCPKG_BASE_VERSION MATCHES "${_vcpkg_date_regex}") + message(FATAL_ERROR + "vcpkg internal failure; \${VCPKG_BASE_VERSION} (${VCPKG_BASE_VERSION}) was not a valid date." + ) + endif() + + if (NOT _vcpkg_VERSION MATCHES "${_vcpkg_date_regex}") + message(FATAL_ERROR + "VERSION parameter to vcpkg_minimum_required was not a valid date. " + "Comparing with vcpkg tool version ${_vcpkg_matched_base_version}" + ) + endif() + + string(REPLACE "-" "." _VCPKG_BASE_VERSION_as_dotted "${VCPKG_BASE_VERSION}") + string(REPLACE "-" "." _vcpkg_VERSION_as_dotted "${_vcpkg_VERSION}") + + if (_VCPKG_BASE_VERSION_as_dotted VERSION_LESS _vcpkg_VERSION_as_dotted) + message(FATAL_ERROR + "Your vcpkg executable is from ${VCPKG_BASE_VERSION} which is older than required by the caller " + "of vcpkg_minimum_required (${_vcpkg_VERSION}). " + "Please re-acquire vcpkg by running bootstrap-vcpkg." + ) + endif() +endfunction() diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_replace_string.cmake b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_replace_string.cmake new file mode 100644 index 000000000..d24b8677e --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_replace_string.cmake @@ -0,0 +1,16 @@ +#[===[.md: +# vcpkg_replace_string + +Replace a string in a file. + +```cmake +vcpkg_replace_string(filename match_string replace_string) +``` + +#]===] + +function(vcpkg_replace_string filename match_string replace_string) + file(READ ${filename} _contents) + string(REPLACE "${match_string}" "${replace_string}" _contents "${_contents}") + file(WRITE ${filename} "${_contents}") +endfunction() diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_test_cmake.cmake b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_test_cmake.cmake new file mode 100644 index 000000000..b3eb9f407 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/vcpkg_test_cmake.cmake @@ -0,0 +1,4 @@ +# DEPRECATED
+function(vcpkg_test_cmake)
+ message("${Z_VCPKG_BACKCOMPAT_MESSAGE_LEVEL}" "vcpkg_test_cmake was a no-op and has been removed. Please remove the call to `vcpkg_test_cmake()`.")
+endfunction()
diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/z_vcpkg_apply_patches.cmake b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/z_vcpkg_apply_patches.cmake new file mode 100644 index 000000000..3f9175749 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/z_vcpkg_apply_patches.cmake @@ -0,0 +1,67 @@ +#[===[.md: +# z_vcpkg_apply_patches + +**Only for internal use in vcpkg helpers. Behavior and arguments will change without notice.** + +Apply a set of patches to a source tree. + +```cmake +z_vcpkg_apply_patches( + SOURCE_PATH <path-to-source> + [QUIET] + PATCHES <patch>... +) +``` + +The `<path-to-source>` should be set to `${SOURCE_PATH}` by convention, +and is the path to apply the patches in. + +`z_vcpkg_apply_patches` will take the list of `<patch>`es, +which are by default relative to the port directory, +and apply them in order using `git apply`. +Generally, these `<patch>`es take the form of `some.patch` +to select patches in the port directory. +One may also download patches and use `${VCPKG_DOWNLOADS}/path/to/some.patch`. + +If `QUIET` is not passed, it is a fatal error for a patch to fail to apply; +otherwise, if `QUIET` is passed, no message is printed. +This should only be used for edge cases, such as patches that are known to fail even on a clean source tree. +#]===] + +function(z_vcpkg_apply_patches) + cmake_parse_arguments(PARSE_ARGV 0 "arg" "QUIET" "SOURCE_PATH" "PATCHES") + + find_program(GIT NAMES git git.cmd REQUIRED) + if(DEFINED ENV{GIT_CONFIG_NOSYSTEM}) + set(git_config_nosystem_backuP "$ENV{GIT_CONFIG_NOSYSTEM}") + else() + unset(git_config_nosystem_backup) + endif() + + set(ENV{GIT_CONFIG_NOSYSTEM} 1) + set(patchnum 0) + foreach(patch IN LISTS arg_PATCHES) + get_filename_component(absolute_patch "${patch}" ABSOLUTE BASE_DIR "${CURRENT_PORT_DIR}") + message(STATUS "Applying patch ${patch}") + set(logname patch-${TARGET_TRIPLET}-${patchnum}) + vcpkg_execute_in_download_mode( + COMMAND "${GIT}" -c core.longpaths=true -c core.autocrlf=false --work-tree=. --git-dir=.git apply "${absolute_patch}" --ignore-whitespace --whitespace=nowarn --verbose + OUTPUT_FILE "${CURRENT_BUILDTREES_DIR}/${logname}-out.log" + ERROR_VARIABLE error + WORKING_DIRECTORY "${arg_SOURCE_PATH}" + RESULT_VARIABLE error_code + ) + file(WRITE "${CURRENT_BUILDTREES_DIR}/${logname}-err.log" "${error}") + + if(error_code AND NOT arg_QUIET) + message(FATAL_ERROR "Applying patch failed: ${error}") + endif() + + math(EXPR patchnum "${patchnum} + 1") + endforeach() + if(DEFINED git_config_nosystem_backup) + set(ENV{GIT_CONFIG_NOSYSTEM} "${git_config_nosystem_backup}") + else() + unset(ENV{GIT_CONFIG_NOSYSTEM}) + endif() +endfunction() diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/z_vcpkg_function_arguments.cmake b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/z_vcpkg_function_arguments.cmake new file mode 100644 index 000000000..2c5b694ed --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/z_vcpkg_function_arguments.cmake @@ -0,0 +1,53 @@ +#[===[.md: +# z_vcpkg_function_arguments + +**Only for internal use in vcpkg helpers. Behavior and arguments will change without notice.** +Get a list of the arguments which were passed in. +Unlike `ARGV`, which is simply the arguments joined with `;`, +so that `(A B)` is not distinguishable from `("A;B")`, +this macro gives `"A;B"` for the first argument list, +and `"A\;B"` for the second. + +```cmake +z_vcpkg_function_arguments(<out-var> [<N>]) +``` + +`z_vcpkg_function_arguments` gets the arguments between `ARGV<N>` and the last argument. +`<N>` defaults to `0`, so that all arguments are taken. + +## Example: +```cmake +function(foo_replacement) + z_vcpkg_function_arguments(ARGS) + foo(${ARGS}) + ... +endfunction() +``` +#]===] + +# NOTE: this function definition is copied directly to scripts/buildsystems/vcpkg.cmake +# do not make changes here without making the same change there. +macro(z_vcpkg_function_arguments OUT_VAR) + if("${ARGC}" EQUAL 1) + set(z_vcpkg_function_arguments_FIRST_ARG 0) + elseif("${ARGC}" EQUAL 2) + set(z_vcpkg_function_arguments_FIRST_ARG "${ARGV1}") + else() + # vcpkg bug + message(FATAL_ERROR "z_vcpkg_function_arguments: invalid arguments (${ARGV})") + endif() + + set("${OUT_VAR}") + + # this allows us to get the value of the enclosing function's ARGC + set(z_vcpkg_function_arguments_ARGC_NAME "ARGC") + set(z_vcpkg_function_arguments_ARGC "${${z_vcpkg_function_arguments_ARGC_NAME}}") + + math(EXPR z_vcpkg_function_arguments_LAST_ARG "${z_vcpkg_function_arguments_ARGC} - 1") + if(z_vcpkg_function_arguments_LAST_ARG GREATER_EQUAL z_vcpkg_function_arguments_FIRST_ARG) + foreach(z_vcpkg_function_arguments_N RANGE "${z_vcpkg_function_arguments_FIRST_ARG}" "${z_vcpkg_function_arguments_LAST_ARG}") + string(REPLACE ";" "\\;" z_vcpkg_function_arguments_ESCAPED_ARG "${ARGV${z_vcpkg_function_arguments_N}}") + list(APPEND "${OUT_VAR}" "${z_vcpkg_function_arguments_ESCAPED_ARG}") + endforeach() + endif() +endmacro() diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/z_vcpkg_prettify_command_line.cmake b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/z_vcpkg_prettify_command_line.cmake new file mode 100644 index 000000000..ab12e78fe --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/cmake/z_vcpkg_prettify_command_line.cmake @@ -0,0 +1,34 @@ +#[===[.md:
+# z_vcpkg_prettify_command_line
+
+**Only for internal use in vcpkg helpers. Behavior and arguments will change without notice.**
+Turn a command line into a formatted string.
+
+```cmake
+z_vcpkg_prettify_command_line(<out-var> <argument>...)
+```
+
+This command is for internal use, when printing out to a message.
+
+## Examples
+
+* `scripts/cmake/vcpkg_execute_build_process.cmake`
+* `scripts/cmake/vcpkg_execute_required_process.cmake`
+* `scripts/cmake/vcpkg_execute_required_process_repeat.cmake`
+#]===]
+
+function(z_vcpkg_prettify_command_line out_var)
+ set(output_list "")
+ z_vcpkg_function_arguments(args 1)
+ foreach(v IN LISTS args)
+ string(REPLACE [[\]] [[\\]] v "${v}")
+ if(v MATCHES "( )")
+ string(REPLACE [["]] [[\"]] v "${v}")
+ list(APPEND output_list "\"${v}\"")
+ else()
+ list(APPEND output_list "${v}")
+ endif()
+ endforeach()
+ list(JOIN output_list " " output)
+ set("${out_var}" "${output}" PARENT_SCOPE)
+endfunction()
diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/detect_compiler/CMakeLists.txt b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/detect_compiler/CMakeLists.txt new file mode 100644 index 000000000..5ae17c5b2 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/detect_compiler/CMakeLists.txt @@ -0,0 +1,24 @@ +cmake_minimum_required(VERSION 3.10)
+project(detect_compiler NONE)
+
+if(CMAKE_GENERATOR STREQUAL "Ninja" AND CMAKE_SYSTEM_NAME STREQUAL "Windows")
+ set(CMAKE_C_COMPILER_WORKS 1)
+ set(CMAKE_C_COMPILER_FORCED 1)
+ set(CMAKE_CXX_COMPILER_WORKS 1)
+ set(CMAKE_CXX_COMPILER_FORCED 1)
+endif()
+
+enable_language(C)
+enable_language(CXX)
+
+file(SHA1 "${CMAKE_CXX_COMPILER}" CXX_HASH)
+file(SHA1 "${CMAKE_C_COMPILER}" C_HASH)
+string(SHA1 COMPILER_HASH "${C_HASH}${CXX_HASH}")
+
+message("#COMPILER_HASH#${COMPILER_HASH}")
+message("#COMPILER_C_HASH#${C_HASH}")
+message("#COMPILER_C_VERSION#${CMAKE_C_COMPILER_VERSION}")
+message("#COMPILER_C_ID#${CMAKE_C_COMPILER_ID}")
+message("#COMPILER_CXX_HASH#${CXX_HASH}")
+message("#COMPILER_CXX_VERSION#${CMAKE_CXX_COMPILER_VERSION}")
+message("#COMPILER_CXX_ID#${CMAKE_CXX_COMPILER_ID}")
diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/detect_compiler/CONTROL b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/detect_compiler/CONTROL new file mode 100644 index 000000000..d76f041f0 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/detect_compiler/CONTROL @@ -0,0 +1,3 @@ +Source: detect-compiler
+Version: 0
+Description: None
diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/detect_compiler/portfile.cmake b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/detect_compiler/portfile.cmake new file mode 100644 index 000000000..4f68faea4 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/detect_compiler/portfile.cmake @@ -0,0 +1,28 @@ +set(LOGS
+ ${CURRENT_BUILDTREES_DIR}/config-${TARGET_TRIPLET}-out.log
+ ${CURRENT_BUILDTREES_DIR}/config-${TARGET_TRIPLET}-rel-out.log
+ ${CURRENT_BUILDTREES_DIR}/config-${TARGET_TRIPLET}-dbg-out.log
+ ${CURRENT_BUILDTREES_DIR}/config-${TARGET_TRIPLET}-rel-err.log
+ ${CURRENT_BUILDTREES_DIR}/config-${TARGET_TRIPLET}-dbg-err.log
+)
+
+foreach(LOG IN LISTS LOGS)
+ file(REMOVE ${LOG})
+ if(EXISTS ${LOG})
+ message(FATAL_ERROR "Could not remove ${LOG}")
+ endif()
+endforeach()
+
+set(VCPKG_BUILD_TYPE release)
+
+vcpkg_configure_cmake(
+ SOURCE_PATH "${CMAKE_CURRENT_LIST_DIR}"
+ PREFER_NINJA
+)
+
+foreach(LOG IN LISTS LOGS)
+ if(EXISTS ${LOG})
+ file(READ "${LOG}" _contents)
+ message("${_contents}")
+ endif()
+endforeach()
diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/file_script.py b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/file_script.py new file mode 100644 index 000000000..de57f2720 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/file_script.py @@ -0,0 +1,42 @@ +import os
+import os.path
+import sys
+
+
+keyword = "include/"
+
+def getFiles(path):
+ files = os.listdir(path)
+ return list(filter(lambda x: x[0] != '.', files))
+
+def gen_all_file_strings(path, files, headers, output):
+ for file in files:
+ package = file[:file.find("_")]
+ f = open(path + file)
+ for line in f:
+ idx = line.strip().find(keyword)
+ if idx >= 0 and line.strip()[-1] != "/":
+ headers.write(package + ":" + line[idx + len(keyword):])
+ output.write(package + ":" + line[idx-1:])
+ elif line.strip()[-1] != "/":
+ output.write(package + ":" + line[line.find("/"):])
+ f.close()
+
+def main(path):
+ try:
+ os.mkdir("scripts/list_files")
+ except FileExistsError:
+ print("Path already exists, continuing...")
+
+ try:
+ headers = open("scripts/list_files/VCPKGHeadersDatabase.txt", mode='w')
+ output = open("scripts/list_files/VCPKGDatabase.txt", mode='w')
+ gen_all_file_strings(path, getFiles(path), headers, output)
+ headers.close()
+ output.close()
+ except e:
+ print("Failed to generate file lists")
+
+if __name__ == "__main__":
+ main(sys.argv[1])
+
diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/generateBaseline.py b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/generateBaseline.py new file mode 100644 index 000000000..6488b5425 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/generateBaseline.py @@ -0,0 +1,82 @@ +import os
+import sys
+import json
+import time
+
+from pathlib import Path
+
+
+SCRIPT_DIRECTORY = os.path.dirname(os.path.abspath(__file__))
+PORTS_DIRECTORY = os.path.join(SCRIPT_DIRECTORY, '../ports')
+VERSIONS_DB_DIRECTORY = os.path.join(SCRIPT_DIRECTORY, '../versions')
+
+
+def get_version_tag(version):
+ if 'version' in version:
+ return version['version']
+ elif 'version-date' in version:
+ return version['version-date']
+ elif 'version-semver' in version:
+ return version['version-semver']
+ elif 'version-string' in version:
+ return version['version-string']
+ sys.exit(1)
+
+
+def get_version_port_version(version):
+ if 'port-version' in version:
+ return version['port-version']
+ return 0
+
+
+def generate_baseline():
+ start_time = time.time()
+
+ # Assume each directory in ${VCPKG_ROOT}/ports is a different port
+ port_names = [item for item in os.listdir(
+ PORTS_DIRECTORY) if os.path.isdir(os.path.join(PORTS_DIRECTORY, item))]
+ port_names.sort()
+
+ baseline_entries = {}
+ total_count = len(port_names)
+ for i, port_name in enumerate(port_names, 1):
+ port_file_path = os.path.join(
+ VERSIONS_DB_DIRECTORY, f'{port_name[0]}-', f'{port_name}.json')
+
+ if not os.path.exists(port_file_path):
+ print(
+ f'Error: No version file for {port_name}.\n', file=sys.stderr)
+ continue
+ sys.stderr.write(
+ f'\rProcessed {i}/{total_count} ({i/total_count:.2%})')
+ with open(port_file_path, 'r') as db_file:
+ try:
+ versions_object = json.load(db_file)
+ if versions_object['versions']:
+ last_version = versions_object['versions'][0]
+ baseline_entries[port_name] = {
+ 'baseline': get_version_tag(last_version),
+ 'port-version': get_version_port_version(last_version)
+ }
+ except json.JSONDecodeError as e:
+ print(f'Error: Decoding {port_file_path}\n{e}\n')
+ baseline_object = {}
+ baseline_object['default'] = baseline_entries
+
+ os.makedirs(VERSIONS_DB_DIRECTORY, exist_ok=True)
+ baseline_path = os.path.join(VERSIONS_DB_DIRECTORY, 'baseline.json')
+ with open(baseline_path, 'w') as baseline_file:
+ json.dump(baseline_object, baseline_file)
+
+ elapsed_time = time.time() - start_time
+ print(f'\nElapsed time: {elapsed_time:.2f} seconds')
+
+
+def main():
+ if not os.path.exists(VERSIONS_DB_DIRECTORY):
+ print(f'Version DB files must exist before generating a baseline.\nRun: `python generatePortVersionsDB`\n')
+ generate_baseline()
+
+
+if __name__ == "__main__":
+ main()
diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/generatePortVersionsDb.py b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/generatePortVersionsDb.py new file mode 100644 index 000000000..d35e51b52 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/generatePortVersionsDb.py @@ -0,0 +1,87 @@ +import os
+import sys
+import subprocess
+import json
+import time
+import shutil
+
+import multiprocessing
+
+from pathlib import Path
+
+
+MAX_PROCESSES = multiprocessing.cpu_count()
+SCRIPT_DIRECTORY = os.path.dirname(os.path.abspath(__file__))
+PORTS_DIRECTORY = os.path.join(SCRIPT_DIRECTORY, '../ports')
+VERSIONS_DB_DIRECTORY = os.path.join(SCRIPT_DIRECTORY, '../versions')
+
+
+def get_current_git_ref():
+ output = subprocess.run(['git', '-C', SCRIPT_DIRECTORY, 'rev-parse', '--verify', 'HEAD'],
+ capture_output=True,
+ encoding='utf-8')
+ if output.returncode == 0:
+ return output.stdout.strip()
+ print(f"Failed to get git ref:", output.stderr.strip(), file=sys.stderr)
+ return None
+
+
+def generate_versions_file(port_name):
+ containing_dir = os.path.join(VERSIONS_DB_DIRECTORY, f'{port_name[0]}-')
+ os.makedirs(containing_dir, exist_ok=True)
+
+ output_file_path = os.path.join(containing_dir, f'{port_name}.json')
+ if not os.path.exists(output_file_path):
+ env = os.environ.copy()
+ env['GIT_OPTIONAL_LOCKS'] = '0'
+ output = subprocess.run(
+ [os.path.join(SCRIPT_DIRECTORY, '../vcpkg'),
+ 'x-history', port_name, '--x-json', f'--output={output_file_path}'],
+ capture_output=True, encoding='utf-8', env=env)
+ if output.returncode != 0:
+ print(f'x-history {port_name} failed: ',
+ output.stdout.strip(), file=sys.stderr)
+
+
+def generate_versions_db(revision):
+ start_time = time.time()
+
+ # Assume each directory in ${VCPKG_ROOT}/ports is a different port
+ port_names = [item for item in os.listdir(
+ PORTS_DIRECTORY) if os.path.isdir(os.path.join(PORTS_DIRECTORY, item))]
+ total_count = len(port_names)
+
+ concurrency = MAX_PROCESSES / 2
+ print(f'Running {concurrency:.0f} parallel processes')
+ process_pool = multiprocessing.Pool(MAX_PROCESSES)
+ for i, _ in enumerate(process_pool.imap_unordered(generate_versions_file, port_names), 1):
+ sys.stderr.write(
+ f'\rProcessed: {i}/{total_count} ({(i / total_count):.2%})')
+ process_pool.close()
+ process_pool.join()
+
+ # Generate timestamp
+ rev_file = os.path.join(VERSIONS_DB_DIRECTORY, revision)
+ Path(rev_file).touch()
+
+ elapsed_time = time.time() - start_time
+ print(
+ f'\nElapsed time: {elapsed_time:.2f} seconds')
+
+
+def main():
+ revision = get_current_git_ref()
+ if not revision:
+ print('Couldn\'t fetch current Git revision', file=sys.stderr)
+ sys.exit(1)
+
+ rev_file = os.path.join(VERSIONS_DB_DIRECTORY, revision)
+ if os.path.exists(rev_file):
+ print(f'Database files already exist for commit {revision}')
+ sys.exit(0)
+
+ generate_versions_db(revision)
+
+
+if __name__ == "__main__":
+ main()
diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/get_cmake_vars/CMakeLists.txt b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/get_cmake_vars/CMakeLists.txt new file mode 100644 index 000000000..2b0bd671a --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/get_cmake_vars/CMakeLists.txt @@ -0,0 +1,148 @@ +cmake_minimum_required(VERSION 3.17)
+
+set(VCPKG_LANGUAGES "C;CXX" CACHE STRING "Languages to enables for this project")
+
+set(OUTPUT_STRING)
+# Build default checklists
+list(APPEND VCPKG_DEFAULT_VARS_TO_CHECK CMAKE_CROSSCOMPILING
+ CMAKE_SYSTEM_NAME
+ CMAKE_HOST_SYSTEM_NAME
+ CMAKE_SYSTEM_PROCESSOR
+ CMAKE_HOST_SYSTEM_PROCESSOR)
+if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
+ list(APPEND VCPKG_DEFAULT_VARS_TO_CHECK CMAKE_OSX_DEPLOYMENT_TARGET
+ CMAKE_OSX_SYSROOT)
+endif()
+# Programs to check
+set(PROGLIST AR RANLIB STRIP NM OBJDUMP DLLTOOL MT LINKER)
+foreach(prog IN LISTS PROGLIST)
+ list(APPEND VCPKG_DEFAULT_VARS_TO_CHECK CMAKE_${prog})
+endforeach()
+set(COMPILERS ${VCPKG_LANGUAGES} RC)
+foreach(prog IN LISTS COMPILERS)
+ list(APPEND VCPKG_DEFAULT_VARS_TO_CHECK CMAKE_${prog}_COMPILER)
+endforeach()
+# Variables to check
+foreach(_lang IN LISTS VCPKG_LANGUAGES)
+ list(APPEND VCPKG_DEFAULT_VARS_TO_CHECK CMAKE_${_lang}_STANDARD_INCLUDE_DIRECTORIES)
+ list(APPEND VCPKG_DEFAULT_VARS_TO_CHECK CMAKE_${_lang}_STANDARD_LIBRARIES)
+ list(APPEND VCPKG_DEFAULT_VARS_TO_CHECK CMAKE_${_lang}_STANDARD)
+ list(APPEND VCPKG_DEFAULT_VARS_TO_CHECK CMAKE_${_lang}_COMPILE_FEATURES)
+ list(APPEND VCPKG_DEFAULT_VARS_TO_CHECK CMAKE_${_lang}_EXTENSION)
+ # Probably never required since implicit.
+ #list(APPEND VCPKG_DEFAULT_VARS_TO_CHECK CMAKE_${_lang}_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES)
+ #list(APPEND VCPKG_DEFAULT_VARS_TO_CHECK CMAKE_${_lang}_IMPLICIT_INCLUDE_DIRECTORIES)
+ #list(APPEND VCPKG_DEFAULT_VARS_TO_CHECK CMAKE_${_lang}_IMPLICIT_LINK_DIRECTORIES)
+ #list(APPEND VCPKG_DEFAULT_VARS_TO_CHECK CMAKE_${_lang}_IMPLICIT_LINK_LIBRARIES)
+endforeach()
+list(REMOVE_DUPLICATES VCPKG_DEFAULT_VARS_TO_CHECK)
+
+# Environment variables to check.
+list(APPEND VCPKG_DEFAULT_ENV_VARS_TO_CHECK PATH INCLUDE C_INCLUDE_PATH CPLUS_INCLUDE_PATH LIB LIBPATH LIBRARY_PATH LD_LIBRARY_PATH)
+list(REMOVE_DUPLICATES VCPKG_DEFAULT_ENV_VARS_TO_CHECK)
+
+#Flags to check. Flags are a bit special since they are configuration aware.
+set(FLAGS ${VCPKG_LANGUAGES} RC SHARED_LINKER STATIC_LINKER EXE_LINKER)
+foreach(flag IN LISTS FLAGS)
+ list(APPEND VCPKG_DEFAULT_FLAGS_TO_CHECK CMAKE_${flag}_FLAGS)
+endforeach()
+list(REMOVE_DUPLICATES VCPKG_DEFAULT_FLAGS_TO_CHECK)
+
+#Language-specific flags.
+foreach(_lang IN LISTS VCPKG_LANGUAGES)
+ list(APPEND VCPKG_LANG_FLAGS CMAKE_${_lang}_FLAGS)
+endforeach()
+list(REMOVE_DUPLICATES VCPKG_LANG_FLAGS)
+
+# TODO if ever necessary: Properties to check
+
+set(VCPKG_VAR_PREFIX "VCPKG_DETECTED" CACHE STRING "Variable prefix to use for detected flags")
+set(VCPKG_VARS_TO_CHECK "${VCPKG_DEFAULT_VARS_TO_CHECK}" CACHE STRING "Variables to check. If not given there is a list of defaults")
+set(VCPKG_FLAGS_TO_CHECK "${VCPKG_DEFAULT_FLAGS_TO_CHECK}" CACHE STRING "Variables to check. If not given there is a list of defaults")
+set(VCPKG_ENV_VARS_TO_CHECK "${VCPKG_DEFAULT_ENV_VARS_TO_CHECK}" CACHE STRING "Variables to check. If not given there is a list of defaults")
+
+if(NOT VCPKG_OUTPUT_FILE)
+ message(FATAL_ERROR "VCPKG_OUTPUT_FILE is required to be defined")
+endif()
+
+if(NOT CMAKE_BUILD_TYPE)
+ message(FATAL_ERROR "CMAKE_BUILD_TYPE is required to be defined")
+else()
+ string(TOUPPER "${CMAKE_BUILD_TYPE}" VCPKG_CONFIGS)
+endif()
+
+
+project(get_cmake_vars LANGUAGES ${VCPKG_LANGUAGES})
+
+foreach(VAR IN LISTS VCPKG_VARS_TO_CHECK)
+ string(APPEND OUTPUT_STRING "set(${VCPKG_VAR_PREFIX}_${VAR} \"${${VAR}}\")\n")
+endforeach()
+
+foreach(_env IN LISTS VCPKG_ENV_VARS_TO_CHECK)
+ if(CMAKE_HOST_WIN32)
+ string(REPLACE "\\" "/" ENV_${_env} "$ENV{${_env}}")
+ string(APPEND OUTPUT_STRING "set(${VCPKG_VAR_PREFIX}_ENV_${_env} \"${ENV_${_env}}\")\n")
+ else()
+ string(APPEND OUTPUT_STRING "set(${VCPKG_VAR_PREFIX}_ENV_${_env} \"$ENV{${_env}}\")\n")
+ endif()
+endforeach()
+
+macro(_vcpkg_adjust_flags flag_var)
+ if(MSVC) # Transform MSVC /flags to -flags due to bash scripts intepreting /flag as a path.
+ string(REGEX REPLACE "(^| )/" "\\1-" ${flag_var} "${${flag_var}}")
+ endif()
+ if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
+ if("${flag_var}" IN_LIST VCPKG_LANG_FLAGS)
+ # macOS - append arch and isysroot if cross-compiling
+ if(NOT "${CMAKE_OSX_ARCHITECTURES}" STREQUAL "${CMAKE_HOST_SYSTEM_PROCESSOR}")
+
+ foreach(arch IN LISTS CMAKE_OSX_ARCHITECTURES)
+ string(APPEND ${flag_var} " -arch ${arch}")
+ endforeach()
+ string(APPEND ${flag_var} " -isysroot ${CMAKE_OSX_SYSROOT}")
+ endif()
+ endif()
+ endif()
+endmacro()
+
+foreach(flag IN LISTS VCPKG_FLAGS_TO_CHECK)
+ string(STRIP "${${flag}}" ${flag}) # Strip leading and trailing whitespaces
+ _vcpkg_adjust_flags(${flag})
+ string(APPEND OUTPUT_STRING "set(${VCPKG_VAR_PREFIX}_RAW_${flag} \" ${${flag}}\")\n")
+ foreach(config IN LISTS VCPKG_CONFIGS)
+ string(STRIP "${${flag}_${config}}" ${flag}_${config})
+ _vcpkg_adjust_flags(${flag}_${config})
+ string(APPEND OUTPUT_STRING "set(${VCPKG_VAR_PREFIX}_RAW_${flag}_${config} \"${CMAKE_${flag}_FLAGS_${config}}\")\n")
+ set(COMBINED_${flag}_${config} "${${flag}} ${${flag}_${config}}")
+ string(STRIP "${COMBINED_${flag}_${config}}" COMBINED_${flag}_${config})
+ string(APPEND OUTPUT_STRING "set(${VCPKG_VAR_PREFIX}_${flag}_${config} \"${COMBINED_${flag}_${config}}\")\n")
+ endforeach()
+endforeach()
+
+
+file(WRITE "${VCPKG_OUTPUT_FILE}" "${OUTPUT_STRING}")
+
+# Programs:
+# CMAKE_AR
+# CMAKE_<LANG>_COMPILER_AR (Wrapper)
+# CMAKE_RANLIB
+# CMAKE_<LANG>_COMPILER_RANLIB
+# CMAKE_STRIP
+# CMAKE_NM
+# CMAKE_OBJDUMP
+# CMAKE_DLLTOOL
+# CMAKE_MT
+# CMAKE_LINKER
+# CMAKE_C_COMPILER
+# CMAKE_CXX_COMPILER
+# CMAKE_RC_COMPILER
+
+# Flags:
+# CMAKE_<LANG>_FLAGS
+# CMAKE_<LANG>_FLAGS_<CONFIG>
+# CMAKE_RC_FLAGS
+# CMAKE_SHARED_LINKER_FLAGS
+# CMAKE_STATIC_LINKER_FLAGS
+# CMAKE_STATIC_LINKER_FLAGS_<CONFIG>
+# CMAKE_EXE_LINKER_FLAGS
+# CMAKE_EXE_LINKER_FLAGS_<CONFIG>
diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/ifw/maintenance.qs b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/ifw/maintenance.qs new file mode 100644 index 000000000..5cdad7225 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/ifw/maintenance.qs @@ -0,0 +1,46 @@ +// constructor +function Component() +{ + installer.installationStarted.connect(this, Component.prototype.onInstallationStarted); +} + +Component.prototype.onInstallationStarted = function() +{ + if (component.updateRequested() || component.installationRequested()) { + if (installer.value("os") == "win") + component.installerbaseBinaryPath = "@TargetDir@/tempmaintenancetool.exe"; + installer.setInstallerBaseBinary(component.installerbaseBinaryPath); + } +} + +Component.prototype.createOperations = function() +{ + // call the base createOperations + component.createOperations(); + + // only for windows online installer + if ( installer.value("os") == "win" && !installer.isOfflineOnly() ) + { + // shortcut to add or remove packages + component.addOperation( "CreateShortcut", + "@TargetDir@/maintenancetool.exe", + "@StartMenuDir@/Manage vcpkg.lnk", + " --manage-packages"); + // shortcut to update packages + component.addOperation( "CreateShortcut", + "@TargetDir@/maintenancetool.exe", + "@StartMenuDir@/Update vcpkg.lnk", + " --updater"); + } + + // create uninstall link only for windows + if (installer.value("os") == "win") + { + // shortcut to uninstaller + component.addOperation( "CreateShortcut", + "@TargetDir@/maintenancetool.exe", + "@StartMenuDir@/Uninstall vcpkg.lnk", + " --uninstall"); + } +} + diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/ports.cmake b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/ports.cmake new file mode 100644 index 000000000..4adb48149 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/ports.cmake @@ -0,0 +1,191 @@ +cmake_minimum_required(VERSION 3.5) + +set(SCRIPTS "${CMAKE_CURRENT_LIST_DIR}" CACHE PATH "Location to stored scripts") +include("${SCRIPTS}/cmake/z_vcpkg_function_arguments.cmake") + +function(debug_message) + if(PORT_DEBUG) + z_vcpkg_function_arguments(ARGS) + list(JOIN ARGS " " ARG_STRING) + message(STATUS "[DEBUG] " "${ARG_STRING}") + endif() +endfunction() +function(z_vcpkg_deprecation_message) + z_vcpkg_function_arguments(ARGS) + list(JOIN ARGS " " ARG_STRING) + message(DEPRECATION "${ARG_STRING}") +endfunction() + +option(_VCPKG_PROHIBIT_BACKCOMPAT_FEATURES "Controls whether use of a backcompat only support feature fails the build.") +if (_VCPKG_PROHIBIT_BACKCOMPAT_FEATURES) + set(Z_VCPKG_BACKCOMPAT_MESSAGE_LEVEL "FATAL_ERROR") +else() + set(Z_VCPKG_BACKCOMPAT_MESSAGE_LEVEL "WARNING") +endif() + +list(APPEND CMAKE_MODULE_PATH "${SCRIPTS}/cmake") +include("${SCRIPTS}/cmake/vcpkg_minimum_required.cmake") +vcpkg_minimum_required(VERSION 2021-01-13) + +file(TO_CMAKE_PATH "${BUILDTREES_DIR}" BUILDTREES_DIR) +file(TO_CMAKE_PATH "${PACKAGES_DIR}" PACKAGES_DIR) + +set(CURRENT_INSTALLED_DIR "${_VCPKG_INSTALLED_DIR}/${TARGET_TRIPLET}" CACHE PATH "Location to install final packages") + +if(PORT) + set(CURRENT_BUILDTREES_DIR "${BUILDTREES_DIR}/${PORT}") + set(CURRENT_PACKAGES_DIR "${PACKAGES_DIR}/${PORT}_${TARGET_TRIPLET}") +endif() + +if(CMD MATCHES "^BUILD$") + set(CMAKE_TRIPLET_FILE "${TARGET_TRIPLET_FILE}") + if(NOT EXISTS "${CMAKE_TRIPLET_FILE}") + message(FATAL_ERROR "Unsupported target triplet. Triplet file does not exist: ${CMAKE_TRIPLET_FILE}") + endif() + + if(NOT DEFINED CURRENT_PORT_DIR) + message(FATAL_ERROR "CURRENT_PORT_DIR was not defined") + endif() + file(TO_CMAKE_PATH "${CURRENT_PORT_DIR}" CURRENT_PORT_DIR) + if(NOT EXISTS "${CURRENT_PORT_DIR}") + message(FATAL_ERROR "Cannot find port: ${PORT}\n Directory does not exist: ${CURRENT_PORT_DIR}") + endif() + if(NOT EXISTS "${CURRENT_PORT_DIR}/portfile.cmake") + message(FATAL_ERROR "Port is missing portfile: ${CURRENT_PORT_DIR}/portfile.cmake") + endif() + if(NOT EXISTS "${CURRENT_PORT_DIR}/CONTROL" AND NOT EXISTS "${CURRENT_PORT_DIR}/vcpkg.json") + message(FATAL_ERROR "Port is missing control or manifest file: ${CURRENT_PORT_DIR}/{CONTROL,vcpkg.json}") + endif() + + unset(PACKAGES_DIR) + unset(BUILDTREES_DIR) + + # NOTE: this was originally done by emptying out ${CURRENT_PACKAGES_DIR} + # using file(GLOB). This fails with files containing either `;` or `[`: + # as a best effort to support these files, this now just deletes the entire directory. + if(EXISTS "${CURRENT_PACKAGES_DIR}") + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}") + if(EXISTS "${CURRENT_PACKAGES_DIR}") + message(FATAL_ERROR "Unable to remove directory: ${CURRENT_PACKAGES_DIR}\n Files are likely in use.") + endif() + endif() + file(MAKE_DIRECTORY "${CURRENT_BUILDTREES_DIR}" "${CURRENT_PACKAGES_DIR}") + + include("${CMAKE_TRIPLET_FILE}") + + if (DEFINED VCPKG_PORT_CONFIGS) + foreach(VCPKG_PORT_CONFIG IN LISTS VCPKG_PORT_CONFIGS) + include("${VCPKG_PORT_CONFIG}") + endforeach() + endif() + + set(HOST_TRIPLET "${_HOST_TRIPLET}") + set(CURRENT_HOST_INSTALLED_DIR "${_VCPKG_INSTALLED_DIR}/${HOST_TRIPLET}" CACHE PATH "Location to install final packages for the host") + + set(TRIPLET_SYSTEM_ARCH "${VCPKG_TARGET_ARCHITECTURE}") + include("${SCRIPTS}/cmake/vcpkg_common_definitions.cmake") + include("${SCRIPTS}/cmake/execute_process.cmake") + include("${SCRIPTS}/cmake/vcpkg_acquire_msys.cmake") + include("${SCRIPTS}/cmake/vcpkg_add_to_path.cmake") + include("${SCRIPTS}/cmake/vcpkg_apply_patches.cmake") + include("${SCRIPTS}/cmake/vcpkg_build_cmake.cmake") + include("${SCRIPTS}/cmake/vcpkg_build_gn.cmake") + include("${SCRIPTS}/cmake/vcpkg_build_make.cmake") + include("${SCRIPTS}/cmake/vcpkg_build_msbuild.cmake") + include("${SCRIPTS}/cmake/vcpkg_build_ninja.cmake") + include("${SCRIPTS}/cmake/vcpkg_build_nmake.cmake") + include("${SCRIPTS}/cmake/vcpkg_build_qmake.cmake") + include("${SCRIPTS}/cmake/vcpkg_buildpath_length_warning.cmake") + include("${SCRIPTS}/cmake/vcpkg_check_features.cmake") + include("${SCRIPTS}/cmake/vcpkg_check_linkage.cmake") + include("${SCRIPTS}/cmake/vcpkg_clean_executables_in_bin.cmake") + include("${SCRIPTS}/cmake/vcpkg_clean_msbuild.cmake") + include("${SCRIPTS}/cmake/vcpkg_configure_cmake.cmake") + include("${SCRIPTS}/cmake/vcpkg_configure_gn.cmake") + include("${SCRIPTS}/cmake/vcpkg_configure_make.cmake") + include("${SCRIPTS}/cmake/vcpkg_configure_meson.cmake") + include("${SCRIPTS}/cmake/vcpkg_configure_qmake.cmake") + include("${SCRIPTS}/cmake/vcpkg_copy_pdbs.cmake") + include("${SCRIPTS}/cmake/vcpkg_copy_tool_dependencies.cmake") + include("${SCRIPTS}/cmake/vcpkg_copy_tools.cmake") + include("${SCRIPTS}/cmake/vcpkg_download_distfile.cmake") + include("${SCRIPTS}/cmake/vcpkg_execute_build_process.cmake") + include("${SCRIPTS}/cmake/vcpkg_execute_required_process.cmake") + include("${SCRIPTS}/cmake/vcpkg_execute_required_process_repeat.cmake") + include("${SCRIPTS}/cmake/vcpkg_extract_source_archive.cmake") + include("${SCRIPTS}/cmake/vcpkg_extract_source_archive_ex.cmake") + include("${SCRIPTS}/cmake/vcpkg_fail_port_install.cmake") + include("${SCRIPTS}/cmake/vcpkg_find_acquire_program.cmake") + include("${SCRIPTS}/cmake/vcpkg_fixup_cmake_targets.cmake") + include("${SCRIPTS}/cmake/vcpkg_fixup_pkgconfig.cmake") + include("${SCRIPTS}/cmake/vcpkg_from_bitbucket.cmake") + include("${SCRIPTS}/cmake/vcpkg_from_git.cmake") + include("${SCRIPTS}/cmake/vcpkg_from_github.cmake") + include("${SCRIPTS}/cmake/vcpkg_from_gitlab.cmake") + include("${SCRIPTS}/cmake/vcpkg_from_sourceforge.cmake") + include("${SCRIPTS}/cmake/vcpkg_get_program_files_platform_bitness.cmake") + include("${SCRIPTS}/cmake/vcpkg_get_windows_sdk.cmake") + include("${SCRIPTS}/cmake/vcpkg_install_cmake.cmake") + include("${SCRIPTS}/cmake/vcpkg_install_gn.cmake") + include("${SCRIPTS}/cmake/vcpkg_install_make.cmake") + include("${SCRIPTS}/cmake/vcpkg_install_meson.cmake") + include("${SCRIPTS}/cmake/vcpkg_install_msbuild.cmake") + include("${SCRIPTS}/cmake/vcpkg_install_nmake.cmake") + include("${SCRIPTS}/cmake/vcpkg_install_qmake.cmake") + include("${SCRIPTS}/cmake/vcpkg_internal_get_cmake_vars.cmake") + include("${SCRIPTS}/cmake/vcpkg_replace_string.cmake") + include("${SCRIPTS}/cmake/vcpkg_test_cmake.cmake") + + include("${SCRIPTS}/cmake/z_vcpkg_apply_patches.cmake") + include("${SCRIPTS}/cmake/z_vcpkg_prettify_command_line.cmake") + + include("${CURRENT_PORT_DIR}/portfile.cmake") + if(DEFINED PORT) + include("${SCRIPTS}/build_info.cmake") + endif() +elseif(CMD MATCHES "^CREATE$") + file(TO_NATIVE_PATH "${VCPKG_ROOT_DIR}" NATIVE_VCPKG_ROOT_DIR) + file(TO_NATIVE_PATH "${DOWNLOADS}" NATIVE_DOWNLOADS) + if(NOT DEFINED PORT_PATH) + set(PORT_PATH "${VCPKG_ROOT_DIR}/ports/${PORT}") + endif() + file(TO_NATIVE_PATH "${PORT_PATH}" NATIVE_PORT_PATH) + set(PORTFILE_PATH "${PORT_PATH}/portfile.cmake") + file(TO_NATIVE_PATH "${PORTFILE_PATH}" NATIVE_PORTFILE_PATH) + set(MANIFEST_PATH "${PORT_PATH}/vcpkg.json") + file(TO_NATIVE_PATH "${MANIFEST_PATH}" NATIVE_MANIFEST_PATH) + + if(EXISTS "${PORTFILE_PATH}") + message(FATAL_ERROR "Portfile already exists: '${NATIVE_PORTFILE_PATH}'") + endif() + if(NOT FILENAME) + get_filename_component(FILENAME "${URL}" NAME) + endif() + string(REGEX REPLACE "(\\.(zip|gz|tar|tgz|bz2))+\$" "" ROOT_NAME "${FILENAME}") + + set(DOWNLOAD_PATH "${DOWNLOADS}/${FILENAME}") + file(TO_NATIVE_PATH "${DOWNLOAD_PATH}" NATIVE_DOWNLOAD_PATH) + + if(EXISTS "${DOWNLOAD_PATH}") + message(STATUS "Using pre-downloaded: ${NATIVE_DOWNLOAD_PATH}") + message(STATUS "If this is not desired, delete the file and ${NATIVE_PORT_PATH}") + else() + include(vcpkg_download_distfile) + set(_VCPKG_INTERNAL_NO_HASH_CHECK ON) + vcpkg_download_distfile(ARCHIVE + URLS "${URL}" + FILENAME "${FILENAME}" + ) + set(_VCPKG_INTERNAL_NO_HASH_CHECK OFF) + endif() + file(SHA512 "${DOWNLOAD_PATH}" SHA512) + + file(MAKE_DIRECTORY "${PORT_PATH}") + configure_file("${SCRIPTS}/templates/portfile.in.cmake" "${PORTFILE_PATH}" @ONLY) + configure_file("${SCRIPTS}/templates/vcpkg.json.in" "${MANIFEST_PATH}" @ONLY) + + message(STATUS "Generated portfile: ${NATIVE_PORTFILE_PATH}") + message(STATUS "Generated manifest: ${NATIVE_MANIFEST_PATH}") + message(STATUS "To launch an editor for these new files, run") + message(STATUS " .\\vcpkg edit ${PORT}") +endif() diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/posh-vcpkg/0.0.1/posh-vcpkg.psd1 b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/posh-vcpkg/0.0.1/posh-vcpkg.psd1 new file mode 100644 index 000000000..3fb94fe7d --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/posh-vcpkg/0.0.1/posh-vcpkg.psd1 @@ -0,0 +1,31 @@ +@{
+
+# Script module or binary module file associated with this manifest.
+ModuleToProcess = 'posh-vcpkg.psm1'
+
+# Version number of this module.
+ModuleVersion = '0.0.1'
+
+# ID used to uniquely identify this module
+GUID = '948f02ab-fc99-4a53-8335-b6556eef129b'
+
+# Minimum version of the Windows PowerShell engine required by this module
+PowerShellVersion = '5.0'
+
+FunctionsToExport = @('TabExpansion')
+CmdletsToExport = @()
+VariablesToExport = @()
+AliasesToExport = @()
+
+# Private data to pass to the module specified in RootModule/ModuleToProcess.
+# This may also contain a PSData hashtable with additional module metadata used by PowerShell.
+PrivateData =
+@{
+ PSData =
+ @{
+ # Tags applied to this module. These help with module discovery in online galleries.
+ Tags = @('vcpkg', 'tab', 'tab-completion', 'tab-expansion', 'tabexpansion')
+ }
+}
+
+}
diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/posh-vcpkg/0.0.1/posh-vcpkg.psm1 b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/posh-vcpkg/0.0.1/posh-vcpkg.psm1 new file mode 100644 index 000000000..25ef99609 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/posh-vcpkg/0.0.1/posh-vcpkg.psm1 @@ -0,0 +1,39 @@ +param()
+
+if (Get-Module posh-vcpkg) { return }
+
+if ($PSVersionTable.PSVersion.Major -lt 5) {
+ Write-Warning ("posh-vcpkg does not support PowerShell versions before 5.0.")
+ return
+}
+
+if (Test-Path Function:\TabExpansion) {
+ Rename-Item Function:\TabExpansion VcpkgTabExpansionBackup
+}
+
+function TabExpansion($line, $lastWord) {
+ $lastBlock = [regex]::Split($line, '[|;]')[-1].TrimStart()
+
+ switch -regex ($lastBlock) {
+ "^(?<vcpkgexe>(\./|\.\\|)vcpkg(\.exe|)) (?<remaining>.*)$"
+ {
+ & $matches['vcpkgexe'] autocomplete $matches['remaining']
+ return
+ }
+
+ # Fall back on existing tab expansion
+ default {
+ if (Test-Path Function:\VcpkgTabExpansionBackup) {
+ VcpkgTabExpansionBackup $line $lastWord
+ }
+ }
+ }
+}
+
+$exportModuleMemberParams = @{
+ Function = @(
+ 'TabExpansion'
+ )
+}
+
+Export-ModuleMember @exportModuleMemberParams
diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/templates/portfile.in.cmake b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/templates/portfile.in.cmake new file mode 100644 index 000000000..5cd363ddc --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/templates/portfile.in.cmake @@ -0,0 +1,77 @@ +# Common Ambient Variables: +# CURRENT_BUILDTREES_DIR = ${VCPKG_ROOT_DIR}\buildtrees\${PORT} +# CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET} +# CURRENT_PORT_DIR = ${VCPKG_ROOT_DIR}\ports\${PORT} +# CURRENT_INSTALLED_DIR = ${VCPKG_ROOT_DIR}\installed\${TRIPLET} +# DOWNLOADS = ${VCPKG_ROOT_DIR}\downloads +# PORT = current port name (zlib, etc) +# TARGET_TRIPLET = current triplet (x86-windows, x64-windows-static, etc) +# VCPKG_CRT_LINKAGE = C runtime linkage type (static, dynamic) +# VCPKG_LIBRARY_LINKAGE = target library linkage type (static, dynamic) +# VCPKG_ROOT_DIR = <C:\path\to\current\vcpkg> +# VCPKG_TARGET_ARCHITECTURE = target architecture (x64, x86, arm) +# VCPKG_TOOLCHAIN = ON OFF +# TRIPLET_SYSTEM_ARCH = arm x86 x64 +# BUILD_ARCH = "Win32" "x64" "ARM" +# MSBUILD_PLATFORM = "Win32"/"x64"/${TRIPLET_SYSTEM_ARCH} +# DEBUG_CONFIG = "Debug Static" "Debug Dll" +# RELEASE_CONFIG = "Release Static"" "Release DLL" +# VCPKG_TARGET_IS_WINDOWS +# VCPKG_TARGET_IS_UWP +# VCPKG_TARGET_IS_LINUX +# VCPKG_TARGET_IS_OSX +# VCPKG_TARGET_IS_FREEBSD +# VCPKG_TARGET_IS_ANDROID +# VCPKG_TARGET_IS_MINGW +# VCPKG_TARGET_EXECUTABLE_SUFFIX +# VCPKG_TARGET_STATIC_LIBRARY_SUFFIX +# VCPKG_TARGET_SHARED_LIBRARY_SUFFIX +# +# See additional helpful variables in /docs/maintainers/vcpkg_common_definitions.md + +# # Specifies if the port install should fail immediately given a condition +# vcpkg_fail_port_install(MESSAGE "@PORT@ currently only supports Linux and Mac platforms" ON_TARGET "Windows") + +vcpkg_download_distfile(ARCHIVE + URLS "@URL@" + FILENAME "@FILENAME@" + SHA512 @SHA512@ +) + +vcpkg_extract_source_archive_ex( + OUT_SOURCE_PATH SOURCE_PATH + ARCHIVE ${ARCHIVE} + # (Optional) A friendly name to use instead of the filename of the archive (e.g.: a version number or tag). + # REF 1.0.0 + # (Optional) Read the docs for how to generate patches at: + # https://github.com/Microsoft/vcpkg/blob/master/docs/examples/patching.md + # PATCHES + # 001_port_fixes.patch + # 002_more_port_fixes.patch +) + +# # Check if one or more features are a part of a package installation. +# # See /docs/maintainers/vcpkg_check_features.md for more details +# vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS +# FEATURES # <- Keyword FEATURES is required because INVERTED_FEATURES are being used +# tbb WITH_TBB +# INVERTED_FEATURES +# tbb ROCKSDB_IGNORE_PACKAGE_TBB +# ) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA # Disable this option if project cannot be built with Ninja + # OPTIONS -DUSE_THIS_IN_ALL_BUILDS=1 -DUSE_THIS_TOO=2 + # OPTIONS_RELEASE -DOPTIMIZE=1 + # OPTIONS_DEBUG -DDEBUGGABLE=1 +) + +vcpkg_install_cmake() + +# # Moves all .cmake files from /debug/share/@PORT@/ to /share/@PORT@/ +# # See /docs/maintainers/vcpkg_fixup_cmake_targets.md for more details +# vcpkg_fixup_cmake_targets(CONFIG_PATH cmake TARGET_PATH share/@PORT@) + +# # Handle copyright +# file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/@PORT@ RENAME copyright) diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/templates/vcpkg.json.in b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/templates/vcpkg.json.in new file mode 100644 index 000000000..2e217387e --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/templates/vcpkg.json.in @@ -0,0 +1,16 @@ +{ + "name": "@PORT@", + "version-string": "", + "homepage": "", + "description": "", + "dependencies": [], + + "default-features": [], + "features": [ + { + "name": "", + "description": "", + "dependencies": [] + } + ] +} diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/test_ports/cmake/portfile.cmake b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/test_ports/cmake/portfile.cmake new file mode 100644 index 000000000..9df7b3f43 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/test_ports/cmake/portfile.cmake @@ -0,0 +1,63 @@ +set(VCPKG_POLICY_EMPTY_INCLUDE_FOLDER enabled) +vcpkg_from_gitlab( + GITLAB_URL https://gitlab.kitware.com/ + OUT_SOURCE_PATH SOURCE_PATH + REPO cmake/cmake + REF + b7b0fb430397bafae4a7bd80b41d474c91a3b7f3 + SHA512 + 3b0de26910bceaf4bc6546255bada4c502cd0fd32f44bc28b067f347c09d028c175a3243551bbe4bb64bcf312df9ff827e8fdbcb0b34a12e1ce4a26ba0799ee2 + HEAD_REF master +) + +if(NOT VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_UWP) + set(BUILD_CURSES_DIALOG ON) +endif() + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + -DBUILD_TESTING=OFF + #-DCMAKE_USE_SYSTEM_LIBRARIES=ON + -DCMAKE_USE_SYSTEM_LIBARCHIVE=ON + -DCMAKE_USE_SYSTEM_CURL=ON + -DCMAKE_USE_SYSTEM_EXPAT=ON + -DCMAKE_USE_SYSTEM_ZLIB=ON + -DCMAKE_USE_SYSTEM_BZIP2=ON + -DCMAKE_USE_SYSTEM_ZSTD=ON + -DCMAKE_USE_SYSTEM_FORM=ON + -DCMAKE_USE_SYSTEM_JSONCPP=ON + -DCMAKE_USE_SYSTEM_LIBRHASH=OFF # not yet in VCPKG + -DCMAKE_USE_SYSTEM_LIBUV=ON + -DBUILD_CursesDialog=${BUILD_CURSES_DIALOG} + -DBUILD_QtDialog=ON # Just to test Qt with CMake +) + +vcpkg_install_cmake(ADD_BIN_TO_PATH) +vcpkg_copy_pdbs() + +if(NOT VCPKG_TARGET_IS_OSX) + set(_tools cmake cmake-gui ctest cpack) + if(VCPKG_TARGET_IS_WINDOWS) + list(APPEND _tools cmcldeps) + endif() + if(BUILD_CURSES_DIALOG) + list(APPEND _tools ccmake) + endif() + vcpkg_copy_tools(TOOL_NAMES ${_tools} AUTO_CLEAN) +else() + # On OSX everything is within a CMake.app folder + file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/tools) + file(RENAME "${CURRENT_PACKAGES_DIR}/CMake.app" "${CURRENT_PACKAGES_DIR}/tools/CMake.app") + if(EXISTS "${CURRENT_PACKAGES_DIR}/debug/CMake.app") + file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/tools/debug) + file(RENAME "${CURRENT_PACKAGES_DIR}/debug/CMake.app" "${CURRENT_PACKAGES_DIR}/tools/debug/CMake.app") + endif() +endif() + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug) + +# Handle copyright +configure_file(${SOURCE_PATH}/Copyright.txt ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY) diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/test_ports/cmake/vcpkg.json b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/test_ports/cmake/vcpkg.json new file mode 100644 index 000000000..c2c4d9752 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/test_ports/cmake/vcpkg.json @@ -0,0 +1,27 @@ +{ + "name": "cmake", + "version-string": "3.20.0", + "description": "CMake is an open-source, cross-platform family of tools designed to build, test and package software.", + "homepage": "https://cmake.org/", + "dependencies": [ + "bzip2", + "curl", + "expat", + "jsoncpp", + "libarchive", + "liblzma", + "libuv", + { + "name": "ncurses", + "platform": "!(windows | uwp)" + }, + "nghttp2", + "qt5-base", + { + "name": "qt5-winextras", + "platform": "windows" + }, + "zlib", + "zstd" + ] +} diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/test_ports/llfio-run-tests/CONTROL b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/test_ports/llfio-run-tests/CONTROL new file mode 100644 index 000000000..eeac83f91 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/test_ports/llfio-run-tests/CONTROL @@ -0,0 +1,5 @@ +Source: llfio-run-tests +Version: 0 +Description: Ensures that LLFIO built with vcpkg version of dependencies produces working executables. +Build-Depends: llfio[run-tests], llfio[status-code,run-tests] +Supports: x64 diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/test_ports/llfio-run-tests/portfile.cmake b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/test_ports/llfio-run-tests/portfile.cmake new file mode 100644 index 000000000..065116c27 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/test_ports/llfio-run-tests/portfile.cmake @@ -0,0 +1 @@ +set(VCPKG_POLICY_EMPTY_PACKAGE enabled) diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/test_ports/outcome-run-tests/CONTROL b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/test_ports/outcome-run-tests/CONTROL new file mode 100644 index 000000000..bc289efab --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/test_ports/outcome-run-tests/CONTROL @@ -0,0 +1,5 @@ +Source: outcome-run-tests +Version: 0 +Description: Ensures that outcome built with vcpkg version of dependencies produces working executables. +Build-Depends: outcome[run-tests] +Supports: x64 diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/test_ports/outcome-run-tests/portfile.cmake b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/test_ports/outcome-run-tests/portfile.cmake new file mode 100644 index 000000000..065116c27 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/test_ports/outcome-run-tests/portfile.cmake @@ -0,0 +1 @@ +set(VCPKG_POLICY_EMPTY_PACKAGE enabled) diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/test_ports/vcpkg-acquire-msys-test/CONTROL b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/test_ports/vcpkg-acquire-msys-test/CONTROL new file mode 100644 index 000000000..47859b076 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/test_ports/vcpkg-acquire-msys-test/CONTROL @@ -0,0 +1,4 @@ +Source: vcpkg-acquire-msys-test
+Version: 0
+Description: Test port to exercise vcpkg_acquire_msys
+Supports: x86 & windows
diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/test_ports/vcpkg-acquire-msys-test/portfile.cmake b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/test_ports/vcpkg-acquire-msys-test/portfile.cmake new file mode 100644 index 000000000..7095dc682 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/test_ports/vcpkg-acquire-msys-test/portfile.cmake @@ -0,0 +1,3 @@ +set(VCPKG_POLICY_EMPTY_PACKAGE enabled)
+
+vcpkg_acquire_msys(MSYS_ROOT Z_ALL_PACKAGES)
diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/test_ports/vcpkg-ci-ffmpeg/CONTROL b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/test_ports/vcpkg-ci-ffmpeg/CONTROL new file mode 100644 index 000000000..78687c423 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/test_ports/vcpkg-ci-ffmpeg/CONTROL @@ -0,0 +1,5 @@ +Source: vcpkg-ci-ffmpeg
+Version: 1
+Homepage: https://github.com/microsoft/vcpkg
+Description: Port to force features of certain ports within CI
+Build-Depends: ffmpeg[all-nonfree]
diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/test_ports/vcpkg-ci-ffmpeg/portfile.cmake b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/test_ports/vcpkg-ci-ffmpeg/portfile.cmake new file mode 100644 index 000000000..0015715fb --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/test_ports/vcpkg-ci-ffmpeg/portfile.cmake @@ -0,0 +1 @@ +set(VCPKG_POLICY_EMPTY_PACKAGE enabled)
\ No newline at end of file diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/test_ports/vcpkg-ci-opencv/CONTROL b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/test_ports/vcpkg-ci-opencv/CONTROL new file mode 100644 index 000000000..46e451828 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/test_ports/vcpkg-ci-opencv/CONTROL @@ -0,0 +1,6 @@ +Source: vcpkg-ci-opencv
+Version: 1
+Port-Version: 2
+Homepage: https://github.com/microsoft/vcpkg
+Description: Port to force features of certain ports within CI
+Build-Depends: opencv[core,nonfree,ade,contrib,dnn,eigen,ffmpeg,gdcm,ipp,jasper,jpeg,lapack,openexr,opengl,openmp,png,qt,sfm,tiff,vtk,webp](!uwp&!(windows&(arm|arm64))), opencv[core,nonfree,ade,contrib,dnn,eigen,ffmpeg,jpeg,png,tiff,webp](uwp|(windows&(arm|arm64)))
diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/test_ports/vcpkg-ci-opencv/portfile.cmake b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/test_ports/vcpkg-ci-opencv/portfile.cmake new file mode 100644 index 000000000..0015715fb --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/test_ports/vcpkg-ci-opencv/portfile.cmake @@ -0,0 +1 @@ +set(VCPKG_POLICY_EMPTY_PACKAGE enabled)
\ No newline at end of file diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/test_ports/vcpkg-ci-paraview/CONTROL b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/test_ports/vcpkg-ci-paraview/CONTROL new file mode 100644 index 000000000..137750842 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/test_ports/vcpkg-ci-paraview/CONTROL @@ -0,0 +1,6 @@ +Source: vcpkg-ci-paraview
+Version: 1
+Port-Version: 2
+Homepage: https://github.com/microsoft/vcpkg
+Description: Port to force features of certain ports within CI
+Build-Depends: paraview[core,vtkm,tools](!(x86&windows)), paraview[core,tools](x86&windows)
diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/test_ports/vcpkg-ci-paraview/portfile.cmake b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/test_ports/vcpkg-ci-paraview/portfile.cmake new file mode 100644 index 000000000..0015715fb --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/test_ports/vcpkg-ci-paraview/portfile.cmake @@ -0,0 +1 @@ +set(VCPKG_POLICY_EMPTY_PACKAGE enabled)
\ No newline at end of file diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/test_ports/vcpkg-find-acquire-program/CONTROL b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/test_ports/vcpkg-find-acquire-program/CONTROL new file mode 100644 index 000000000..6f248be58 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/test_ports/vcpkg-find-acquire-program/CONTROL @@ -0,0 +1,4 @@ +Source: vcpkg-find-acquire-program
+Version: 0
+Description: Test port to exercise vcpkg_find_acquire_program
+Supports: windows
diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/test_ports/vcpkg-find-acquire-program/portfile.cmake b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/test_ports/vcpkg-find-acquire-program/portfile.cmake new file mode 100644 index 000000000..88a4856c5 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/test_ports/vcpkg-find-acquire-program/portfile.cmake @@ -0,0 +1,21 @@ +set(VCPKG_POLICY_EMPTY_PACKAGE enabled)
+
+if(CMAKE_HOST_WIN32)
+ foreach(PROG GO JOM NASM PERL YASM GIT PYTHON3 PYTHON2 RUBY 7Z NUGET FLEX BISON GPERF GASPREPROCESSOR DARK SCONS SWIG DOXYGEN ARIA2 PKGCONFIG)
+ vcpkg_find_acquire_program(${PROG})
+ foreach(SUBPROG IN LISTS ${PROG})
+ if(NOT EXISTS "${SUBPROG}")
+ message(FATAL_ERROR "Program ${SUBPROG} did not exist.")
+ endif()
+ endforeach()
+ endforeach()
+endif()
+
+foreach(PROG GN NINJA MESON BAZEL)
+ vcpkg_find_acquire_program(${PROG})
+ foreach(SUBPROG IN LISTS ${PROG})
+ if(NOT EXISTS "${SUBPROG}")
+ message(FATAL_ERROR "Program ${SUBPROG} did not exist.")
+ endif()
+ endforeach()
+endforeach()
diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/testing/version-files/default-baseline-1/vcpkg.json b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/testing/version-files/default-baseline-1/vcpkg.json new file mode 100644 index 000000000..51e65c82c --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/testing/version-files/default-baseline-1/vcpkg.json @@ -0,0 +1,8 @@ +{ + "name": "default-baseline-test", + "version-string": "0", + "builtin-baseline": "fca18ba3572f8aebe3b8158c359db62a7e26134e", + "dependencies": [ + "zlib" + ] +}
\ No newline at end of file diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/testing/version-files/default-baseline-2/vcpkg.json b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/testing/version-files/default-baseline-2/vcpkg.json new file mode 100644 index 000000000..34f443458 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/testing/version-files/default-baseline-2/vcpkg.json @@ -0,0 +1,8 @@ +{ + "name": "default-baseline-test-2", + "version-string": "0", + "builtin-baseline": "d5cd6b8c74ee548cfc9ff83cefdac4843cc1503f", + "dependencies": [ + "zlib" + ] +} diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/testing/version-files/default-baseline-2/versions/z-/zlib.json b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/testing/version-files/default-baseline-2/versions/z-/zlib.json new file mode 100644 index 000000000..f5ee7cb9d --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/testing/version-files/default-baseline-2/versions/z-/zlib.json @@ -0,0 +1,14 @@ +{ + "versions": [ + { + "git-tree": "7bb2b2f3783303a4dd41163553fe4cc103dc9262", + "version-string": "1.2.11", + "port-version": 9 + }, + { + "git-tree": "4927735fa9baca564ebddf6e6880de344b20d7a8", + "version-string": "1.2.11", + "port-version": 8 + } + ] +}
\ No newline at end of file diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/testing/version-files/ports/cat/portfile.cmake b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/testing/version-files/ports/cat/portfile.cmake new file mode 100644 index 000000000..0015715fb --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/testing/version-files/ports/cat/portfile.cmake @@ -0,0 +1 @@ +set(VCPKG_POLICY_EMPTY_PACKAGE enabled)
\ No newline at end of file diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/testing/version-files/ports/cat/vcpkg.json b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/testing/version-files/ports/cat/vcpkg.json new file mode 100644 index 000000000..b87e4a2da --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/testing/version-files/ports/cat/vcpkg.json @@ -0,0 +1,4 @@ +{
+ "name": "cat",
+ "version": "1.0"
+}
\ No newline at end of file diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/testing/version-files/ports/dog/portfile.cmake b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/testing/version-files/ports/dog/portfile.cmake new file mode 100644 index 000000000..0015715fb --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/testing/version-files/ports/dog/portfile.cmake @@ -0,0 +1 @@ +set(VCPKG_POLICY_EMPTY_PACKAGE enabled)
\ No newline at end of file diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/testing/version-files/ports/dog/vcpkg.json b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/testing/version-files/ports/dog/vcpkg.json new file mode 100644 index 000000000..028447b3e --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/testing/version-files/ports/dog/vcpkg.json @@ -0,0 +1,4 @@ +{
+ "name": "dog",
+ "version-date": "2001-01-01"
+}
\ No newline at end of file diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/testing/version-files/ports/duck/portfile.cmake b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/testing/version-files/ports/duck/portfile.cmake new file mode 100644 index 000000000..0015715fb --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/testing/version-files/ports/duck/portfile.cmake @@ -0,0 +1 @@ +set(VCPKG_POLICY_EMPTY_PACKAGE enabled)
\ No newline at end of file diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/testing/version-files/ports/duck/vcpkg.json b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/testing/version-files/ports/duck/vcpkg.json new file mode 100644 index 000000000..d780d01bf --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/testing/version-files/ports/duck/vcpkg.json @@ -0,0 +1,4 @@ +{
+ "name": "duck",
+ "version-string": "mallard"
+}
\ No newline at end of file diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/testing/version-files/ports/mouse/portfile.cmake b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/testing/version-files/ports/mouse/portfile.cmake new file mode 100644 index 000000000..0015715fb --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/testing/version-files/ports/mouse/portfile.cmake @@ -0,0 +1 @@ +set(VCPKG_POLICY_EMPTY_PACKAGE enabled)
\ No newline at end of file diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/testing/version-files/ports/mouse/vcpkg.json b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/testing/version-files/ports/mouse/vcpkg.json new file mode 100644 index 000000000..fd6cab451 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/testing/version-files/ports/mouse/vcpkg.json @@ -0,0 +1,4 @@ +{
+ "name": "mouse",
+ "version-semver": "1.0.0"
+}
\ No newline at end of file diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/testing/version-files/ports_incomplete/cat/portfile.cmake b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/testing/version-files/ports_incomplete/cat/portfile.cmake new file mode 100644 index 000000000..0015715fb --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/testing/version-files/ports_incomplete/cat/portfile.cmake @@ -0,0 +1 @@ +set(VCPKG_POLICY_EMPTY_PACKAGE enabled)
\ No newline at end of file diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/testing/version-files/ports_incomplete/cat/vcpkg.json b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/testing/version-files/ports_incomplete/cat/vcpkg.json new file mode 100644 index 000000000..d8b8fd81e --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/testing/version-files/ports_incomplete/cat/vcpkg.json @@ -0,0 +1,4 @@ +{ + "name": "cat", + "version": "1.0" +} diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/testing/version-files/ports_incomplete/dog/portfile.cmake b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/testing/version-files/ports_incomplete/dog/portfile.cmake new file mode 100644 index 000000000..0015715fb --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/testing/version-files/ports_incomplete/dog/portfile.cmake @@ -0,0 +1 @@ +set(VCPKG_POLICY_EMPTY_PACKAGE enabled)
\ No newline at end of file diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/testing/version-files/ports_incomplete/dog/vcpkg.json b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/testing/version-files/ports_incomplete/dog/vcpkg.json new file mode 100644 index 000000000..847857f6c --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/testing/version-files/ports_incomplete/dog/vcpkg.json @@ -0,0 +1,5 @@ +{ + "name": "dog", + "version-date": "2001-01-01", + "port-version": 1 +} diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/testing/version-files/ports_incomplete/duck/portfile.cmake b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/testing/version-files/ports_incomplete/duck/portfile.cmake new file mode 100644 index 000000000..0015715fb --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/testing/version-files/ports_incomplete/duck/portfile.cmake @@ -0,0 +1 @@ +set(VCPKG_POLICY_EMPTY_PACKAGE enabled)
\ No newline at end of file diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/testing/version-files/ports_incomplete/duck/vcpkg.json b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/testing/version-files/ports_incomplete/duck/vcpkg.json new file mode 100644 index 000000000..f6e7aba53 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/testing/version-files/ports_incomplete/duck/vcpkg.json @@ -0,0 +1,4 @@ +{ + "name": "duck", + "version-string": "mallard" +} diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/testing/version-files/ports_incomplete/ferret/portfile.cmake b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/testing/version-files/ports_incomplete/ferret/portfile.cmake new file mode 100644 index 000000000..0015715fb --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/testing/version-files/ports_incomplete/ferret/portfile.cmake @@ -0,0 +1 @@ +set(VCPKG_POLICY_EMPTY_PACKAGE enabled)
\ No newline at end of file diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/testing/version-files/ports_incomplete/ferret/vcpkg.json b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/testing/version-files/ports_incomplete/ferret/vcpkg.json new file mode 100644 index 000000000..3c444c42c --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/testing/version-files/ports_incomplete/ferret/vcpkg.json @@ -0,0 +1,4 @@ +{ + "name": "ferret", + "version": "1" +} diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/testing/version-files/ports_incomplete/fish/portfile.cmake b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/testing/version-files/ports_incomplete/fish/portfile.cmake new file mode 100644 index 000000000..0015715fb --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/testing/version-files/ports_incomplete/fish/portfile.cmake @@ -0,0 +1 @@ +set(VCPKG_POLICY_EMPTY_PACKAGE enabled)
\ No newline at end of file diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/testing/version-files/ports_incomplete/fish/vcpkg.json b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/testing/version-files/ports_incomplete/fish/vcpkg.json new file mode 100644 index 000000000..044ef8474 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/testing/version-files/ports_incomplete/fish/vcpkg.json @@ -0,0 +1,5 @@ +{ + "name": "fish", + "version-string": "1.0.0", + "description": "This description causes an intentional discrepancy between the local SHA and the SHA in fish.json for version 1.0.0" +} diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/testing/version-files/ports_incomplete/mouse/portfile.cmake b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/testing/version-files/ports_incomplete/mouse/portfile.cmake new file mode 100644 index 000000000..0015715fb --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/testing/version-files/ports_incomplete/mouse/portfile.cmake @@ -0,0 +1 @@ +set(VCPKG_POLICY_EMPTY_PACKAGE enabled)
\ No newline at end of file diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/testing/version-files/ports_incomplete/mouse/vcpkg.json b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/testing/version-files/ports_incomplete/mouse/vcpkg.json new file mode 100644 index 000000000..8cbe81f93 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/testing/version-files/ports_incomplete/mouse/vcpkg.json @@ -0,0 +1,4 @@ +{ + "name": "mouse", + "version-semver": "1.0.0" +} diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/testing/version-files/versions/baseline.json b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/testing/version-files/versions/baseline.json new file mode 100644 index 000000000..44a4764a1 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/testing/version-files/versions/baseline.json @@ -0,0 +1,20 @@ +{ + "default": { + "cat": { + "baseline": "1.0", + "port-version": 0 + }, + "dog": { + "baseline": "2001-01-01", + "port-version": 0 + }, + "duck": { + "baseline": "mallard", + "port-version": 0 + }, + "mouse": { + "baseline": "1.0.0", + "port-version": 0 + } + } +} diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/testing/version-files/versions/c-/cat.json b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/testing/version-files/versions/c-/cat.json new file mode 100644 index 000000000..e39cd6d4e --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/testing/version-files/versions/c-/cat.json @@ -0,0 +1,9 @@ +{ + "versions": [ + { + "git-tree": "5dd257451526d5b9e560f5f35d7029ba40d88587", + "version": "1.0", + "port-version": 0 + } + ] +} diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/testing/version-files/versions/d-/dog.json b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/testing/version-files/versions/d-/dog.json new file mode 100644 index 000000000..49c086c38 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/testing/version-files/versions/d-/dog.json @@ -0,0 +1,9 @@ +{ + "versions": [ + { + "git-tree": "e170a2ed0da7ba5d434c4a0a98ffd7a3159e3200", + "version-date": "2001-01-01", + "port-version": 0 + } + ] +} diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/testing/version-files/versions/d-/duck.json b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/testing/version-files/versions/d-/duck.json new file mode 100644 index 000000000..4f4b209e2 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/testing/version-files/versions/d-/duck.json @@ -0,0 +1,9 @@ +{ + "versions": [ + { + "git-tree": "0a52a9d722c75b3bfe47d5f5db6c9eb1a64af156", + "version-string": "mallard", + "port-version": 0 + } + ] +} diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/testing/version-files/versions/m-/mouse.json b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/testing/version-files/versions/m-/mouse.json new file mode 100644 index 000000000..139c8450f --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/testing/version-files/versions/m-/mouse.json @@ -0,0 +1,9 @@ +{ + "versions": [ + { + "git-tree": "55ed624191e0a1905bd97af29fdf6a1d7f4e6d7c", + "version-semver": "1.0.0", + "port-version": 0 + } + ] +} diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/testing/version-files/versions_incomplete/baseline.json b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/testing/version-files/versions_incomplete/baseline.json new file mode 100644 index 000000000..7f27e5b65 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/testing/version-files/versions_incomplete/baseline.json @@ -0,0 +1,20 @@ +{ + "default": { + "cat": { + "baseline": "1.0", + "port-version": 0 + }, + "dog": { + "baseline": "2001-01-01", + "port-version": 0 + }, + "duck": { + "baseline": "mallard", + "port-version": 0 + }, + "fish": { + "baseline": "1.0.0", + "port-version": 0 + } + } +} diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/testing/version-files/versions_incomplete/c-/cat.json b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/testing/version-files/versions_incomplete/c-/cat.json new file mode 100644 index 000000000..f7cb46693 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/testing/version-files/versions_incomplete/c-/cat.json @@ -0,0 +1,9 @@ +{ + "versions": [ + { + "git-tree": "e635ee8b3277303dfc7231d526e04f1102b56605", + "version": "1.0", + "port-version": 0 + } + ] +} diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/testing/version-files/versions_incomplete/d-/dog.json b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/testing/version-files/versions_incomplete/d-/dog.json new file mode 100644 index 000000000..49c086c38 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/testing/version-files/versions_incomplete/d-/dog.json @@ -0,0 +1,9 @@ +{ + "versions": [ + { + "git-tree": "e170a2ed0da7ba5d434c4a0a98ffd7a3159e3200", + "version-date": "2001-01-01", + "port-version": 0 + } + ] +} diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/testing/version-files/versions_incomplete/f-/fish.json b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/testing/version-files/versions_incomplete/f-/fish.json new file mode 100644 index 000000000..dc457aabd --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/testing/version-files/versions_incomplete/f-/fish.json @@ -0,0 +1,9 @@ +{
+ "versions": [
+ {
+ "git-tree": "cf3be634f203c1b4152b65ec7700d5695a1fca5c",
+ "version-string": "1.0.0",
+ "port-version": 0
+ }
+ ]
+}
\ No newline at end of file diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/testing/version-files/versions_incomplete/m-/mouse.json b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/testing/version-files/versions_incomplete/m-/mouse.json new file mode 100644 index 000000000..9b8ec6092 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/testing/version-files/versions_incomplete/m-/mouse.json @@ -0,0 +1,9 @@ +{ + "versions": [ + { + "git-tree": "f8882feb032d2aacd83340decb0966c2dacc3fd6", + "version-semver": "1.0.0", + "port-version": 0 + } + ] +} diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/testing/version-files/without-default-baseline-2/vcpkg.json b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/testing/version-files/without-default-baseline-2/vcpkg.json new file mode 100644 index 000000000..839418fb7 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/testing/version-files/without-default-baseline-2/vcpkg.json @@ -0,0 +1,7 @@ +{ + "name": "without-default-baseline-test-2", + "version-string": "0", + "dependencies": [ + "zlib" + ] +}
\ No newline at end of file diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/testing/version-files/without-default-baseline-2/versions/z-/zlib.json b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/testing/version-files/without-default-baseline-2/versions/z-/zlib.json new file mode 100644 index 000000000..f5ee7cb9d --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/testing/version-files/without-default-baseline-2/versions/z-/zlib.json @@ -0,0 +1,14 @@ +{ + "versions": [ + { + "git-tree": "7bb2b2f3783303a4dd41163553fe4cc103dc9262", + "version-string": "1.2.11", + "port-version": 9 + }, + { + "git-tree": "4927735fa9baca564ebddf6e6880de344b20d7a8", + "version-string": "1.2.11", + "port-version": 8 + } + ] +}
\ No newline at end of file diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/tls12-download.exe b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/tls12-download.exe Binary files differnew file mode 100755 index 000000000..3eff1dd4e --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/tls12-download.exe diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/toolchains/android.cmake b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/toolchains/android.cmake new file mode 100644 index 000000000..d0c989d18 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/toolchains/android.cmake @@ -0,0 +1,65 @@ +set(ANDROID_CPP_FEATURES "rtti exceptions" CACHE STRING "")
+set(CMAKE_SYSTEM_NAME Android CACHE STRING "")
+set(ANDROID_TOOLCHAIN clang CACHE STRING "")
+set(ANDROID_NATIVE_API_LEVEL ${CMAKE_SYSTEM_VERSION} CACHE STRING "")
+set(CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION clang CACHE STRING "")
+
+if (VCPKG_TARGET_TRIPLET MATCHES "^arm64-android")
+ set(ANDROID_ABI arm64-v8a CACHE STRING "")
+elseif(VCPKG_TARGET_TRIPLET MATCHES "^armv6-android")
+ set(ANDROID_ABI armeabi CACHE STRING "")
+elseif(VCPKG_TARGET_TRIPLET MATCHES "^arm-neon-android")
+ set(ANDROID_ABI armeabi-v7a CACHE STRING "")
+ set(ANDROID_ARM_NEON ON CACHE BOOL "")
+elseif(VCPKG_TARGET_TRIPLET MATCHES "^arm-android")
+ set(ANDROID_ABI armeabi-v7a CACHE STRING "")
+ set(ANDROID_ARM_NEON OFF CACHE BOOL "")
+elseif(VCPKG_TARGET_TRIPLET MATCHES "^x64-android")
+ set(ANDROID_ABI x86_64 CACHE STRING "")
+elseif(VCPKG_TARGET_TRIPLET MATCHES "^x86-android")
+ set(ANDROID_ABI x86 CACHE STRING "")
+else()
+ message(FATAL_ERROR "Unknown ABI for target triplet ${VCPKG_TARGET_TRIPLET}")
+endif()
+
+if (VCPKG_CRT_LINKAGE STREQUAL "dynamic")
+ set(ANDROID_STL c++_shared CACHE STRING "")
+else()
+ set(ANDROID_STL c++_static CACHE STRING "")
+endif()
+
+if(DEFINED ENV{ANDROID_NDK_HOME})
+ set(ANDROID_NDK_HOME $ENV{ANDROID_NDK_HOME})
+else()
+ set(ANDROID_NDK_HOME "$ENV{ProgramData}/Microsoft/AndroidNDK64/android-ndk-r13b/")
+ if(NOT EXISTS "${ANDROID_NDK_HOME}")
+ # Use Xamarin default installation folder
+ set(ANDROID_NDK_HOME "$ENV{ProgramFiles\(x86\)}/Android/android-sdk/ndk-bundle")
+ endif()
+endif()
+
+if(NOT EXISTS "${ANDROID_NDK_HOME}/build/cmake/android.toolchain.cmake")
+ message(FATAL_ERROR "Could not find android ndk. Searched at ${ANDROID_NDK_HOME}")
+endif()
+
+include("${ANDROID_NDK_HOME}/build/cmake/android.toolchain.cmake")
+
+if(NOT _VCPKG_ANDROID_TOOLCHAIN)
+ set(_VCPKG_ANDROID_TOOLCHAIN 1)
+ get_property( _CMAKE_IN_TRY_COMPILE GLOBAL PROPERTY IN_TRY_COMPILE )
+ if(NOT _CMAKE_IN_TRY_COMPILE)
+ string(APPEND CMAKE_C_FLAGS " -fPIC ${VCPKG_C_FLAGS} ")
+ string(APPEND CMAKE_CXX_FLAGS " -fPIC ${VCPKG_CXX_FLAGS} ")
+ string(APPEND CMAKE_C_FLAGS_DEBUG " ${VCPKG_C_FLAGS_DEBUG} ")
+ string(APPEND CMAKE_CXX_FLAGS_DEBUG " ${VCPKG_CXX_FLAGS_DEBUG} ")
+ string(APPEND CMAKE_C_FLAGS_RELEASE " ${VCPKG_C_FLAGS_RELEASE} ")
+ string(APPEND CMAKE_CXX_FLAGS_RELEASE " ${VCPKG_CXX_FLAGS_RELEASE} ")
+
+ string(APPEND CMAKE_SHARED_LINKER_FLAGS " ${VCPKG_LINKER_FLAGS} ")
+ string(APPEND CMAKE_EXE_LINKER_FLAGS " ${VCPKG_LINKER_FLAGS} ")
+ string(APPEND CMAKE_SHARED_LINKER_FLAGS_DEBUG " ${VCPKG_LINKER_FLAGS_DEBUG} ")
+ string(APPEND CMAKE_EXE_LINKER_FLAGS_DEBUG " ${VCPKG_LINKER_FLAGS_DEBUG} ")
+ string(APPEND CMAKE_SHARED_LINKER_FLAGS_RELEASE " ${VCPKG_LINKER_FLAGS_RELEASE} ")
+ string(APPEND CMAKE_EXE_LINKER_FLAGS_RELEASE " ${VCPKG_LINKER_FLAGS_RELEASE} ")
+ endif()
+endif()
diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/toolchains/freebsd.cmake b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/toolchains/freebsd.cmake new file mode 100644 index 000000000..4b1cc3e8c --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/toolchains/freebsd.cmake @@ -0,0 +1,24 @@ +if(NOT _VCPKG_FREEBSD_TOOLCHAIN)
+set(_VCPKG_FREEBSD_TOOLCHAIN 1)
+if(CMAKE_HOST_SYSTEM_NAME STREQUAL "FreeBSD")
+ set(CMAKE_CROSSCOMPILING OFF CACHE BOOL "")
+endif()
+set(CMAKE_SYSTEM_NAME FreeBSD CACHE STRING "")
+
+get_property( _CMAKE_IN_TRY_COMPILE GLOBAL PROPERTY IN_TRY_COMPILE )
+if(NOT _CMAKE_IN_TRY_COMPILE)
+ string(APPEND CMAKE_C_FLAGS_INIT " -fPIC ${VCPKG_C_FLAGS} ")
+ string(APPEND CMAKE_CXX_FLAGS_INIT " -fPIC ${VCPKG_CXX_FLAGS} ")
+ string(APPEND CMAKE_C_FLAGS_DEBUG_INIT " ${VCPKG_C_FLAGS_DEBUG} ")
+ string(APPEND CMAKE_CXX_FLAGS_DEBUG_INIT " ${VCPKG_CXX_FLAGS_DEBUG} ")
+ string(APPEND CMAKE_C_FLAGS_RELEASE_INIT " ${VCPKG_C_FLAGS_RELEASE} ")
+ string(APPEND CMAKE_CXX_FLAGS_RELEASE_INIT " ${VCPKG_CXX_FLAGS_RELEASE} ")
+
+ string(APPEND CMAKE_SHARED_LINKER_FLAGS_INIT " ${VCPKG_LINKER_FLAGS} ")
+ string(APPEND CMAKE_EXE_LINKER_FLAGS_INIT " ${VCPKG_LINKER_FLAGS} ")
+ string(APPEND CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT " ${VCPKG_LINKER_FLAGS_DEBUG} ")
+ string(APPEND CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT " ${VCPKG_LINKER_FLAGS_DEBUG} ")
+ string(APPEND CMAKE_SHARED_LINKER_FLAGS_RELEASE_INIT " ${VCPKG_LINKER_FLAGS_RELEASE} ")
+ string(APPEND CMAKE_EXE_LINKER_FLAGS_RELEASE_INIT " ${VCPKG_LINKER_FLAGS_RELEASE} ")
+endif()
+endif()
diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/toolchains/ios.cmake b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/toolchains/ios.cmake new file mode 100644 index 000000000..f173662c0 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/toolchains/ios.cmake @@ -0,0 +1,60 @@ +if(NOT _VCPKG_IOS_TOOLCHAIN)
+ set(_VCPKG_IOS_TOOLCHAIN 1)
+
+ # Set the CMAKE_SYSTEM_NAME for try_compile calls.
+ set(CMAKE_SYSTEM_NAME iOS CACHE STRING "")
+
+ macro(_vcpkg_setup_ios_arch arch)
+ unset(_vcpkg_ios_system_processor)
+ unset(_vcpkg_ios_sysroot)
+ unset(_vcpkg_ios_target_architecture)
+
+ if ("${arch}" STREQUAL "arm64")
+ set(_vcpkg_ios_system_processor "aarch64")
+ set(_vcpkg_ios_target_architecture "arm64")
+ elseif("${arch}" STREQUAL "arm")
+ set(_vcpkg_ios_system_processor "arm")
+ set(_vcpkg_ios_target_architecture "armv7")
+ elseif("${arch}" STREQUAL "x64")
+ set(_vcpkg_ios_system_processor "x86_64")
+ set(_vcpkg_ios_sysroot "iphonesimulator")
+ set(_vcpkg_ios_target_architecture "x86_64")
+ elseif("${arch}" STREQUAL "x86")
+ set(_vcpkg_ios_system_processor "i386")
+ set(_vcpkg_ios_sysroot "iphonesimulator")
+ set(_vcpkg_ios_target_architecture "i386")
+ else()
+ message(FATAL_ERROR
+ "Unknown VCPKG_TARGET_ARCHITECTURE value provided for triplet ${VCPKG_TARGET_TRIPLET}: ${arch}")
+ endif()
+ endmacro()
+
+ _vcpkg_setup_ios_arch("${VCPKG_TARGET_ARCHITECTURE}")
+ if(_vcpkg_ios_system_processor AND NOT CMAKE_SYSTEM_PROCESSOR)
+ set(CMAKE_SYSTEM_PROCESSOR ${_vcpkg_ios_system_processor})
+ endif()
+
+ # If VCPKG_OSX_ARCHITECTURES or VCPKG_OSX_SYSROOT is set in the triplet, they will take priority,
+ # so the following will be no-ops.
+ set(CMAKE_OSX_ARCHITECTURES "${_vcpkg_ios_target_architecture}" CACHE STRING "Build architectures for iOS")
+ if(_vcpkg_ios_sysroot)
+ set(CMAKE_OSX_SYSROOT ${_vcpkg_ios_sysroot} CACHE STRING "iOS sysroot")
+ endif()
+
+ get_property( _CMAKE_IN_TRY_COMPILE GLOBAL PROPERTY IN_TRY_COMPILE )
+ if(NOT _CMAKE_IN_TRY_COMPILE)
+ string(APPEND CMAKE_C_FLAGS_INIT " -fPIC ${VCPKG_C_FLAGS} ")
+ string(APPEND CMAKE_CXX_FLAGS_INIT " -fPIC ${VCPKG_CXX_FLAGS} ")
+ string(APPEND CMAKE_C_FLAGS_DEBUG_INIT " ${VCPKG_C_FLAGS_DEBUG} ")
+ string(APPEND CMAKE_CXX_FLAGS_DEBUG_INIT " ${VCPKG_CXX_FLAGS_DEBUG} ")
+ string(APPEND CMAKE_C_FLAGS_RELEASE_INIT " ${VCPKG_C_FLAGS_RELEASE} ")
+ string(APPEND CMAKE_CXX_FLAGS_RELEASE_INIT " ${VCPKG_CXX_FLAGS_RELEASE} ")
+
+ string(APPEND CMAKE_SHARED_LINKER_FLAGS_INIT " ${VCPKG_LINKER_FLAGS} ")
+ string(APPEND CMAKE_EXE_LINKER_FLAGS_INIT " ${VCPKG_LINKER_FLAGS} ")
+ string(APPEND CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT " ${VCPKG_LINKER_FLAGS_DEBUG} ")
+ string(APPEND CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT " ${VCPKG_LINKER_FLAGS_DEBUG} ")
+ string(APPEND CMAKE_SHARED_LINKER_FLAGS_RELEASE_INIT " ${VCPKG_LINKER_FLAGS_RELEASE} ")
+ string(APPEND CMAKE_EXE_LINKER_FLAGS_RELEASE_INIT " ${VCPKG_LINKER_FLAGS_RELEASE} ")
+ endif()
+endif()
diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/toolchains/linux.cmake b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/toolchains/linux.cmake new file mode 100644 index 000000000..fb5666538 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/toolchains/linux.cmake @@ -0,0 +1,57 @@ +if(NOT _VCPKG_LINUX_TOOLCHAIN)
+set(_VCPKG_LINUX_TOOLCHAIN 1)
+if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux")
+ set(CMAKE_CROSSCOMPILING OFF CACHE BOOL "")
+endif()
+set(CMAKE_SYSTEM_NAME Linux CACHE STRING "")
+if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64")
+ set(CMAKE_SYSTEM_PROCESSOR x86_64 CACHE STRING "")
+elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86")
+ set(CMAKE_SYSTEM_PROCESSOR x86 CACHE STRING "")
+ string(APPEND VCPKG_C_FLAGS " -m32")
+ string(APPEND VCPKG_CXX_FLAGS " -m32")
+elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm")
+ set(CMAKE_SYSTEM_PROCESSOR armv7l CACHE STRING "")
+ if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux" AND CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "x86_64")
+ if(NOT DEFINED CMAKE_CXX_COMPILER)
+ set(CMAKE_CXX_COMPILER "arm-linux-gnueabihf-g++")
+ endif()
+ if(NOT DEFINED CMAKE_C_COMPILER)
+ set(CMAKE_C_COMPILER "arm-linux-gnueabihf-gcc")
+ endif()
+ message(STATUS "Cross compiling arm on host x86_64, use cross compiler: ${CMAKE_CXX_COMPILER}/${CMAKE_C_COMPILER}")
+ endif()
+elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64")
+ set(CMAKE_SYSTEM_PROCESSOR aarch64 CACHE STRING "")
+ if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux" AND CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "x86_64")
+ if(NOT DEFINED CMAKE_CXX_COMPILER)
+ set(CMAKE_CXX_COMPILER "aarch64-linux-gnu-g++")
+ endif()
+ if(NOT DEFINED CMAKE_C_COMPILER)
+ set(CMAKE_C_COMPILER "aarch64-linux-gnu-gcc")
+ endif()
+ message(STATUS "Cross compiling arm64 on host x86_64, use cross compiler: ${CMAKE_CXX_COMPILER}/${CMAKE_C_COMPILER}")
+ endif()
+endif()
+
+get_property( _CMAKE_IN_TRY_COMPILE GLOBAL PROPERTY IN_TRY_COMPILE )
+if(NOT _CMAKE_IN_TRY_COMPILE)
+ string(APPEND CMAKE_C_FLAGS_INIT " -fPIC ${VCPKG_C_FLAGS} ")
+ string(APPEND CMAKE_CXX_FLAGS_INIT " -fPIC ${VCPKG_CXX_FLAGS} ")
+ string(APPEND CMAKE_C_FLAGS_DEBUG_INIT " ${VCPKG_C_FLAGS_DEBUG} ")
+ string(APPEND CMAKE_CXX_FLAGS_DEBUG_INIT " ${VCPKG_CXX_FLAGS_DEBUG} ")
+ string(APPEND CMAKE_C_FLAGS_RELEASE_INIT " ${VCPKG_C_FLAGS_RELEASE} ")
+ string(APPEND CMAKE_CXX_FLAGS_RELEASE_INIT " ${VCPKG_CXX_FLAGS_RELEASE} ")
+
+ string(APPEND CMAKE_SHARED_LINKER_FLAGS_INIT " ${VCPKG_LINKER_FLAGS} ")
+ string(APPEND CMAKE_EXE_LINKER_FLAGS_INIT " ${VCPKG_LINKER_FLAGS} ")
+ if(VCPKG_CRT_LINKAGE STREQUAL "static")
+ string(APPEND CMAKE_SHARED_LINKER_FLAGS_INIT "-static ")
+ string(APPEND CMAKE_EXE_LINKER_FLAGS_INIT "-static ")
+ endif()
+ string(APPEND CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT " ${VCPKG_LINKER_FLAGS_DEBUG} ")
+ string(APPEND CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT " ${VCPKG_LINKER_FLAGS_DEBUG} ")
+ string(APPEND CMAKE_SHARED_LINKER_FLAGS_RELEASE_INIT " ${VCPKG_LINKER_FLAGS_RELEASE} ")
+ string(APPEND CMAKE_EXE_LINKER_FLAGS_RELEASE_INIT " ${VCPKG_LINKER_FLAGS_RELEASE} ")
+endif()
+endif()
diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/toolchains/mingw.cmake b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/toolchains/mingw.cmake new file mode 100644 index 000000000..195e337f7 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/toolchains/mingw.cmake @@ -0,0 +1,51 @@ +if(NOT _VCPKG_MINGW_TOOLCHAIN)
+set(_VCPKG_MINGW_TOOLCHAIN 1)
+if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
+ set(CMAKE_CROSSCOMPILING OFF CACHE BOOL "")
+endif()
+
+# Need to override MinGW from VCPKG_CMAKE_SYSTEM_NAME
+set(CMAKE_SYSTEM_NAME Windows CACHE STRING "" FORCE)
+
+if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86")
+ set(CMAKE_SYSTEM_PROCESSOR i686 CACHE STRING "")
+elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64")
+ set(CMAKE_SYSTEM_PROCESSOR x86_64 CACHE STRING "")
+elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm")
+ set(CMAKE_SYSTEM_PROCESSOR armv7 CACHE STRING "")
+elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64")
+ set(CMAKE_SYSTEM_PROCESSOR aarch64 CACHE STRING "")
+endif()
+
+foreach(lang C CXX)
+ set(CMAKE_${lang}_COMPILER_TARGET "${CMAKE_SYSTEM_PROCESSOR}-windows-gnu" CACHE STRING "")
+endforeach()
+
+find_program(CMAKE_C_COMPILER "${CMAKE_SYSTEM_PROCESSOR}-w64-mingw32-gcc")
+find_program(CMAKE_CXX_COMPILER "${CMAKE_SYSTEM_PROCESSOR}-w64-mingw32-g++")
+find_program(CMAKE_RC_COMPILER "${CMAKE_SYSTEM_PROCESSOR}-w64-mingw32-windres")
+if(NOT CMAKE_RC_COMPILER)
+ find_program(CMAKE_RC_COMPILER "windres")
+endif()
+
+get_property( _CMAKE_IN_TRY_COMPILE GLOBAL PROPERTY IN_TRY_COMPILE )
+if(NOT _CMAKE_IN_TRY_COMPILE)
+ string(APPEND CMAKE_C_FLAGS_INIT " ${VCPKG_C_FLAGS} ")
+ string(APPEND CMAKE_CXX_FLAGS_INIT " ${VCPKG_CXX_FLAGS} ")
+ string(APPEND CMAKE_C_FLAGS_DEBUG_INIT " ${VCPKG_C_FLAGS_DEBUG} ")
+ string(APPEND CMAKE_CXX_FLAGS_DEBUG_INIT " ${VCPKG_CXX_FLAGS_DEBUG} ")
+ string(APPEND CMAKE_C_FLAGS_RELEASE_INIT " ${VCPKG_C_FLAGS_RELEASE} ")
+ string(APPEND CMAKE_CXX_FLAGS_RELEASE_INIT " ${VCPKG_CXX_FLAGS_RELEASE} ")
+
+ string(APPEND CMAKE_SHARED_LINKER_FLAGS_INIT " ${VCPKG_LINKER_FLAGS} ")
+ string(APPEND CMAKE_EXE_LINKER_FLAGS_INIT " ${VCPKG_LINKER_FLAGS} ")
+ if(VCPKG_CRT_LINKAGE STREQUAL "static")
+ string(APPEND CMAKE_SHARED_LINKER_FLAGS_INIT "-static ")
+ string(APPEND CMAKE_EXE_LINKER_FLAGS_INIT "-static ")
+ endif()
+ string(APPEND CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT " ${VCPKG_LINKER_FLAGS_DEBUG} ")
+ string(APPEND CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT " ${VCPKG_LINKER_FLAGS_DEBUG} ")
+ string(APPEND CMAKE_SHARED_LINKER_FLAGS_RELEASE_INIT " ${VCPKG_LINKER_FLAGS_RELEASE} ")
+ string(APPEND CMAKE_EXE_LINKER_FLAGS_RELEASE_INIT " ${VCPKG_LINKER_FLAGS_RELEASE} ")
+endif()
+endif()
diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/toolchains/openbsd.cmake b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/toolchains/openbsd.cmake new file mode 100644 index 000000000..9eb8f3a0b --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/toolchains/openbsd.cmake @@ -0,0 +1,32 @@ +if(NOT _VCPKG_OPENBSD_TOOLCHAIN)
+set(_VCPKG_OPENBSD_TOOLCHAIN 1)
+ +if(CMAKE_HOST_SYSTEM_NAME STREQUAL "OpenBSD")
+ set(CMAKE_CROSSCOMPILING OFF CACHE BOOL "")
+endif()
+set(CMAKE_SYSTEM_NAME OpenBSD CACHE STRING "")
+
+if(NOT DEFINED CMAKE_CXX_COMPILER)
+ set(CMAKE_CXX_COMPILER "/usr/bin/clang++")
+endif()
+if(NOT DEFINED CMAKE_C_COMPILER)
+ set(CMAKE_C_COMPILER "/usr/bin/clang")
+endif()
+ +get_property( _CMAKE_IN_TRY_COMPILE GLOBAL PROPERTY IN_TRY_COMPILE )
+if(NOT _CMAKE_IN_TRY_COMPILE)
+ string(APPEND CMAKE_C_FLAGS_INIT " -fPIC ${VCPKG_C_FLAGS} ")
+ string(APPEND CMAKE_CXX_FLAGS_INIT " -fPIC ${VCPKG_CXX_FLAGS} ")
+ string(APPEND CMAKE_C_FLAGS_DEBUG_INIT " ${VCPKG_C_FLAGS_DEBUG} ")
+ string(APPEND CMAKE_CXX_FLAGS_DEBUG_INIT " ${VCPKG_CXX_FLAGS_DEBUG} ")
+ string(APPEND CMAKE_C_FLAGS_RELEASE_INIT " ${VCPKG_C_FLAGS_RELEASE} ")
+ string(APPEND CMAKE_CXX_FLAGS_RELEASE_INIT " ${VCPKG_CXX_FLAGS_RELEASE} ")
+
+ string(APPEND CMAKE_SHARED_LINKER_FLAGS_INIT " ${VCPKG_LINKER_FLAGS} ")
+ string(APPEND CMAKE_EXE_LINKER_FLAGS_INIT " ${VCPKG_LINKER_FLAGS} ")
+ string(APPEND CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT " ${VCPKG_LINKER_FLAGS_DEBUG} ")
+ string(APPEND CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT " ${VCPKG_LINKER_FLAGS_DEBUG} ")
+ string(APPEND CMAKE_SHARED_LINKER_FLAGS_RELEASE_INIT " ${VCPKG_LINKER_FLAGS_RELEASE} ")
+ string(APPEND CMAKE_EXE_LINKER_FLAGS_RELEASE_INIT " ${VCPKG_LINKER_FLAGS_RELEASE} ")
+endif(NOT _CMAKE_IN_TRY_COMPILE)
+endif(NOT _VCPKG_OPENBSD_TOOLCHAIN)
diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/toolchains/osx.cmake b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/toolchains/osx.cmake new file mode 100644 index 000000000..1ab3da5e5 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/toolchains/osx.cmake @@ -0,0 +1,32 @@ +if(NOT _VCPKG_OSX_TOOLCHAIN)
+set(_VCPKG_OSX_TOOLCHAIN 1)
+if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin")
+ set(CMAKE_CROSSCOMPILING OFF CACHE BOOL "")
+
+ set(CMAKE_SYSTEM_VERSION "${CMAKE_HOST_SYSTEM_VERSION}" CACHE STRING "")
+ set(CMAKE_SYSTEM_PROCESSOR "${CMAKE_HOST_SYSTEM_PROCESSOR}" CACHE STRING "")
+else()
+ set(CMAKE_SYSTEM_VERSION "17.0.0" CACHE STRING "")
+ set(CMAKE_SYSTEM_PROCESSOR "x86_64" CACHE STRING "")
+endif()
+set(CMAKE_SYSTEM_NAME Darwin CACHE STRING "")
+
+set(CMAKE_MACOSX_RPATH ON CACHE BOOL "")
+
+get_property( _CMAKE_IN_TRY_COMPILE GLOBAL PROPERTY IN_TRY_COMPILE )
+if(NOT _CMAKE_IN_TRY_COMPILE)
+ string(APPEND CMAKE_C_FLAGS_INIT " -fPIC ${VCPKG_C_FLAGS} ")
+ string(APPEND CMAKE_CXX_FLAGS_INIT " -fPIC ${VCPKG_CXX_FLAGS} ")
+ string(APPEND CMAKE_C_FLAGS_DEBUG_INIT " ${VCPKG_C_FLAGS_DEBUG} ")
+ string(APPEND CMAKE_CXX_FLAGS_DEBUG_INIT " ${VCPKG_CXX_FLAGS_DEBUG} ")
+ string(APPEND CMAKE_C_FLAGS_RELEASE_INIT " ${VCPKG_C_FLAGS_RELEASE} ")
+ string(APPEND CMAKE_CXX_FLAGS_RELEASE_INIT " ${VCPKG_CXX_FLAGS_RELEASE} ")
+
+ string(APPEND CMAKE_SHARED_LINKER_FLAGS_INIT " ${VCPKG_LINKER_FLAGS} ")
+ string(APPEND CMAKE_EXE_LINKER_FLAGS_INIT " ${VCPKG_LINKER_FLAGS} ")
+ string(APPEND CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT " ${VCPKG_LINKER_FLAGS_DEBUG} ")
+ string(APPEND CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT " ${VCPKG_LINKER_FLAGS_DEBUG} ")
+ string(APPEND CMAKE_SHARED_LINKER_FLAGS_RELEASE_INIT " ${VCPKG_LINKER_FLAGS_RELEASE} ")
+ string(APPEND CMAKE_EXE_LINKER_FLAGS_RELEASE_INIT " ${VCPKG_LINKER_FLAGS_RELEASE} ")
+endif()
+endif()
diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/toolchains/windows.cmake b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/toolchains/windows.cmake new file mode 100644 index 000000000..954f95535 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/toolchains/windows.cmake @@ -0,0 +1,41 @@ +if(NOT _VCPKG_WINDOWS_TOOLCHAIN)
+set(_VCPKG_WINDOWS_TOOLCHAIN 1)
+set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>$<$<STREQUAL:${VCPKG_CRT_LINKAGE},dynamic>:DLL>" CACHE STRING "")
+
+get_property( _CMAKE_IN_TRY_COMPILE GLOBAL PROPERTY IN_TRY_COMPILE )
+if(NOT _CMAKE_IN_TRY_COMPILE)
+
+ if(VCPKG_CRT_LINKAGE STREQUAL "dynamic")
+ set(VCPKG_CRT_LINK_FLAG_PREFIX "/MD")
+ elseif(VCPKG_CRT_LINKAGE STREQUAL "static")
+ set(VCPKG_CRT_LINK_FLAG_PREFIX "/MT")
+ else()
+ message(FATAL_ERROR "Invalid setting for VCPKG_CRT_LINKAGE: \"${VCPKG_CRT_LINKAGE}\". It must be \"static\" or \"dynamic\"")
+ endif()
+
+ set(CHARSET_FLAG "/utf-8")
+ if (NOT VCPKG_SET_CHARSET_FLAG OR VCPKG_PLATFORM_TOOLSET MATCHES "v120")
+ # VS 2013 does not support /utf-8
+ set(CHARSET_FLAG)
+ endif()
+
+ set(CMAKE_CXX_FLAGS " /nologo /DWIN32 /D_WINDOWS /W3 ${CHARSET_FLAG} /GR /EHsc /MP ${VCPKG_CXX_FLAGS}" CACHE STRING "")
+ set(CMAKE_C_FLAGS " /nologo /DWIN32 /D_WINDOWS /W3 ${CHARSET_FLAG} /MP ${VCPKG_C_FLAGS}" CACHE STRING "")
+ set(CMAKE_RC_FLAGS "-c65001 /DWIN32" CACHE STRING "")
+
+ unset(CHARSET_FLAG)
+
+ set(CMAKE_CXX_FLAGS_DEBUG "/D_DEBUG ${VCPKG_CRT_LINK_FLAG_PREFIX}d /Z7 /Ob0 /Od /RTC1 ${VCPKG_CXX_FLAGS_DEBUG}" CACHE STRING "")
+ set(CMAKE_C_FLAGS_DEBUG "/D_DEBUG ${VCPKG_CRT_LINK_FLAG_PREFIX}d /Z7 /Ob0 /Od /RTC1 ${VCPKG_C_FLAGS_DEBUG}" CACHE STRING "")
+ set(CMAKE_CXX_FLAGS_RELEASE "${VCPKG_CRT_LINK_FLAG_PREFIX} /O2 /Oi /Gy /DNDEBUG /Z7 ${VCPKG_CXX_FLAGS_RELEASE}" CACHE STRING "")
+ set(CMAKE_C_FLAGS_RELEASE "${VCPKG_CRT_LINK_FLAG_PREFIX} /O2 /Oi /Gy /DNDEBUG /Z7 ${VCPKG_C_FLAGS_RELEASE}" CACHE STRING "")
+
+ string(APPEND CMAKE_STATIC_LINKER_FLAGS_RELEASE_INIT " /nologo ")
+ set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "/nologo /DEBUG /INCREMENTAL:NO /OPT:REF /OPT:ICF ${VCPKG_LINKER_FLAGS} ${VCPKG_LINKER_FLAGS_RELEASE}" CACHE STRING "")
+ set(CMAKE_EXE_LINKER_FLAGS_RELEASE "/nologo /DEBUG /INCREMENTAL:NO /OPT:REF /OPT:ICF ${VCPKG_LINKER_FLAGS} ${VCPKG_LINKER_FLAGS_RELEASE}" CACHE STRING "")
+
+ string(APPEND CMAKE_STATIC_LINKER_FLAGS_DEBUG_INIT " /nologo ")
+ string(APPEND CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT " /nologo ${VCPKG_LINKER_FLAGS} ${VCPKG_LINKER_FLAGS_DEBUG} ")
+ string(APPEND CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT " /nologo ${VCPKG_LINKER_FLAGS} ${VCPKG_LINKER_FLAGS_DEBUG} ")
+endif()
+endif()
diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/vcpkg.schema.json b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/vcpkg.schema.json new file mode 100644 index 000000000..14848f00c --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/vcpkg.schema.json @@ -0,0 +1,313 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "id": "https://raw.githubusercontent.com/microsoft/vcpkg/master/scripts/vcpkg.schema.json", + "title": "Vcpkg manifest", + "description": "Vcpkg manifest file. See https://github.com/microsoft/vcpkg/blob/master/docs/specifications/manifests.md.", + "definitions": { + "identifier": { + "description": "Identifiers used for feature names.", + "allOf": [ + { + "description": "Identifier are lowercase with digits and dashes.", + "type": "string", + "pattern": "[a-z0-9]+(-[a-z0-9]+)*" + }, + { + "not": { + "description": "Identifiers must not be a Windows filesystem or vcpkg reserved name.", + "type": "string", + "pattern": "^prn|aux|nul|con|lpt[1-9]|com[1-9]|core|default$" + } + } + ] + }, + "version-text": { + "type": "string", + "pattern": "[^#]+" + }, + "has-schemed-version": { + "type": "object", + "oneOf": [ + { + "properties": { + "version-string": { + "description": "Text used to identify an arbitrary version", + "type": "string", + "pattern": "^[^#]+$" + } + }, + "required": [ + "version-string" + ] + }, + { + "properties": { + "version": { + "description": "A relaxed version string (1.2.3.4...)", + "type": "string", + "pattern": "^\\d+(\\.\\d+)*$" + } + }, + "required": [ + "version" + ] + }, + { + "properties": { + "version-semver": { + "description": "A semantic version string. See https://semver.org/", + "type": "string", + "pattern": "^\\d+\\.\\d+\\.\\d+([+-].+)?$" + } + }, + "required": [ + "version-semver" + ] + }, + { + "properties": { + "version-date": { + "description": "A date version string (e.g. 2020-01-20)", + "type": "string", + "pattern": "^\\d{4}-\\d{2}-\\d{2}(\\.\\d+)*$" + } + }, + "required": [ + "version-date" + ] + } + ] + }, + "port-version": { + "description": "A non-negative integer indicating the port revision. If this field doesn't exist, it's assumed to be `0`.", + "type": "integer", + "minimum": 0, + "default": 0 + }, + "package-name": { + "description": "Name of a package.", + "allOf": [ + { + "description": "Package name must be a dot-separated list of valid identifiers", + "type": "string", + "pattern": "^[a-z0-9]+(-[a-z0-9]+)*(\\.[a-z0-9]+(-[a-z0-9]+)*)*$" + }, + { + "not": { + "description": "Identifiers must not be a Windows filesystem or vcpkg reserved name.", + "type": "string", + "pattern": "(^|\\.)(prn|aux|nul|con|lpt[1-9]|com[1-9]|core|default)(\\.|$)" + } + } + ] + }, + "description-field": { + "description": "A string or array of strings containing the description of a package or feature.", + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "dependency-object": { + "description": "Expanded form of a dependency with explicit features and platform.", + "type": "object", + "properties": { + "name": { + "$ref": "#/definitions/package-name" + }, + "features": { + "type": "array", + "items": { + "$ref": "#/definitions/identifier" + } + }, + "host": { + "type": "boolean", + "default": false + }, + "default-features": { + "type": "boolean", + "default": true + }, + "platform": { + "$ref": "#/definitions/platform-expression" + }, + "version>=": { + "description": "Minimum required version", + "type": "string", + "pattern": "^[^#]+(#\\d+)?$" + } + }, + "patternProperties": { + "^\\$": {} + }, + "required": [ + "name" + ], + "additionalProperties": false + }, + "dependency": { + "description": "A dependency fetchable by Vcpkg.", + "oneOf": [ + { + "$ref": "#/definitions/package-name" + }, + { + "$ref": "#/definitions/dependency-object" + } + ] + }, + "override": { + "description": "A version override.", + "type": "object", + "properties": { + "name": { + "$ref": "#/definitions/identifier" + }, + "version": { + "$ref": "#/definitions/version-text" + }, + "port-version": { + "$ref": "#/definitions/port-version" + } + }, + "patternProperties": { + "^\\$": {} + }, + "required": [ + "name", + "version" + ] + }, + "platform-expression": { + "description": "A specification of a set of platforms. See https://github.com/microsoft/vcpkg/blob/master/docs/specifications/manifests.md#definitions.", + "type": "string" + }, + "feature": { + "description": "A package feature that can be activated by consumers.", + "type": "object", + "properties": { + "description": { + "$ref": "#/definitions/description-field" + }, + "dependencies": { + "description": "Dependencies used by this feature.", + "type": "array", + "items": { + "$ref": "#/definitions/dependency" + } + } + }, + "patternProperties": { + "^\\$": {} + }, + "required": [ + "description" + ], + "additionalProperties": false + } + }, + "type": "object", + "allOf": [ + { + "properties": { + "name": { + "description": "The name of the top-level package", + "$ref": "#/definitions/package-name" + }, + "version-string": {}, + "version": {}, + "version-date": {}, + "version-semver": {}, + "port-version": { + "$ref": "#/definitions/port-version" + }, + "maintainers": { + "description": "An array of strings which contain the authors of a package", + "type": "array", + "items": { + "type": "string" + } + }, + "description": { + "$ref": "#/definitions/description-field" + }, + "homepage": { + "description": "A url which points to the homepage of a package.", + "type": "string", + "format": "uri" + }, + "documentation": { + "description": "A url which points to the documentation of a package.", + "type": "string", + "format": "uri" + }, + "license": { + "description": "An SPDX license expression at version 3.9.", + "type": "string" + }, + "builtin-baseline": { + "description": "A vcpkg repository commit for version control.", + "type": "string" + }, + "dependencies": { + "description": "Dependencies that are always required.", + "type": "array", + "items": { + "$ref": "#/definitions/dependency" + } + }, + "overrides": { + "description": "Version overrides for dependencies.", + "type": "array", + "items": { + "$ref": "#/definitions/override" + } + }, + "dev-dependencies": { + "description": "Dependencies only required for developers (testing and the like).", + "type": "array", + "items": { + "$ref": "#/definitions/dependency" + } + }, + "features": { + "description": "A map of features supported by the package", + "type": "object", + "patternProperties": { + "": { + "$ref": "#/definitions/feature" + } + } + }, + "default-features": { + "description": "Features enabled by default with the package.", + "type": "array", + "items": { + "$ref": "#/definitions/identifier" + } + }, + "supports": { + "$ref": "#/definitions/platform-expression" + } + }, + "patternProperties": { + "^\\$": {} + }, + "required": [ + "name" + ], + "additionalProperties": false + }, + { + "$ref": "#/definitions/has-schemed-version" + } + ] +} diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/vcpkgTools.xml b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/vcpkgTools.xml new file mode 100644 index 000000000..d608fef2a --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/vcpkgTools.xml @@ -0,0 +1,143 @@ +<?xml version="1.0"?> +<tools version="2"> + <tool name="python3" os="windows"> + <version>3.9.2</version> + <exeRelativePath>python.exe</exeRelativePath> + <url>https://www.python.org/ftp/python/3.9.2/python-3.9.2-embed-win32.zip</url> + <sha512>d792c6179887120ec3e945764b95ae8187032e1779f327feb90ded40ebd39cb78d000056df947f28c9e4257b60dd95ee43a3f77f47a1d8878cbe37ebc20f87a3</sha512> + <archiveName>python-3.9.2-embed-win32.zip</archiveName> + </tool> + <tool name="cmake" os="windows"> + <version>3.20.2</version> + <exeRelativePath>cmake-3.20.2-windows-i386\bin\cmake.exe</exeRelativePath> + <url>https://github.com/Kitware/CMake/releases/download/v3.20.2/cmake-3.20.2-windows-i386.zip</url> + <sha512>5fb46e737eedf71ea70f1b9f392d3e39ec12c0a9d1e630d4ddda4622bb28d92b9d965a11b1a3af5ffeed4d193a06312df9dae5ca567513e98f8ed770ea3be0c4</sha512> + <archiveName>cmake-3.20.2-windows-i386.zip</archiveName> + </tool> + <tool name="cmake" os="osx"> + <version>3.20.2</version> + <exeRelativePath>cmake-3.20.2-macos-universal/CMake.app/Contents/bin/cmake</exeRelativePath> + <url>https://github.com/Kitware/CMake/releases/download/v3.20.2/cmake-3.20.2-macos-universal.tar.gz</url> + <sha512>50b96c9d8c35a8f5d9573f3c741b43c041cfa7ad939fcd60ce56c98a373cc87fa410c61cad6cfb0f86f03c8d3d527297b2b3eed7043aaf19de260dec49c57cf3</sha512> + <archiveName>cmake-3.20.2-macos-universal.tar.gz</archiveName> + </tool> + <tool name="cmake" os="linux"> + <version>3.20.2</version> + <exeRelativePath>cmake-3.20.2-linux-x86_64/bin/cmake</exeRelativePath> + <url>https://github.com/Kitware/CMake/releases/download/v3.20.2/cmake-3.20.2-Linux-x86_64.tar.gz</url> + <sha512>1e81c37d3b144cfb81478140e7921f314134845d2f0e0f941109ef57d510e7bd37dda6cc292ec00782472e7f1671349b857be9aac1c3f974423c8d1875a46302</sha512> + <archiveName>cmake-3.20.2-linux-x86_64.tar.gz</archiveName> + </tool> + <tool name="cmake" os="freebsd"> + <version>3.12.4</version> + <exeRelativePath>cmake-3.12.4-FreeBSD-x86_64/bin/cmake</exeRelativePath> + <url>https://github.com/ivysnow/CMake/releases/download/v3.12.4/cmake-3.12.4-FreeBSD-x86_64.tar.gz</url> + <sha512>b5aeb2de36f3c29757c9404e33756da88580ddfa07f29079c7f275ae0d6d018fdfe3f55d54d1403f38e359865cf93436e084c6b1ea91f26c88bc01dde3793479</sha512> + <archiveName>cmake-3.12.4-FreeBSD-x86_64.tar.gz</archiveName> + </tool> + <tool name="git" os="windows"> + <version>2.26.2-1</version> + <exeRelativePath>mingw32\bin\git.exe</exeRelativePath> + <url>https://github.com/git-for-windows/git/releases/download/v2.26.2.windows.1/PortableGit-2.26.2-32-bit.7z.exe</url> + <sha512>d3cb60d62ca7b5d05ab7fbed0fa7567bec951984568a6c1646842a798c4aaff74bf534cf79414a6275c1927081a11b541d09931c017bf304579746e24fe57b36</sha512> + <archiveName>PortableGit-2.26.2-32-bit.7z.exe</archiveName> + </tool> + <tool name="git" os="linux"> + <version>2.7.4</version> + <exeRelativePath></exeRelativePath> + <url></url> + <sha512></sha512> + </tool> + <tool name="git" os="osx"> + <version>2.7.4</version> + <exeRelativePath></exeRelativePath> + <url></url> + <sha512></sha512> + </tool> + <tool name="git" os="freebsd"> + <version>2.7.4</version> + <exeRelativePath></exeRelativePath> + <url></url> + <sha512></sha512> + </tool> + <tool name="vswhere" os="windows"> + <version>2.4.1</version> + <exeRelativePath>vswhere.exe</exeRelativePath> + <url>https://github.com/Microsoft/vswhere/releases/download/2.4.1/vswhere.exe</url> + <sha512>f477842d0cebefcd6bf9c6d536ab8ea20ec5b0aa967ee963ab6a101aeff9df8742ca600d35f39e2e7158d76d8231f1ed2bef6104dce84d2bf8d6b07d17d706a1</sha512> + </tool> + <tool name="nuget" os="windows"> + <version>5.5.1</version> + <exeRelativePath>nuget.exe</exeRelativePath> + <url>https://dist.nuget.org/win-x86-commandline/v5.5.1/nuget.exe</url> + <sha512>22ea847d8017cd977664d0b13c889cfb13c89143212899a511be217345a4e243d4d8d4099700114a11d26a087e83eb1a3e2b03bdb5e0db48f10403184cd26619</sha512> + </tool> + <tool name="nuget" os="linux"> + <version>5.5.1</version> + <exeRelativePath>nuget.exe</exeRelativePath> + <url>https://dist.nuget.org/win-x86-commandline/v5.5.1/nuget.exe</url> + <sha512>22ea847d8017cd977664d0b13c889cfb13c89143212899a511be217345a4e243d4d8d4099700114a11d26a087e83eb1a3e2b03bdb5e0db48f10403184cd26619</sha512> + </tool> + <tool name="nuget" os="osx"> + <version>5.5.1</version> + <exeRelativePath>nuget.exe</exeRelativePath> + <url>https://dist.nuget.org/win-x86-commandline/v5.5.1/nuget.exe</url> + <sha512>22ea847d8017cd977664d0b13c889cfb13c89143212899a511be217345a4e243d4d8d4099700114a11d26a087e83eb1a3e2b03bdb5e0db48f10403184cd26619</sha512> + </tool> + <tool name="installerbase" os="windows"> + <version>3.1.81</version> + <exeRelativePath>QtInstallerFramework-win-x86\bin\installerbase.exe</exeRelativePath> + <url>https://github.com/podsvirov/installer-framework/releases/download/cr203958-9/QtInstallerFramework-win-x86.zip</url> + <sha512>1f3e593270d7c2a4e271fdb49c637a2de462351310ef66bba298d30f6ca23365ec6aecf2e57799a00c873267cd3f92060ecac03eb291d42903d0e0869cd17c73</sha512> + <archiveName>QtInstallerFramework-win-x86.zip</archiveName> + </tool> + <tool name="7zip" os="windows"> + <version>18.1.0</version> + <exeRelativePath>7-Zip.CommandLine.18.1.0\tools\7za.exe</exeRelativePath> + <url>https://www.nuget.org/api/v2/package/7-Zip.CommandLine/18.1.0</url> + <sha512>8c75314102e68d2b2347d592f8e3eb05812e1ebb525decbac472231633753f1d4ca31c8e6881a36144a8da26b2571305b3ae3f4e2b85fc4a290aeda63d1a13b8</sha512> + <archiveName>7-zip.commandline.18.1.0.nupkg</archiveName> + </tool> + <tool name="aria2" os="windows"> + <version>18.01.0</version> + <exeRelativePath>aria2-1.34.0-win-32bit-build1\aria2c.exe</exeRelativePath> + <url>https://github.com/aria2/aria2/releases/download/release-1.34.0/aria2-1.34.0-win-32bit-build1.zip</url> + <sha512>2a5480d503ac6e8203040c7e516a3395028520da05d0ebf3a2d56d5d24ba5d17630e8f318dd4e3cc2094cc4668b90108fb58e8b986b1ffebd429995058063c27</sha512> + <archiveName>aria2-1.33.1-win-32bit-build1.zip</archiveName> + </tool> + <tool name="ninja" os="windows"> + <version>1.10.1</version> + <exeRelativePath>ninja.exe</exeRelativePath> + <url>https://github.com/ninja-build/ninja/releases/download/v1.10.1/ninja-win.zip</url> + <sha512>0120054f0fea6eea4035866201f69fba1c039f681f680cfcbbefcaee97419815d092a6e2f3823ea6c3928ad296395f36029e337127ee977270000b35df5f9c40</sha512> + <archiveName>ninja-win-1.10.1.zip</archiveName> + </tool> + <tool name="ninja" os="linux"> + <version>1.10.1</version> + <exeRelativePath>ninja</exeRelativePath> + <url>https://github.com/ninja-build/ninja/releases/download/v1.10.1/ninja-linux.zip</url> + <sha512>9820c76fde6fac398743766e7ea0fe8a7d6e4191a77512a2d2f51c2ddcc947fcd91ac08522742281a285418c114e760b0158a968305f8dc854bb9693883b7f1e</sha512> + <archiveName>ninja-linux-1.10.1.zip</archiveName> + </tool> + <tool name="ninja" os="osx"> + <version>1.10.1</version> + <exeRelativePath>ninja</exeRelativePath> + <url>https://github.com/ninja-build/ninja/releases/download/v1.10.1/ninja-mac.zip</url> + <sha512>99f5ccca2461a4d340f4528a8eef6d81180757da78313f1f9412ed13a7bbaf6df537a342536fd053db00524bcb734d205af5f6fde419a1eb2e6f77ee8b7860fe</sha512> + <archiveName>ninja-mac-1.10.1.zip</archiveName> + </tool> + <tool name="ninja" os="freebsd"> + <version>1.8.2</version> + <exeRelativePath>ninja</exeRelativePath> + <url>https://github.com/ivysnow/ninja/releases/download/v1.8.2/ninja-freebsd.zip</url> + <sha512>56a55ae9a6b5dfad4f28f9fe9b8114f1475c999d2f07fff7efa7375f987e74b498e9b63c41fc6c577756f15f3a1459c6d5d367902de3bedebdf9a9fd49089a86</sha512> + <archiveName>ninja-freebsd-1.8.2.zip</archiveName> + </tool> + <tool name="powershell-core" os="windows"> + <version>7.1.3</version> + <exeRelativePath>pwsh.exe</exeRelativePath> + <url>https://github.com/PowerShell/PowerShell/releases/download/v7.1.3/PowerShell-7.1.3-win-x86.zip</url> + <sha512>8c2ce510b5c641aad2da6adefc92d47e09bc842d47db3b5d15e14859555a74fe13ad52eaeabf1b2954ca9af737e628b567731c8a3db9bbf0e4aad05279bc1fd8</sha512> + <archiveName>PowerShell-7.1.3-win-x86.zip</archiveName> + </tool> +</tools> diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/vcpkg_completion.bash b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/vcpkg_completion.bash new file mode 100644 index 000000000..804507d58 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/vcpkg_completion.bash @@ -0,0 +1,17 @@ +#/usr/bin/env bash + +_vcpkg_completions() +{ + local vcpkg_executable=${COMP_WORDS[0]} + local remaining_command_line=${COMP_LINE:(${#vcpkg_executable}+1)} + COMPREPLY=($(${vcpkg_executable} autocomplete "${remaining_command_line}" -- 2>/dev/null)) + + # Colon is treated as a delimiter in bash. The following workaround + # allows triplet completion to work correctly in the syntax: + # zlib:x64-windows + local cur + _get_comp_words_by_ref -n : cur + __ltrim_colon_completions "$cur" +} + +complete -F _vcpkg_completions vcpkg diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/vcpkg_completion.fish b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/vcpkg_completion.fish new file mode 100644 index 000000000..a55d70010 --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/vcpkg_completion.fish @@ -0,0 +1,94 @@ +# vcpkg completions for fish +set vcpkg_executable (string split -m1 ' ' (commandline -cb))[1] + +function _vcpkg_completions + set arg (string split -m1 ' ' (commandline -cb))[2] + set curr_token (commandline -t) + if [ -n $arg ] + if [ -z $curr_token ] + set arg $arg " " + end + end + for key in ($vcpkg_executable autocomplete "$arg" -- 2>/dev/null) + echo $key + end +end + +complete -c vcpkg -f --arguments '(_vcpkg_completions)' + +set vcpkg_commands ($vcpkg_executable autocomplete) + +function _set_triplet_arguments + set triplets ($vcpkg_executable help triplet) + set -e triplets[(contains -i -- "Available architecture triplets" $triplets)] + set -e triplets[(contains -i -- "" $triplets)] + set triplet_from "" + for triplet in $triplets + echo (test -n "$triplet") >> temp.txt + if [ (string sub -l5 -- $triplet) = "VCPKG" ] + set -l temp (string length $triplet) + set triplet_from (string sub -s6 -l(math $temp - 15) -- $triplet) + else if [ -n "$triplet" ] + complete -c vcpkg -n "__fish_seen_subcommand_from $vcpkg_commands" -x -l triplet -d "$triplet_from" -a (string sub -s3 -- $triplet) + end + end +end +_set_triplet_arguments + +# options for all completions +complete -c vcpkg -n "__fish_seen_subcommand_from $vcpkg_commands" -x -l triplet -d "Specify the target architecture triplet. See 'vcpkg help triplet' (default: \$VCPKG_DEFAULT_TRIPLET)" +complete -c vcpkg -n "__fish_seen_subcommand_from $vcpkg_commands" -x -l overlay-ports -d "Specify directories to be used when searching for ports (also: \$VCPKG_OVERLAY_PORTS)" -a '(__fish_complete_directories)' +complete -c vcpkg -n "__fish_seen_subcommand_from $vcpkg_commands" -x -l overlay-triplets -d "Specify directories containing triplets files (also: \$VCPKG_OVERLAY_TRIPLETS)" -a '(__fish_complete_directories)' +complete -c vcpkg -n "__fish_seen_subcommand_from $vcpkg_commands" -x -l binarysource -d "Add sources for binary caching. See 'vcpkg help binarycaching'" -a '(__fish_complete_directories)' +complete -c vcpkg -n "__fish_seen_subcommand_from $vcpkg_commands" -x -l downloads-root -d "Specify the downloads root directory (default: \$VCPKG_DOWNLOADS)" -a '(__fish_complete_directories)' +complete -c vcpkg -n "__fish_seen_subcommand_from $vcpkg_commands" -x -l vcpkg-root -d "Specify the vcpkg root directory (default: \$VCPKG_ROOT)" -a '(__fish_complete_directories)' + +# options for install +complete -c vcpkg -n "__fish_seen_subcommand_from install" -f -l dry-run -d "Do not actually build or install" +complete -c vcpkg -n "__fish_seen_subcommand_from install" -f -l head -d "Install the libraries on the command line using the latest upstream sources" +complete -c vcpkg -n "__fish_seen_subcommand_from install" -f -l no-downloads -d "Do not download new sources" +complete -c vcpkg -n "__fish_seen_subcommand_from install" -f -l only-downloads -d "Download sources but don't build packages" +complete -c vcpkg -n "__fish_seen_subcommand_from install" -f -l recurse -d "Allow removal of packages as part of installation" +complete -c vcpkg -n "__fish_seen_subcommand_from install" -f -l keep-going -d "Continue installing packages on failure" +complete -c vcpkg -n "__fish_seen_subcommand_from install" -f -l editable -d "Disable source re-extraction and binary caching for libraries on the command line" +complete -c vcpkg -n "__fish_seen_subcommand_from install" -f -l clean-after-build -d "Clean buildtrees, packages and downloads after building each package" + +# options for edit +complete -c vcpkg -n "__fish_seen_subcommand_from edit" -f -l buildtrees -d "Open editor into the port-specific buildtree subfolder" +complete -c vcpkg -n "__fish_seen_subcommand_from edit" -f -l all -d "Open editor into the port as well as the port-specific buildtree subfolder" + +# options for export +complete -c vcpkg -n "__fish_seen_subcommand_from export" -f -l dry-run -d "Do not actually export" +complete -c vcpkg -n "__fish_seen_subcommand_from export" -f -l raw -d "Export to an uncompressed directory" +complete -c vcpkg -n "__fish_seen_subcommand_from export" -f -l nuget -d "Export a NuGet package" +complete -c vcpkg -n "__fish_seen_subcommand_from export" -f -l ifw -d "Export to an IFW-based installer" +complete -c vcpkg -n "__fish_seen_subcommand_from export" -f -l zip -d "Export to a zip file" +complete -c vcpkg -n "__fish_seen_subcommand_from export" -f -l 7zip -d "Export to a 7zip (.7z) file" +complete -c vcpkg -n "__fish_seen_subcommand_from export" -f -l prefab -d "Export to Prefab format" +complete -c vcpkg -n "__fish_seen_subcommand_from export" -f -l prefab-maven -d "Enable maven" +complete -c vcpkg -n "__fish_seen_subcommand_from export" -f -l prefab-debug -d "Enable prefab debug" +complete -c vcpkg -n "__fish_seen_subcommand_from export" -f -r -l output -d "Specify the output name (used to construct filename)" +complete -c vcpkg -n "__fish_seen_subcommand_from export" -f -r -l output-dir -d "Specify the output directory for produced artifacts" -a '(__fish_complete_directories)' +complete -c vcpkg -n "__fish_seen_subcommand_from export" -f -r -l nuget-id -d "Specify the id for the exported NuGet package (overrides --output)" +complete -c vcpkg -n "__fish_seen_subcommand_from export" -f -r -l nuget-version -d "Specify the version for the exported NuGet package" +complete -c vcpkg -n "__fish_seen_subcommand_from export" -f -r -l ifw-repository-url -d "Specify the remote repository URL for the online installer" +complete -c vcpkg -n "__fish_seen_subcommand_from export" -f -r -l ifw-packages-directory-path -d "Specify the temporary directory path for the repacked packages" +complete -c vcpkg -n "__fish_seen_subcommand_from export" -f -r -l ifw-repository-directory-path -d "Specify the directory path for the exported repository" +complete -c vcpkg -n "__fish_seen_subcommand_from export" -f -r -l ifw-configuration-file-path -d "Specify the temporary file path for the installer configuration" +complete -c vcpkg -n "__fish_seen_subcommand_from export" -f -r -l ifw-installer-file-path -d "Specify the file path for the exported installer" +complete -c vcpkg -n "__fish_seen_subcommand_from export" -f -r -l prefab-group-id -d "GroupId uniquely identifies your project according maven specifications" +complete -c vcpkg -n "__fish_seen_subcommand_from export" -f -r -l prefab-artifact-id -d "Artifact Id is the name of the project according maven specifications" +complete -c vcpkg -n "__fish_seen_subcommand_from export" -f -r -l prefab-version -d "Version is the name of the project according maven specifications" +complete -c vcpkg -n "__fish_seen_subcommand_from export" -f -r -l prefab-min-sdk -d "Android minimum supported sdk version" +complete -c vcpkg -n "__fish_seen_subcommand_from export" -f -r -l prefab-target-sdk -d "Android target sdk version" + +# options for remove +complete -c vcpkg -n "__fish_seen_subcommand_from remove" -f -l purge -d "Remove the cached copy of the package (default)" +complete -c vcpkg -n "__fish_seen_subcommand_from remove" -f -l no-purge -d "Do not remove the cached copy of the package (deprecated)" +complete -c vcpkg -n "__fish_seen_subcommand_from remove" -f -l recurse -d "Allow removal of packages not explicitly specified on the command line" +complete -c vcpkg -n "__fish_seen_subcommand_from remove" -f -l dry-run -d "Print the packages to be removed, but do not remove them" +complete -c vcpkg -n "__fish_seen_subcommand_from remove" -f -l outdated -d "Select all packages with versions that do not match the portfiles" + +# options for upgrade +complete -c vcpkg -n "__fish_seen_subcommand_from upgrade" -f -l no-dry-run -d "Actually upgrade" +complete -c vcpkg -n "__fish_seen_subcommand_from upgrade" -f -l keep-going -d "Continue installing packages on failure" diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/vcpkg_get_dep_info.cmake b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/vcpkg_get_dep_info.cmake new file mode 100644 index 000000000..92212b82d --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/vcpkg_get_dep_info.cmake @@ -0,0 +1,19 @@ +function(vcpkg_get_dep_info PORT VCPKG_TRIPLET_ID) + message("d8187afd-ea4a-4fc3-9aa4-a6782e1ed9af") + vcpkg_triplet_file(${VCPKG_TRIPLET_ID}) + + # GUID used as a flag - "cut here line" + message("c35112b6-d1ba-415b-aa5d-81de856ef8eb +VCPKG_TARGET_ARCHITECTURE=${VCPKG_TARGET_ARCHITECTURE} +VCPKG_CMAKE_SYSTEM_NAME=${VCPKG_CMAKE_SYSTEM_NAME} +VCPKG_CMAKE_SYSTEM_VERSION=${VCPKG_CMAKE_SYSTEM_VERSION} +VCPKG_LIBRARY_LINKAGE=${VCPKG_LIBRARY_LINKAGE} +VCPKG_CRT_LINKAGE=${VCPKG_CRT_LINKAGE} +VCPKG_DEP_INFO_OVERRIDE_VARS=${VCPKG_DEP_INFO_OVERRIDE_VARS} +CMAKE_HOST_SYSTEM_NAME=${CMAKE_HOST_SYSTEM_NAME} +CMAKE_HOST_SYSTEM_PROCESSOR=${CMAKE_HOST_SYSTEM_PROCESSOR} +CMAKE_HOST_SYSTEM_VERSION=${CMAKE_HOST_SYSTEM_VERSION} +CMAKE_HOST_SYSTEM=${CMAKE_HOST_SYSTEM} +e1e74b5c-18cb-4474-a6bd-5c1c8bc81f3f +8c504940-be29-4cba-9f8f-6cd83e9d87b7") +endfunction() diff --git a/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/vcpkg_get_tags.cmake b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/vcpkg_get_tags.cmake new file mode 100644 index 000000000..09d938bbd --- /dev/null +++ b/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/vcpkg_get_tags.cmake @@ -0,0 +1,32 @@ +function(vcpkg_get_tags PORT FEATURES VCPKG_TRIPLET_ID VCPKG_ABI_SETTINGS_FILE) + message("d8187afd-ea4a-4fc3-9aa4-a6782e1ed9af") + vcpkg_triplet_file(${VCPKG_TRIPLET_ID}) + + # GUID used as a flag - "cut here line" + message("c35112b6-d1ba-415b-aa5d-81de856ef8eb +VCPKG_TARGET_ARCHITECTURE=${VCPKG_TARGET_ARCHITECTURE} +VCPKG_CMAKE_SYSTEM_NAME=${VCPKG_CMAKE_SYSTEM_NAME} +VCPKG_CMAKE_SYSTEM_VERSION=${VCPKG_CMAKE_SYSTEM_VERSION} +VCPKG_PLATFORM_TOOLSET=${VCPKG_PLATFORM_TOOLSET} +VCPKG_VISUAL_STUDIO_PATH=${VCPKG_VISUAL_STUDIO_PATH} +VCPKG_CHAINLOAD_TOOLCHAIN_FILE=${VCPKG_CHAINLOAD_TOOLCHAIN_FILE} +VCPKG_BUILD_TYPE=${VCPKG_BUILD_TYPE} +VCPKG_LIBRARY_LINKAGE=${VCPKG_LIBRARY_LINKAGE} +VCPKG_CRT_LINKAGE=${VCPKG_CRT_LINKAGE} +e1e74b5c-18cb-4474-a6bd-5c1c8bc81f3f") + + # Just to enforce the user didn't set it in the triplet file + if (DEFINED VCPKG_PUBLIC_ABI_OVERRIDE) + set(VCPKG_PUBLIC_ABI_OVERRIDE) + message(WARNING "VCPKG_PUBLIC_ABI_OVERRIDE set in the triplet will be ignored.") + endif() + include("${VCPKG_ABI_SETTINGS_FILE}" OPTIONAL) + + message("c35112b6-d1ba-415b-aa5d-81de856ef8eb +VCPKG_PUBLIC_ABI_OVERRIDE=${VCPKG_PUBLIC_ABI_OVERRIDE} +VCPKG_ENV_PASSTHROUGH=${VCPKG_ENV_PASSTHROUGH} +VCPKG_ENV_PASSTHROUGH_UNTRACKED=${VCPKG_ENV_PASSTHROUGH_UNTRACKED} +VCPKG_LOAD_VCVARS_ENV=${VCPKG_LOAD_VCVARS_ENV} +e1e74b5c-18cb-4474-a6bd-5c1c8bc81f3f +8c504940-be29-4cba-9f8f-6cd83e9d87b7") +endfunction() |