Skip to content
Snippets Groups Projects
Commit fc8b5caf authored by Joscha Schmiedt's avatar Joscha Schmiedt
Browse files

Add conan-create to ps1 Makfile

parent 2c04accd
No related branches found
No related tags found
2 merge requests!61Release 0.3.0,!58Fix conan create on Windows
Pipeline #56340 failed
...@@ -2,6 +2,9 @@ param ( ...@@ -2,6 +2,9 @@ param (
[string]$target [string]$target
) )
$buildType = "Release"
$cppStd=17
function Install-Conan { function Install-Conan {
Write-Output "Installing Release dependencies with Conan..." Write-Output "Installing Release dependencies with Conan..."
# check if conan is available # check if conan is available
...@@ -9,11 +12,11 @@ function Install-Conan { ...@@ -9,11 +12,11 @@ function Install-Conan {
Write-Output "Conan is not available. Please install Conan or activate the Conan environment venv" Write-Output "Conan is not available. Please install Conan or activate the Conan environment venv"
exit 1 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 cmake --preset conan-default
} }
function Build-Project { function Invoke-Build {
Write-Output "Building the project..." Write-Output "Building the project..."
# check if msbuild is available # check if msbuild is available
if (-not (Get-Command msbuild -ErrorAction SilentlyContinue)) { if (-not (Get-Command msbuild -ErrorAction SilentlyContinue)) {
...@@ -25,7 +28,7 @@ function Build-Project { ...@@ -25,7 +28,7 @@ function Build-Project {
Write-Output "Please run conan-install first." Write-Output "Please run conan-install first."
exit 1 exit 1
} }
msbuild .\build\liblinkahead.sln /property:Configuration=Release msbuild .\build\liblinkahead.sln /property:Configuration=$buildType
} }
function Invoke-Tests { function Invoke-Tests {
...@@ -37,6 +40,12 @@ function Invoke-Tests { ...@@ -37,6 +40,12 @@ function Invoke-Tests {
} }
Set-Location .\build\ Set-Location .\build\
ctest ctest
Set-Location ..\
}
function Invoke-Create {
Write-Output "Creating Conan package..."
conan create .
} }
# check if vswhere is available # check if vswhere is available
...@@ -57,7 +66,7 @@ Set-Location $currentPath ...@@ -57,7 +66,7 @@ Set-Location $currentPath
switch ($target) { switch ($target) {
"build" { "build" {
Build-Project Invoke-Build
} }
"test" { "test" {
Invoke-Tests Invoke-Tests
...@@ -65,16 +74,20 @@ switch ($target) { ...@@ -65,16 +74,20 @@ switch ($target) {
"conan-install" { "conan-install" {
Install-Conan Install-Conan
} }
"conan-create" {
Invoke-Create
}
"clean"{ "clean"{
Write-Output "Cleaning the project..." Write-Output "Cleaning the project..."
Remove-Item -Recurse -Force .\build\* Remove-Item -Recurse -Force .\build\*
} }
"all" { "all" {
Install-Conan Install-Conan
Build-Project Invoke-Build
Invoke-Tests Invoke-Tests
Invoke-Create
} }
default { 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]"
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment