Quote:Original post by l3mon
Ever heard of "post-build-events" and "include paths"?
I'd go with number 2 if the projects have nothing to do with each other except sharing some convenient code.
Just make a "common" include directory and have your project update anything you need to after you built it. Same goes for "pre-build-events" :)
But if it's a huge bunch of code as you described, you should really go for a lib...
I never thought about it that way. I still don't see how it solves my "issue" as mentioned before, though.
Say I put the renderer into it's own project and include it in the solution. Now, say that main.cpp has calls to the renderer in it, and that both builds share this file.
The build which does not include the renderer will get errors. This was the whole deal with #ifdefs and why I wanted to use them in the first place, as I could place them around any calls to the renderer AS WELL as the actual renderer.cpp/renderer.h files. But this way the source files became very cluttered and I just couldn't stand it.
Thanks for your suggestion!
Quote:Original post by yaustar
I would use number 3 as suggested above but as an alternative, I would create two project/solution files that only compiles/includes the files needed for the build.
Not possible since they share some of the same files, and those files might contain (for example) calls to the renderer, which is not present in both builds. This is why I considered #ifdefs.
Quote:Original post by JasonBlochowiak
As far as this type of thing goes, there are two kinds of work: The kind you pay for up front, by doing the organizational and planning work that you should, and then there's the kind of work you pay for constantly down the line, because instead of doing the organizational and planning work, you took the "easy" way out.
The easy way seems cheaper, just because you don't necessarily see the subsequent wasted time in one chunk. However, it's almost always more expensive, because, instead of one lump of time, you're constantly being pulled off of what you're intending to work on, in order to fix whatever broke this time.
Good point! And in this case I saw that it would mean *alot* more work (and thus: time) to put everything into a lib rather than use two builds, which so far haven't been a problem at all.
Honestly, I think this is a matter of taste more than anything. Perhaps you guys are working with larger projects than I am and that I'm not seeing the issues with my approach until I scale :)