Per-platform environment variables

jerome.vuarand's Avatar

jerome.vuarand

25 Aug, 2015 05:34 PM

I'm using a build script for one of my native code projects. I have multiple target platforms (x64 & x86). I'd like to configure environment variables differently depending on the job platform. How can I do that?

I've found the "matrix" node in the "environment" section of appveyor.yml, but that adds another dimension to the matrix, while I would just like to keep my matrix 1D based on platform.

  1. Support Staff 1 Posted by Feodor Fitsner on 26 Aug, 2015 07:06 AM

    Feodor Fitsner's Avatar

    You may do like that:

    environment:
      matrix:
      - platform: x86
        var1: value1
    
      - platform: x64
        var1: value2
        var2: value3
    
  2. 2 Posted by jerome.vuarand on 27 Aug, 2015 11:25 PM

    jerome.vuarand's Avatar

    If I keep platform definitions, this multiplies the number of jobs. And if I remove the platforms, then I get these two "Environment" jobs instead of the two "Platform" jobs I had before, which kindof achieves the purpose.

    However, assuming the %PLATFORM% environment variable is all that is affected by the "platform" section of appveyor.yml, at the very least the job list on the build page doesn't look as nice.

    Since "matrix" seems to be a special keyword in the "environment" section, maybe you should consider adding a "platform" special keyword (and a similar "configuration"), with an associative array rather than a list as value.

  3. Ilya Finkelshteyn closed this discussion on 25 Aug, 2018 01:59 AM.

Comments are currently closed for this discussion. You can start a new one.

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