Changeset - r24257:fcaa8490c179
[Not reviewed]
master
0 3 0
glx22 - 4 years ago 2020-06-07 14:11:36
glx@openttd.org
Fix: CMake option values should be ON/OFF
3 files changed with 8 insertions and 8 deletions:
0 comments (0 inline, 0 general)
azure-pipelines/templates/release.yml
Show inline comments
 
@@ -46,97 +46,97 @@ jobs:
 
    displayName: 'Copy meta files'
 
  - template: release-bundles.yml
 
    parameters:
 
      CalculateChecksums: false
 

	
 
- job: docs
 
  displayName: 'Docs'
 
  pool:
 
    vmImage: 'ubuntu-16.04'
 
  dependsOn: source
 

	
 
  steps:
 
    - template: release-fetch-source.yml
 
    - template: linux-build.yml
 
      parameters:
 
        Image: compile-farm
 
        ContainerCommand: '$(Build.BuildNumber)'
 
        Tag: docs
 
    - template: linux-claim-bundles.yml
 
    - template: release-bundles.yml
 

	
 
- job: windows
 
  displayName: 'Windows'
 
  pool:
 
    vmImage: 'VS2017-Win2016'
 
  dependsOn: source
 

	
 
  strategy:
 
    matrix:
 
      Win32:
 
        BundlePlatform: 'win32'
 
        BuildArch: 'Win32'
 
        VcpkgTargetTriplet: 'x86-windows-static'
 
      Win64:
 
        BundlePlatform: 'win64'
 
        BuildArch: 'x64'
 
        VcpkgTargetTriplet: 'x64-windows-static'
 

	
 
  steps:
 
  - template: release-fetch-source.yml
 
  - template: windows-dependencies.yml
 
  - template: windows-dependency-zip.yml
 
  - template: windows-build.yml
 
    parameters:
 
      BuildArch: $(BuildArch)
 
      VcpkgTargetTriplet: $(VcpkgTargetTriplet)
 
      BuildConfiguration: 'RelWithDebInfo'
 
      ${{ if eq(parameters.IsStableRelease, true) }}:
 
        OptionUseNSIS: "YES"
 
        OptionUseNSIS: "ON"
 
  - task: VSBuild@1
 
    displayName: 'Create bundles'
 
    inputs:
 
      solution: build/PACKAGE.vcxproj
 
      configuration: 'RelWithDebInfo'
 
  - bash: |
 
      set -ex
 

	
 
      cp build/RelWithDebInfo/openttd.pdb build/bundles/openttd-$(Build.BuildNumber)-windows-$(BundlePlatform).pdb
 
      xz -9 build/bundles/openttd-$(Build.BuildNumber)-windows-$(BundlePlatform).pdb
 
    displayName: 'Copy PDB to bundles folder'
 
  - template: release-bundles.yml
 

	
 
- ${{ if eq(parameters.IsStableRelease, true) }}:
 
  - job: linux_stable
 
    displayName: 'Linux'
 
    pool:
 
      vmImage: 'ubuntu-16.04'
 
    dependsOn: source
 

	
 
    strategy:
 
      matrix:
 
        linux-ubuntu-xenial-i386-gcc:
 
          Tag: 'linux-ubuntu-xenial-i386-gcc'
 
        linux-ubuntu-xenial-amd64-gcc:
 
          Tag: 'linux-ubuntu-xenial-amd64-gcc'
 
        linux-ubuntu-bionic-i386-gcc:
 
          Tag: 'linux-ubuntu-bionic-i386-gcc'
 
        linux-ubuntu-bionic-amd64-gcc:
 
          Tag: 'linux-ubuntu-bionic-amd64-gcc'
 
        linux-ubuntu-focal-amd64-gcc:
 
          Tag: 'linux-ubuntu-focal-amd64-gcc'
 
        linux-debian-stretch-i386-gcc:
 
          Tag: 'linux-debian-stretch-i386-gcc'
 
        linux-debian-stretch-amd64-gcc:
 
          Tag: 'linux-debian-stretch-amd64-gcc'
 
        linux-debian-buster-i386-gcc:
 
          Tag: 'linux-debian-buster-i386-gcc'
 
        linux-debian-buster-amd64-gcc:
 
          Tag: 'linux-debian-buster-amd64-gcc'
 

	
 
    steps:
 
    - template: release-fetch-source.yml
 
    - template: linux-build.yml
 
      parameters:
 
        Image: compile-farm
 
        ContainerCommand: '$(Build.BuildNumber)'
 
        Tag: $(Tag)
azure-pipelines/templates/windows-build.yml
Show inline comments
 
