Inter project dependencies in IAR - iar

Is there anyway to specify dependencies between projects in a IAR workspace? Say you have projects A and B, and A builds a library that B links. Can you force IAR to build A any time you build B?

You can define a batch build, that builds several projects in the order you want

Related

How to organize C++ dependent projects in github?

I have two projects which I want to keep in separate repositories.
Project A is a large project, and project B is a small tool that was at first part of project A.
So the thing is project A needs some of the functions of project B, and project B needs the data structures defined in project A (and probably some functions as well).
I'm coming from a Go background where each module or package would have its own repo. For example, if both project A and project B had to read a particular file type, I would have a "file-reader" package in a separate repo. Is this the way to go with C++ as well?
You should separate your projects into shared libraries, and put the artifacts on Conan. Any executable would need the shared libraries from both project A, and Project B. You can also add the circular dependency to Conan, so both project A and Project B will build (i.e.. Project A depends on B to build, and B depends on A).
https://docs.conan.io/en/latest/

msbuild for visual studio 2008 projects

We have a relatively big C++ application with lots of dependencies. On our build server running msbuild 4.0.30319, we keep getting linker errors and failures when doing incremental builds using msbuild.
After further investigating this, it does appear to be that dependency libraries are not being picked up and built prior to building the application.
The question i have is as follows:
Are there best practices for building such a C++ project with dependencies? if yes, what is the correct way to do incremental builds using MSBUILD for a C++ application built using VS2008 with a fair amount of dependencies.
Just as Thomas comment "build servers should be making full builds, not incremental builds. "
When you create a new build definition on build server by default it does a clean build for you every time. That is to say that between builds all the source from the previous build is deleted along with the compiled outputs and then the source is downloaded fresh, built and you are good to go. There is a good reason for this to be the default – it is the safest option. If your build script messes around with the files in your source directory at all (perhaps baking in a build number into the AssemblyInfo files etc) then you want to get a clean workspace to ensure that you are back to a known good state.
However, if you want to enable the incremental builds in build Server, like TFS, you can refer to the Incremental Builds in Team Foundation Server for more detail.
but i am more interested how msbuild handles build dependencies on an incremental build and if it supports it
Dependencies between projects could result in inconsistent builds. Visual Studio does respect project-to-project references and builds the reference project before the referring project. However, if several projects have a shared reference, that reference is built only once and “cached” for the next times it is referenced. Also, errors and exceptions on one build do not affect the running of other builds, which may depend on the failing build. For the more info, please refer to Managed Incremental Build.

TeamCity How to Trigger a Dependent Build with a Different Logical Branch Name

I have an application Project A that depends on a shared library Project B, with each project having its own VCS Root (different Git repository).
Each project versions independently, e.g. Project A could be at 1.0 while Project B is at version 2.0. We're using GitFlow as a the release model. When we make a change to both Project A and B for a release, each project would have a different release branch name. e.g. Project A: /release/1.0-rc, Project B: /release/2.0-rc.
It is possible somehow to configure Project A release build to have a Snapshot/Artifact Dependency on Project B release build?
While adding a new Artifact dependency, it is requested to add the Depend on, which will be on your Project B configuration.
Then, you can specify the Get artifacts from to Latest successful build, then it will be ask if available, the Build branch to use.
The default value is <default> and in your case, it would be : release/2.0-rc.
Note, in order to make this feature available, your VCS root should have multiple watching branches inside Branch specification

Visual C++ project dependency on multiple architectures

I have a Visual C++ solution with multiple projects. One of the projects (let's name it Project 1) depends on both x86 and x64 versions of another Project 2. It means that when doing a rebuild of Project 1, no matter which architecture is selected I want both x86 and x64 versions of Project 2 to be compiled, prior to Project 1.
Standard Project Dependency feature doesn't allow to specify dependency on multiple architectures. Is there any way to accomplish this task?
Visual C++ has a command line compiler.
You can execute it on the project you need built, or split your code into multiple slns and tell the command line to build the slns.
This dependency can be set up as a custom build step, or you could go and write a makefile that describes your project dependencies and replace your sln build with that.
You can use a Custom Build Step or Custom Build Event to call msbuild twice, once for each architecture. This is how Visual Studio builds projects, so you are effectively recursively calling the build system.
Here's more detailed information:
Understanding Custom Build Steps and Build Events
https://msdn.microsoft.com/en-us/library/e85wte0k.aspx

Multiple build targets in visual studio C/C++

Is it possible to compile in one fell swoop multiple build targets? For example, I would like to compile an .exe and a static library which includes everything but the .c file that includes main()
If that's not possible, how to manage multiple build targets like this?
You actually can build multiple configurations of the same project. So you need make sure each individual configuration builds okay and in separate path. Then you can use Batch Build dialog to do build all in one time. I hope it should be even possible to build exe and dll using the same project, but different configurations.
Build multiple configurations simulataneously:
On the menu bar, choose Build, Batch Build.
In the Build column, select the check boxes for the configurations in which you want to build a project.
Choose the Build or Rebuild buttons to build the project with the configurations that you specified.
For more reference, see the batch build dialog box.