Building multiple .exe files

Ron's Avatar

Ron

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 Ron on 03 Jun, 2018 09:52 PM

    Ron'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?

  4. Ilya Finkelshteyn closed this discussion on 31 Aug, 2018 07:49 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