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 (
[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]"
}
}
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