Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added appveyor support for Windows builds. #598

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

AndrewJDR
Copy link

@AndrewJDR AndrewJDR commented Apr 28, 2018

This adds appveyor.com support for VS2008 - VS2017. This works similarly to travis-ci, giving build success/failure reports any time someone submits a PR. You can see what it looks like here:
https://ci.appveyor.com/project/AndrewJDR/stb/build/1.0.24

And on my fork (see green checkmark): https://github.com/AndrewJDR/stb/commits/add_appveyor_windows

It also runs the test executables just to make sure they don't crash or whatever. Not sure if that's necessary, but why not.

You'll have to sign up for it to work, similar to travis-ci. Signup is straightforward, and free for OSS projects. Build-wise, I used nmake for now by making a copy of the original tests/Makefile and removing a few flags that cl doesn't understand, but you can replace nmake with whatever you want later by changing these lines in appveyor.yml:

  - call "C:\\Program Files (x86)\\%VSINSTALL%\vcvarsall.bat" %platform%
  - cd tests
  - nmake /f Makefile.nmake

I don't think travis supports windows, or I would have just used that. travis + appveyor seems to be a common combination on OSS projects for this reason.

@AndrewJDR
Copy link
Author

Another quick note -- it does both x86 and x64 builds for vs2013-vs2017, but with vs2008-vs2012, x64 builds are not very nicely supported with appveyor so I just stuck with x86 there.

@nothings
Copy link
Owner

nothings commented Mar 5, 2019

At this point I already have two different makefile-like things--the Makefile for travis, and my build matrix for my local VS builds, test.sbm: https://github.com/nothings/stb/blob/master/tests/test.sbm

I don't want to maintain yet ANOTHER redundant Makefile, so I don't think I'm going to do this until I'm ready to have a single program generate all the makefiles/etc. from a single list of tests.

It doesn't need to be a complicated input file, e.g. it could just be each line is a list of all the c/cpp files to link for a single project, and then generate the rest of the Makefile by very simple logic with that. I wouldn't recommend anybody try to implement that without talking to me first, because I'm not sure what it'll take for it to be a system I'm comfortable with having.

@AndrewJDR
Copy link
Author

AndrewJDR commented Mar 5, 2019

@nothings It may be quite possible to re-use the travis makefile for appveyor with very few changes to it, so that we are not adding an additional makefile into the mix.

Is that something you'd be interested in merging? If so, I can look into it.

@nothings
Copy link
Owner

nothings commented Mar 5, 2019

Sure.

@AndrewJDR
Copy link
Author

AndrewJDR commented Mar 12, 2019

I looked into it, but nmake and gnu make lack a unified way of expressing an if statement, so it's not trivial and clean.

Is the logic so simple that it could be expressed via the C preprocessor? If both the input file and the simple logic you described are sufficiently simple, the input file could just be run through cpp (unix) / cl /E (windows) to create the needed makefiles...

@nothings
Copy link
Owner

I'd rather not use the C preprocessor. It probably makes more sense to just have a little program that generates the makefile and test.sbm anyway. Possibly use a revised test.sbm itself as the input.

@AndrewJDR
Copy link
Author

I wouldn't recommend anybody try to implement that without talking to me first, because I'm not sure what it'll take for it to be a system I'm comfortable with having.

I could take a crack at it, if you care to write a bit about what you're looking for. I'm busy on a project so it would just happen on a weekend or day where I find myself with some time to spare and/or I need a break. If I had to guess, sometime within the next 3-4 months?

If you see yourself most likely taking care of it yourself before then, it may not be worth your time to describe it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants