1

This is similar to the question What do I need to install for C++ project / VS 2013 on TeamCity server or Team Foundation Build Service? but specifically I'd like to do this without requiring VisualStudio to be installed on the server.

I notice there's a List of software on TFS hosted build servers which seems like it probably has the answer: but most of the links are dead (redirecting just to visualstudio.com) and I can't find downloads for the package names listed.

What do I need to install to build C++ projects, without resorting to installing VisualStudio?

Aside, I've previously gone through this with C#, and eventually figured out how to build C#/VB.NET projects without VisualStudio, but it is definitely a pain. Do the vast majority of people actually doing CI just install IDEs on their build servers?

Community
  • 1
  • 1
gregmac
  • 24,276
  • 10
  • 87
  • 118
  • The official documentation states that you should install VS on your build machine. It doesn't require an extra license. Why wouldn't you do it? – Wouter de Kort Feb 22 '16 at 20:34

2 Answers2

1

There are Visual C++ Build Tools , that enable user to compile C++ projects without Visual Studio.

Please refer below link from MSDN Blog for more details:

Announcing Visual C++ Build Tools 2015 – standalone C++ tools for build environments https://blogs.msdn.microsoft.com/vcblog/2015/11/02/announcing-visual-c-build-tools-2015-standalone-c-tools-for-build-environments/

Chamberlain
  • 881
  • 5
  • 17
1

Installing VC++ Build Tools 2015 was only part of the answer (thanks @Chamberlain). Obviously I also had to upgrade the project to 2015 (was originally 2013, and I think originally written in an even earlier version).

To actually build, I'm running the script:

pushd "%programfiles(x86)%"
echo "Calling vcvars..."
CALL "%programfiles(x86)%\Microsoft Visual C++ Build Tools\vcbuildtools.bat" amd64_x86
echo "Execute MSBuild in release mode..."
popd
set useenv=true
MSBuild "PathTo\Project.vcxproj" /t:Rebuild /p:Configuration=Release

The trick is to run vcbuildtools.bat and set useenv=true.

Once this was working I didn't look into how to get this going with the main .sln build -- I suspect it would probably work as-is but I haven't tried.

gregmac
  • 24,276
  • 10
  • 87
  • 118