Hi hoijui,
Ok, just wrote a lot, and then re-read your post, and realized you are not pushing for a single executable, but that you think that two is just fine
Ok, so ...
Just to look at your technical points:
The stubs are totally independent of the rest of Spring. They have no Spring includes or dependencies. They could be used in any opengl/glew/glu project. The only provisos:
- they do not implement the entire opengl API, so other opengl projects would need to add the missing methods (mind you, Spring uses a lot of methods, so most opengl projects wishing to use the stubs to be headless would probably only be missing one or two, but still)
- the glew stub is heavily tweaked to return only the extensions that Spring absolutely insists on, and also the glew stub is massively incomplete, we only stub the tiniest number of methods out of those available, and actually link to the real GLEW library just after the stub library; but this could be made programmatic, ie we could programatically control which stubs GLEW says it handles
These stubs could be in a library under lib perhaps? Or maybe in tools? Probably rts/lib could be ok though?
Looking at SDL, SDL is
entirely stubbed out, and the real SDL library is not linked with at all. The stub returns sensible values for SDL_GetTicks(), using boost::xtime , and also implements SDL_Delay. PollEvent simply never returns any event.
Moving on to CMake stuff...
CMake seems to be massively better than scons! Still, I'm not an expert in CMake, not like you, but maybe I'll have a look at doing this.
The only bit of the headless spring that is spring-dependent at all is the link step, which at the moment looks like this:
Code: Select all
# points on link order:
# glewstub MUST be before glew
# streflop should be after lua
g++ -g -o springheadless -L. -Llib -Llib/streflop $(find . -name "*.o" -print |grep -v "testmain.o" | grep -v "^./lib") -lSDLstub -lGLstub -lboost_system-mt -lboost_thread-mt -lboost_signals-mt -lopenal -logg -lboost_filesystem-mt -lboost_regex-mt -lboost_serialization-mt -lz -lboost_program_options-mt -lfreetype -lIL -lILU -lvorbis -lX11 -lXcursor -lvorbisenc -lvorbisfile -l7zip -lhpiutil2 -loscpack -lminizip -lglewstub -lglustub -lGLEW -llua -lstreflop
I'm not really sure how to integrate this into CMakeLists, though it's clearly the place where it belongs :-D I'll take a look and see how I go, and then hassle you in irc