parameters:
 
  BuildArch: ''
 
  VcpkgTargetTriplet: ''
 
  BuildConfiguration: ''
 
  OptionUseNSIS: 'NO'
 
  OptionUseNSIS: 'OFF'
 

	
 
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 }}" -DOPTION_USE_NSIS="${{ parameters.OptionUseNSIS }}"'
 
- task: VSBuild@1
 
  displayName: 'Build'
 
  inputs:
 
    solution: build/openttd.vcxproj
 
    configuration: ${{ parameters.BuildConfiguration }}
 
    maximumCpuCount: true
cmake/Options.cmake
Show inline comments
 
# Set the options for the directories (personal, shared, global).
 
#
 
# set_directory_options()
 
#
 
function(set_directory_options)
 
    if (APPLE)
 
        set(DEFAULT_PERSONAL_DIR "Documents/OpenTTD")
 
        set(DEFAULT_SHARED_DIR "/Library/Application Support/OpenTTD")
 
        set(DEFAULT_GLOBAL_DIR "(not set)")
 
    elseif (WIN32)
 
        set(DEFAULT_PERSONAL_DIR "OpenTTD")
 
        set(DEFAULT_SHARED_DIR "(not set)")
 
        set(DEFAULT_GLOBAL_DIR "(not set)")
 
    elseif (UNIX)
 
        set(DEFAULT_PERSONAL_DIR ".openttd")
 
        set(DEFAULT_SHARED_DIR "(not set)")
 
        set(DEFAULT_GLOBAL_DIR "${CMAKE_INSTALL_PREFIX}/share/games/openttd")
 
    else ()
 
        message(FATAL_ERROR "Unknown OS found; please consider creating a Pull Request to add support for this OS.")
 
    endif ()
 

	
 
    if (NOT PERSONAL_DIR)
 
        set(PERSONAL_DIR "${DEFAULT_PERSONAL_DIR}" CACHE STRING "Personal directory")
 
        message(STATUS "Detecting Personal Data directory - ${PERSONAL_DIR}")
 
    endif (NOT PERSONAL_DIR)
 

	
 
    if (NOT SHARED_DIR)
 
        set(SHARED_DIR "${DEFAULT_SHARED_DIR}" CACHE STRING "Shared directory")
 
        message(STATUS "Detecting Shared Data directory - ${SHARED_DIR}")
 
    endif (NOT SHARED_DIR)
 

	
 
    if (NOT GLOBAL_DIR)
 
        set(GLOBAL_DIR "${DEFAULT_GLOBAL_DIR}" CACHE STRING "Global directory")
 
        message(STATUS "Detecting Global Data directory - ${GLOBAL_DIR}")
 
    endif (NOT GLOBAL_DIR)
 
endfunction()
 

	
 
# Set some generic options that influence what is being build.
 
#
 
# set_options()
 
#
 
function(set_options)
 
    if (UNIX AND NOT APPLE)
 
        set(DEFAULT_OPTION_INSTALL_FHS YES)
 
        set(DEFAULT_OPTION_INSTALL_FHS ON)
 
    else (UNIX AND NOT APPLE)
 
        set(DEFAULT_OPTION_INSTALL_FHS NO)
 
        set(DEFAULT_OPTION_INSTALL_FHS OFF)
 
    endif (UNIX AND NOT APPLE)
 

	
 
    option(OPTION_DEDICATED "Build dedicated server only (no GUI)" NO)
 
    option(OPTION_DEDICATED "Build dedicated server only (no GUI)" OFF)
 
    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)
 
    option(OPTION_USE_ASSERTS "Use assertions; leave enabled for nightlies, betas, and RCs" ON)
 
    option(OPTION_USE_THREADS "Use threads" ON)
 
    option(OPTION_USE_NSIS "Use NSIS to create windows installer; enable only for stable releases" OFF)
 
endfunction()
 

	
 
# Show the values of the generic options.
 
#
 
# show_options()
 
#
 
function(show_options)
 
    message(STATUS "Option Dedicated - ${OPTION_DEDICATED}")
 
    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.
 
#
 
# add_definitions_based_on_options()
 
#
 
function(add_definitions_based_on_options)
 
    if (OPTION_DEDICATED)
 
        add_definitions(-DDEDICATED)
 
    endif (OPTION_DEDICATED)
 

	
 
    if (NOT OPTION_USE_THREADS)
 
        add_definitions(-DNO_THREADS)
 
    endif (NOT OPTION_USE_THREADS)
 

	
 
    if (OPTION_USE_ASSERTS)
 
        add_definitions(-DWITH_ASSERT)
 
    else (OPTION_USE_ASSERTS)
 
        add_definitions(-DNDEBUG)
 
    endif (OPTION_USE_ASSERTS)
 
endfunction()
0 comments (0 inline, 0 general)