Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The libdatachannel compilation on MSVC relies on mbedTLS. But since the latter DLLs fail to compile on MSVC due to long-standing bugs, mbedTLS is linked statically to libdatachannel. The library is checked out at a commit enabling simulcast. Signed-off-by: pkv <pkv@obsproject.com>
- Loading branch information
Showing
1 changed file
with
83 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
param( | ||
[string] $Name = 'libdatachannel', | ||
[string] $Version = '0.19.0-alpha.4', | ||
[string] $Uri = 'https://github.com/paullouisageneau/libdatachannel.git', | ||
[string] $Hash = '709a66339451bb4c8d4e5ced78c67605ec09da31', | ||
[switch] $ForceShared = $true | ||
) | ||
|
||
function Setup { | ||
Invoke-GitCheckout -Uri $Uri -Commit $Hash | ||
} | ||
|
||
function Clean { | ||
Set-Location $Path | ||
|
||
if ( Test-Path "build_${Target}" ) { | ||
Log-Information "Clean build directory (${Target})" | ||
Remove-Item -Path "build_${Target}" -Recurse -Force | ||
} | ||
} | ||
|
||
function Configure { | ||
Log-Information "Configure (${Target})" | ||
Set-Location $Path | ||
|
||
if ( $ForceShared -and ( $script:Shared -eq $false ) ) { | ||
$Shared = $true | ||
} else { | ||
$Shared = $script:Shared.isPresent | ||
} | ||
|
||
$OnOff = @('OFF', 'ON') | ||
$Options = @( | ||
$CmakeOptions | ||
"-DENABLE_SHARED:BOOL=$($OnOff[$Shared])" | ||
'-DUSE_MBEDTLS=BOOL=ON' | ||
'-DNO_WEBSOCKET=BOOL=ON' | ||
'-DNO_TESTS=BOOL=ON' | ||
'-DNO_EXAMPLES=BOOL=ON' | ||
) | ||
|
||
Invoke-External cmake -S . -B "build_${Target}" @Options | ||
} | ||
|
||
function Build { | ||
Log-Information "Build (${Target})" | ||
Set-Location $Path | ||
|
||
$Options = @( | ||
'--build', "build_${Target}" | ||
'--config', $Configuration | ||
) | ||
|
||
if ( $VerbosePreference -eq 'Continue' ) { | ||
$Options += '--verbose' | ||
} | ||
|
||
$Options += @( | ||
'--' | ||
'/consoleLoggerParameters:Summary' | ||
'/noLogo' | ||
'/p:UseMultiToolTask=true' | ||
'/p:EnforceProcessCountAcrossBuilds=true' | ||
) | ||
|
||
Invoke-External cmake @Options | ||
} | ||
|
||
function Install { | ||
Log-Information "Install (${Target})" | ||
Set-Location $Path | ||
|
||
$Options = @( | ||
'--install', "build_${Target}" | ||
'--config', $Configuration | ||
) | ||
|
||
if ( $Configuration -match "(Release|MinSizeRel)" ) { | ||
$Options += '--strip' | ||
} | ||
|
||
Invoke-External cmake @Options | ||
} |