Environment variables in appveyor

mailtokartik1's Avatar

mailtokartik1

11 Jan, 2019 02:39 AM

Hello there,
Is there any way we can add multiple values of an environment variable in an appveyor? I want to add an environment variable in my project TARGET_ARCH so that it changes values based on whether the build is being run on Windows x64 or Windows x86 system and use the same value in the yml file. Can somebody help me with this?

  1. Support Staff 1 Posted by Owen McDonnell on 11 Jan, 2019 06:51 PM

    Owen McDonnell's Avatar

    I suppose you could have something in install: section like,

     - cmd: if %processor_architecture% == AMD64 (SET TARET_ARCH=x64)
    

    but i'm not sure how useful it is since all our build machines are x64.

  2. 2 Posted by mailtokartik1 on 15 Jan, 2019 01:02 AM

    mailtokartik1's Avatar

    Wouldnt using PLATFORM environment variable be helpful?

  3. Support Staff 3 Posted by Owen McDonnell on 15 Jan, 2019 01:21 AM

    Owen McDonnell's Avatar

    There is no such system or user PLATFORM environment variable. There is one that is used by msbuild when it is called to build a project or solution.

    So do you mean you want this TARGET_ARCH variable to change based on the platform you are targeting in your project?

  4. 4 Posted by mailtokartik1 on 15 Jan, 2019 01:32 AM

    mailtokartik1's Avatar

    yes I want TARGET_ARCH variable to change based on the platform you are targeting in your project?

  5. 5 Posted by mailtokartik1 on 15 Jan, 2019 01:33 AM

    mailtokartik1's Avatar

    yes I want TARGET_ARCH variable to change based on the platform I am targeting in my project.

  6. Support Staff 6 Posted by Owen McDonnell on 15 Jan, 2019 06:35 PM

    Owen McDonnell's Avatar

    Sorry for confusion, if you are defining a build matrix with platform as a dimension then yes, it would make sense to use that as a variable.

  7. Ilya Finkelshteyn closed this discussion on 17 Mar, 2019 09:00 PM.

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