Multi-project build with different build platforms

Matt's Avatar

Matt

30 Jan, 2020 03:21 PM

I have a Visual Studio solution that contains three projects.

  • MonoTest.Shared
  • MonoTest.DirectX
  • MonoTest.OpenGL

The Shared project is, obviously, a shared project that is referenced by the DirectX and OpenGL projects. I have managed to successfuly build the DirectX project but the OpenGl project fails with the following error: The OutputPath property is not set for project 'MonoTest.OpenGL.csproj'. Please check to make sure that you have specified a valid combination of Configuration and Platform for this project. Configuration='Release' Platform='x86'.

The DirectX project can only build on x86 platform, while the OpenGL project builds with Any CPU.

Is it possible to setup the matrix so each project can build for platforms? So DirectX: Release x86 + Debug x86 and OpenGL: Release: Any CPU + Debug Any CPU.

This is my current appveyor.yml file.

version: 1.0.{build}

configuration:
  - Release
  - Debug

platform: x86

install:
- ps: >-
    $source = "https://github.com/MonoGame/MonoGame/releases/download/v3.7.1/MonoGameSetup.exe"

    $output = "MonoGameSetup.exe"

    Start-FileDownload $source

    Start-Process -Wait -FilePath $output /S

environment:
  matrix:
    - project_name: MonoTest.Another
    - project_name: MonoTest.DirectX
    - project_name: MonoTest.OpenGL

build:
  project: $(project_name)/$(project_name).csproj
  verbosity: minimal

test: off

matrix:
  fast_finish: true
  1. 1 Posted by Matt on 31 Jan, 2020 10:04 AM

    Matt's Avatar

    Update. This config seemed to work. One minor annoyance is the list of build jobs, it shows

    • DirectX
    • DirectX
    • OpenGL
    • OpenGL

    It would be nice to see which configuration it's using.

    version: 1.0.{build}
    
    install:
    - ps: >-
        $source = "https://github.com/MonoGame/MonoGame/releases/download/v3.7.1/MonoGameSetup.exe"
    
        $output = "MonoGameSetup.exe"
    
        Start-FileDownload $source
    
        Start-Process -Wait -FilePath $output /S
    
    configuration:
    - Release
    - Debug
    
    environment:
      matrix:
    
      # DirectX Job
      - job_name: DirectX
        project_name: MonoTest.DirectX
        platform: x86
    
      # OpenGL Job
      - job_name: OpenGL
        project_name: MonoTest.OpenGL
        platform: AnyCPU
    
    matrix:
      fast_finish: true
    
    build:
      project: $(project_name)/$(project_name).csproj
      parallel: true
      verbosity: minimal
    
    test: off
    
  2. Support Staff 2 Posted by Feodor Fitsner on 31 Jan, 2020 09:43 PM

    Feodor Fitsner's Avatar

    You can enumerate all configurations explicitly instead:

    version: 1.0.{build}
    
    install:
    - ps: >-
        $source = "https://github.com/MonoGame/MonoGame/releases/download/v3.7.1/MonoGameSetup.exe"
    
        $output = "MonoGameSetup.exe"
    
        Start-FileDownload $source
    
        Start-Process -Wait -FilePath $output /S
    
    environment:
      matrix:
    
      - job_name: DirectX, Debug
        project_name: MonoTest.DirectX
        platform: x86
        configuration: Debug
    
      - job_name: OpenGL, Debug
        project_name: MonoTest.OpenGL
        platform: AnyCPU
        configuration: Debug
        
      - job_name: DirectX, Release
        project_name: MonoTest.DirectX
        platform: x86
        configuration: Release
    
      - job_name: OpenGL, Release
        project_name: MonoTest.OpenGL
        platform: AnyCPU
        configuration: Release
    
    matrix:
      fast_finish: true
    
    build:
      project: $(project_name)/$(project_name).csproj
      parallel: true
      verbosity: minimal
    
    test: off
    

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac