diff --git a/make.ps1 b/make.ps1 index 64d73e62b3d5d710cd6e2378679bb3bb743a29ea..5bbadaf9aba2a89d66e65ec234d0bc9627d66cbb 100644 --- a/make.ps1 +++ b/make.ps1 @@ -2,6 +2,9 @@ param ( [string]$target ) +$buildType = "Release" +$cppStd=17 + function Install-Conan { Write-Output "Installing Release dependencies with Conan..." # check if conan is available @@ -9,11 +12,11 @@ function Install-Conan { Write-Output "Conan is not available. Please install Conan or activate the Conan environment venv" exit 1 } - conan install . --build=missing -s build_type=Release -s compiler.cppstd=17 + conan install . --build=missing -s build_type=$buildType -s compiler.cppstd=$cppStd cmake --preset conan-default } -function Build-Project { +function Invoke-Build { Write-Output "Building the project..." # check if msbuild is available if (-not (Get-Command msbuild -ErrorAction SilentlyContinue)) { @@ -25,7 +28,7 @@ function Build-Project { Write-Output "Please run conan-install first." exit 1 } - msbuild .\build\liblinkahead.sln /property:Configuration=Release + msbuild .\build\liblinkahead.sln /property:Configuration=$buildType } function Invoke-Tests { @@ -37,6 +40,12 @@ function Invoke-Tests { } Set-Location .\build\ ctest + Set-Location ..\ +} + +function Invoke-Create { + Write-Output "Creating Conan package..." + conan create . } # check if vswhere is available @@ -57,7 +66,7 @@ Set-Location $currentPath switch ($target) { "build" { - Build-Project + Invoke-Build } "test" { Invoke-Tests @@ -65,16 +74,20 @@ switch ($target) { "conan-install" { Install-Conan } + "conan-create" { + Invoke-Create + } "clean"{ Write-Output "Cleaning the project..." Remove-Item -Recurse -Force .\build\* } "all" { Install-Conan - Build-Project + Invoke-Build Invoke-Tests + Invoke-Create } default { - Write-Output "Usage: .\make.ps1 [all|conan-install|build|test|clean]" + Write-Output "Usage: .\make.ps1 [all|conan-install|conan-create|build|test|clean]" } }