making SCons build dir a parameter

making SCons build dir a parameter

Discuss the source code and development of Spring Engine in general from a technical point of view. Patches go here too.

Moderator: Moderators

Post Reply
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

making SCons build dir a parameter

Post by hoijui »

an part of rts/buildscons/rts.py:

Code: Select all

	# I don't see any reason to make this configurable --tvo.
	# Note that commenting out / setting this to `None' will break the buildsystem.
	env['builddir'] = 'build'
sorry in advance; i may not use the right terms when talking about git. i am still confused, because of how different things work.

i am just starting to learn git, but as i understand it, it would now make sense to make builddir configurable. so far, with SVN, i always had a spring_current and a spring_caiinterface working dir on my computer.
with git, i would only need a spring local repository and once checkout master and then again caiinterface. but when i build the master with scons, and then checkout caiinterface and build that, it will use the same builddir, right?
so would it not make sense now to have builddir configurable within scons aswell?
Auswaschbar
Spring Developer
Posts: 1254
Joined: 24 Jun 2007, 08:34

Re: making SCons build dir a parameter

Post by Auswaschbar »

use cmake, it has this
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: making SCons build dir a parameter

Post by hoijui »

yeah i know, but i have to keep cmake and SCons up to date, as the buildbot is still using scons as main buildsystem eg, and others too.
User avatar
bibim
Lobby Developer
Posts: 959
Joined: 06 Dec 2007, 11:12

Re: making SCons build dir a parameter

Post by bibim »

hoijui wrote:yeah i know, but i have to keep cmake and SCons up to date, as the buildbot is still using scons as main buildsystem eg, and others too.
Actually we have no choice but to use scons as main build system (for Windows at least), since afaik noone made NSIS files for binaries generated with cmake yet.
Auswaschbar
Spring Developer
Posts: 1254
Joined: 24 Jun 2007, 08:34

Re: making SCons build dir a parameter

Post by Auswaschbar »

bibim wrote:
hoijui wrote:yeah i know, but i have to keep cmake and SCons up to date, as the buildbot is still using scons as main buildsystem eg, and others too.
Actually we have no choice but to use scons as main build system (for Windows at least), since afaik noone made NSIS files for binaries generated with cmake yet.
because there is no need to. After installing all binaries into game/ (with "make install DESTDIR="/x/y/Z") I was able to run nsis without problems.
User avatar
bibim
Lobby Developer
Posts: 959
Joined: 06 Dec 2007, 11:12

Re: making SCons build dir a parameter

Post by bibim »

Auswaschbar wrote:
bibim wrote:Actually we have no choice but to use scons as main build system (for Windows at least), since afaik noone made NSIS files for binaries generated with cmake yet.
because there is no need to. After installing all binaries into game/ (with "make install DESTDIR="/x/y/Z") I was able to run nsis without problems.
Oh right, I didn't see you fixed the library names generated with cmake+mingw a week ago.
Then indeed I guess now we can generate the installer after doing a "make install DESTDIR=xxx" and copying manually the content of the "bin" and "lib" subdirectories of $DESTDIR into "game".
Auswaschbar
Spring Developer
Posts: 1254
Joined: 24 Jun 2007, 08:34

Re: making SCons build dir a parameter

Post by Auswaschbar »

bibim wrote:
Auswaschbar wrote:
bibim wrote:Actually we have no choice but to use scons as main build system (for Windows at least), since afaik noone made NSIS files for binaries generated with cmake yet.
because there is no need to. After installing all binaries into game/ (with "make install DESTDIR="/x/y/Z") I was able to run nsis without problems.
Oh right, I didn't see you fixed the library names generated with cmake+mingw a week ago.
Then indeed I guess now we can generate the installer after doing a "make install DESTDIR=xxx" and copying manually the content of the "bin" and "lib" subdirectories of $DESTDIR into "game".
You don't need to do this, even. Set LIBDIR and BINDIR to ".", and let CMAKE_INSTALL_PREFIX empty. Only thign to do then is "make install DESTDR=/game/dir".
User avatar
bibim
Lobby Developer
Posts: 959
Joined: 06 Dec 2007, 11:12

Re: making SCons build dir a parameter

Post by bibim »

Auswaschbar wrote:You don't need to do this, even. Set LIBDIR and BINDIR to ".", and let CMAKE_INSTALL_PREFIX empty. Only thign to do then is "make install DESTDR=/game/dir".
Ok.

Well, now we really have 2 complete build systems. Hum... actually not really, scons is missing the dedicated server, so now cmake is the most complete ;)

Btw it could be usefull to add the dedicated server in the installer (maybe in an optional way, so that it wouldn't break the scons installer generation ?)
User avatar
bibim
Lobby Developer
Posts: 959
Joined: 06 Dec 2007, 11:12

Re: making SCons build dir a parameter

Post by bibim »

Auswaschbar wrote:You don't need to do this, even. Set LIBDIR and BINDIR to ".", and let CMAKE_INSTALL_PREFIX empty. Only thign to do then is "make install DESTDR=/game/dir".
Does it work for you ?
Here it tries to copy recursively game/share/games/spring/share/games/spring/... when I use the game directory as DESTDIR, with LIBDIR=. , BINDIR=. and CMAKE_INSTALL_PREFIX empty.
User avatar
lurker
Posts: 3842
Joined: 08 Jan 2007, 06:13

Re: making SCons build dir a parameter

Post by lurker »

What about DATADIR?
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: making SCons build dir a parameter

Post by hoijui »

btw.. just if you did not read the commit message in GIT:
build dir is now configurable with SCons aswell, plus mingwlibs location, use like this:

Code: Select all

scons configure builddir=/tmp/spring/build mingwlibsdir=/central/location/mingwlibs
scons builddir=/tmp/spring/build
scons install builddir=/tmp/spring/build
The default is set as it was before of course. if you use a different builddir, you HAVE to specify it on scons configure, scons and on scons install. This is nessesary, cause the builddir is used to store the config cache.

Edit:
This has advantages if you use a single GIT repo but multiple branches betwwen which you switch relatively often.
imbaczek
Posts: 3629
Joined: 22 Aug 2006, 16:19

Re: making SCons build dir a parameter

Post by imbaczek »

master/slave repo setup is also pretty good, but +1 gratz points for this change.
Auswaschbar
Spring Developer
Posts: 1254
Joined: 24 Jun 2007, 08:34

Re: making SCons build dir a parameter

Post by Auswaschbar »

bibim wrote:
Auswaschbar wrote:You don't need to do this, even. Set LIBDIR and BINDIR to ".", and let CMAKE_INSTALL_PREFIX empty. Only thign to do then is "make install DESTDR=/game/dir".
Does it work for you ?
Here it tries to copy recursively game/share/games/spring/share/games/spring/... when I use the game directory as DESTDIR, with LIBDIR=. , BINDIR=. and CMAKE_INSTALL_PREFIX empty.
Sorry, CMAKE_INSTALL_PREFIX needs to be set to "/", and of course DATADIR also needs to be ".". Maybe I should made this default on mingw...
Auswaschbar
Spring Developer
Posts: 1254
Joined: 24 Jun 2007, 08:34

Re: making SCons build dir a parameter

Post by Auswaschbar »

Auswaschbar wrote:Sorry, CMAKE_INSTALL_PREFIX needs to be set to "/", and of course DATADIR also needs to be ".". Maybe I should made this default on mingw...
done
Post Reply

Return to “Engine”