Hi there. I have a test repository that compiles c/c++ on windows with mingw or visual studio using cmake, if you are interested. The builds are available here.
The .travis.yml is set to language:bash. With cpp the worker are stuck on booting. But even with this, I can compile a simple project. Obviously it should be expanded for more complex projects.
Oh, that is interesting. So it does “work”, except that language: cpp is simply blocked early in the process. Unfortunately I have other builds which need language: cpp in my case so changing it to bash is not an option.
I wonder, is there a way to lift the language: cpp restriction?
The big question is, what commands are standard for us to run? What is best practice? Does anyone have any links to a cpp project or two which is running on Travis to see what we need to do?
It’s probably tough to define a canonical C++ project, as the build systems vary so widely. I’m trying this one:
This is a simple C++ template project I created mostly for personal use. For Windows, I need cmake and Visual Studio, that’s it. I expect mingw might be necessary for other projects. I suspect with those three you can probably cover most use cases for Windows.
Hi Josh,
I’m pretty sure that the bash language spawns workers that contain the same stuff of “language: cpp”'s workers. Or at least, I can’t find differences… As a temporary workaround it should work.
EDIT (stupid 3 replies restriction ): After the last @josh post, it is now possible to run the builds with language: cpp. Also cmake is on PATH! Incredible! Now the YAML is really simpler!
It looks like msbuild may not be in the PATH. I believe it should be installed as part of the “visualstudio2017buildtools” Chocolately package, which is installed by default. Can it be added to the PATH?
@josh It would be fantastic to also have cmake and msbuild (as noted earlier) in PATH. Currently for projects that use cmake the integration of Windows build is very simple modulo having to modify PATH to be able to run cmake.
It feels like the command line parsing is not correct. I suspect that “/p:Configuration=Release” is not being parsed as a command line option for msbuild, but rather like it is another project name. I think the shell here is bash, so that forward slash before the “p:” is the problem.
For my project, I call msbuild from a DOS batch file, so I don’t have this issue. I’m not sure about another way to tell Travis to use cmd.exe to run your build though.