summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorglx22 <glx@openttd.org>2020-06-07 04:34:50 +0200
committerCharles Pigott <charlespigott@googlemail.com>2020-06-08 09:49:26 +0100
commit3d766775948fefa9ffe6e564dce844b24e2f11e0 (patch)
treeca45a86ac04eaf23f0eecf7c97111e2067c3aebd
parentf51e66f697e2956d57671afd90a57ca932356756 (diff)
downloadopenttd-3d766775948fefa9ffe6e564dce844b24e2f11e0.tar.xz
Fix: Generate windows installer only for stable releases
-rw-r--r--azure-pipelines/templates/release.yml2
-rw-r--r--azure-pipelines/templates/windows-build.yml3
-rw-r--r--cmake/InstallAndPackage.cmake7
-rw-r--r--cmake/Options.cmake2
4 files changed, 11 insertions, 3 deletions
diff --git a/azure-pipelines/templates/release.yml b/azure-pipelines/templates/release.yml
index 60e2ff5fd..9c126a8f3 100644
--- a/azure-pipelines/templates/release.yml
+++ b/azure-pipelines/templates/release.yml
@@ -90,6 +90,8 @@ jobs:
BuildArch: $(BuildArch)
VcpkgTargetTriplet: $(VcpkgTargetTriplet)
BuildConfiguration: 'RelWithDebInfo'
+ ${{ if eq(parameters.IsStableRelease, true) }}:
+ OptionUseNSIS: "YES"
- task: VSBuild@1
displayName: 'Create bundles'
inputs:
diff --git a/azure-pipelines/templates/windows-build.yml b/azure-pipelines/templates/windows-build.yml
index fccf62d7b..07e42a7ce 100644
--- a/azure-pipelines/templates/windows-build.yml
+++ b/azure-pipelines/templates/windows-build.yml
@@ -2,12 +2,13 @@ parameters:
BuildArch: ''
VcpkgTargetTriplet: ''
BuildConfiguration: ''
+ OptionUseNSIS: 'NO'
steps:
- task: CMake@1
displayName: 'Configure'
inputs:
- cmakeArgs: '.. -G "Visual Studio 15 2017" -A ${{ parameters.BuildArch }} -DCMAKE_TOOLCHAIN_FILE="c:\vcpkg\scripts\buildsystems\vcpkg.cmake" -DVCPKG_TARGET_TRIPLET="${{ parameters.VcpkgTargetTriplet }}"'
+ cmakeArgs: '.. -G "Visual Studio 15 2017" -A ${{ parameters.BuildArch }} -DCMAKE_TOOLCHAIN_FILE="c:\vcpkg\scripts\buildsystems\vcpkg.cmake" -DVCPKG_TARGET_TRIPLET="${{ parameters.VcpkgTargetTriplet }}" -DOPTION_USE_NSIS="${{ parameters.OptionUseNSIS }}"'
- task: VSBuild@1
displayName: 'Build'
inputs:
diff --git a/cmake/InstallAndPackage.cmake b/cmake/InstallAndPackage.cmake
index 1994c0708..1cc539d2d 100644
--- a/cmake/InstallAndPackage.cmake
+++ b/cmake/InstallAndPackage.cmake
@@ -86,8 +86,11 @@ if (APPLE)
set(CPACK_PACKAGE_FILE_NAME "openttd-#CPACK_PACKAGE_VERSION#-macosx")
elseif (WIN32)
- set(CPACK_GENERATOR "ZIP;NSIS")
- include(PackageNSIS)
+ set(CPACK_GENERATOR "ZIP")
+ if (OPTION_USE_NSIS)
+ list(APPEND CPACK_GENERATOR "NSIS")
+ include(PackageNSIS)
+ endif (OPTION_USE_NSIS)
set(CPACK_PACKAGE_FILE_NAME "openttd-#CPACK_PACKAGE_VERSION#-windows-${CPACK_SYSTEM_NAME}")
elseif (UNIX)
diff --git a/cmake/Options.cmake b/cmake/Options.cmake
index b292567f0..51c8b7886 100644
--- a/cmake/Options.cmake
+++ b/cmake/Options.cmake
@@ -50,6 +50,7 @@ function(set_options)
option(OPTION_INSTALL_FHS "Install with Filesstem Hierarchy Standard folders" ${DEFAULT_OPTION_INSTALL_FHS})
option(OPTION_USE_ASSERTS "Use assertions; leave enabled for nightlies, betas, and RCs" YES)
option(OPTION_USE_THREADS "Use threads" YES)
+ option(OPTION_USE_NSIS "Use NSIS to create windows installer; enable only for stable releases" NO)
endfunction()
# Show the values of the generic options.
@@ -61,6 +62,7 @@ function(show_options)
message(STATUS "Option Install FHS - ${OPTION_INSTALL_FHS}")
message(STATUS "Option Use assert - ${OPTION_USE_ASSERTS}")
message(STATUS "Option Use threads - ${OPTION_USE_THREADS}")
+ message(STATUS "Option Use NSIS - ${OPTION_USE_NSIS}")
endfunction()
# Add the definitions for the options that are selected.