From 0915b3ef56dfac3113cce55a59a5765dc94976be Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 28 Apr 2024 14:34:54 +0200 Subject: Adding upstream version 2.13.6. Signed-off-by: Daniel Baumann --- tools/win32/configure-dev.ps1 | 71 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 tools/win32/configure-dev.ps1 (limited to 'tools/win32/configure-dev.ps1') diff --git a/tools/win32/configure-dev.ps1 b/tools/win32/configure-dev.ps1 new file mode 100644 index 0000000..c3bb836 --- /dev/null +++ b/tools/win32/configure-dev.ps1 @@ -0,0 +1,71 @@ +Set-PsDebug -Trace 1 + +# Specify default targets for VS 2019 for developers. + +if (-not (Test-Path env:ICINGA2_BUILDPATH)) { + $env:ICINGA2_BUILDPATH = '.\debug' +} +if (-not (Test-Path "$env:ICINGA2_BUILDPATH")) { + mkdir "$env:ICINGA2_BUILDPATH" | out-null +} + +if (-not (Test-Path env:CMAKE_BUILD_TYPE)) { + $env:CMAKE_BUILD_TYPE = 'Debug' +} +if (-not (Test-Path env:ICINGA2_INSTALLPATH)) { + $env:ICINGA2_INSTALLPATH = 'C:\Program Files\Icinga2-debug' +} +if (-not (Test-Path env:CMAKE_PATH)) { + $env:CMAKE_PATH = 'C:\Program Files\CMake\bin' +} +if (-not ($env:PATH -contains $env:CMAKE_PATH)) { + $env:PATH = $env:CMAKE_PATH + ';' + $env:PATH +} +if (-not (Test-Path env:CMAKE_GENERATOR)) { + $env:CMAKE_GENERATOR = 'Visual Studio 16 2019' +} +if (-not (Test-Path env:CMAKE_GENERATOR_PLATFORM)) { + $env:CMAKE_GENERATOR_PLATFORM = 'x64' +} +if (-not (Test-Path env:OPENSSL_ROOT_DIR)) { + $env:OPENSSL_ROOT_DIR = 'c:\local\OpenSSL-Win64' +} +if (-not (Test-Path env:BOOST_ROOT)) { + $env:BOOST_ROOT = 'c:\local\boost_1_80_0' +} +if (-not (Test-Path env:BOOST_LIBRARYDIR)) { + $env:BOOST_LIBRARYDIR = 'c:\local\boost_1_80_0\lib64-msvc-14.2' +} +if (-not (Test-Path env:FLEX_BINARY)) { + $env:FLEX_BINARY = 'C:\ProgramData\chocolatey\bin\win_flex.exe' +} +if (-not (Test-Path env:BISON_BINARY)) { + $env:BISON_BINARY = 'C:\ProgramData\chocolatey\bin\win_bison.exe' +} + +$sourcePath = Get-Location + +cd "$env:ICINGA2_BUILDPATH" + +# Invalidate cache in case something in the build environment changed +if (Test-Path CMakeCache.txt) { + Remove-Item -Force CMakeCache.txt | Out-Null +} + +& cmake.exe "$sourcePath" ` + -DCMAKE_BUILD_TYPE="$env:CMAKE_BUILD_TYPE" ` + -G "$env:CMAKE_GENERATOR" -A "$env:CMAKE_GENERATOR_PLATFORM" -DCPACK_GENERATOR=WIX ` + -DCMAKE_INSTALL_PREFIX="$env:ICINGA2_INSTALLPATH" ` + -DICINGA2_WITH_MYSQL=OFF -DICINGA2_WITH_PGSQL=OFF ` + -DICINGA2_WITH_LIVESTATUS=OFF -DICINGA2_WITH_COMPAT=OFF ` + -DOPENSSL_ROOT_DIR="$env:OPENSSL_ROOT_DIR" ` + -DBOOST_LIBRARYDIR="$env:BOOST_LIBRARYDIR" ` + -DBOOST_INCLUDEDIR="$env:BOOST_ROOT" ` + -DFLEX_EXECUTABLE="$env:FLEX_BINARY" ` + -DBISON_EXECUTABLE="$env:BISON_BINARY" + +cd "$sourcePath" + +if ($lastexitcode -ne 0) { + exit $lastexitcode +} -- cgit v1.2.3