Building multiple .exe files

RonG's Avatar

RonG

30 May, 2018 04:19 PM

I need to build 3 flavors of my program (three different .exe files). All three come from the same git repo, but I need to invoke cmake once for each of the builds and then build.

I have a clone_script: in my appveyor.yml file due to needing to clone two git repos to build the project (project+my custom library). I also have a build_script: that runs cmake and then msbuild.exe

It seems like this is a job for matrix:, but I'm not sure if this is overkill. It takes a while to clone to two repros, so I'd rather not do that 3 times. I could put all three builds in one build_script:, but I need 3 different artifacts to get all three .exe files.

What is the best way to do this?

  1. Support Staff 1 Posted by Owen McDonnell on 31 May, 2018 05:57 AM

    Owen McDonnell's Avatar

    If you want to avoid repeating clone process multiple times then you could simply put those artifacts (which i assume share the same package name) into separate folders, and not bother with a 'for' matrix.

    But if the clone step doesn't run for too long then the matrix option might make for more clarity in build history and configuration file. Plus the jobs will be isolated from each other's potential side effects. If you wanted to leverage the matrix for such benefits, you could just define 3 values under a configuration: key and then filter for them under a for: node.

    configuration:
      - flavor1
      - flavor2
      - flavor3
    for:
      -
        matrix:
          only:
            - configuration: flavor1
        build_script:
          - custom build script
      -
         matrix:
          only:
            - configuration: flavor2
        build_script:
          - custom build script
      -
        matrix:
          only:
            - configuration: flavor2
        build_script:
          - custom build script
    
  2. 2 Posted by RonG on 03 Jun, 2018 09:52 PM

    RonG's Avatar

    The first option is more appealing, but how do I create one build script that produces sperate artifacts? Each of my 3 flavors produces a Release build and (as far as I can figure out) cmake is fairly rigid in its Debug/Release configurations.... and I do need to run cmake for each of my flavors. I guess the build script could copy the Release folder into a new folder that is part of the artifact.

  3. Support Staff 3 Posted by Owen McDonnell on 04 Jun, 2018 02:55 PM

    Owen McDonnell's Avatar

    I know very little about cmake so pardon my ignorance, but why wouldn't a simple approach with 3 top level directories, a 'CmakeLists.txt' in each of them, and 3 calls to cmake/msbuild work?

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

 

18 Aug, 2018 11:54 AM
18 Aug, 2018 12:13 AM
17 Aug, 2018 06:02 PM
17 Aug, 2018 04:26 PM
17 Aug, 2018 04:04 PM
17 Aug, 2018 06:31 AM