Boost logo

Boost-Build :

From: Jurko Gospodnetić (jurko.gospodnetic_at_[hidden])
Date: 2008-07-13 12:23:12


   Hi William.

> lib A :
> # Library creation rule
> klib gameobject : [ glob *.cpp ]
> /core//core
> /sys//sys
> /script//script
> /script-extensions//core
> ;
>
> Lib B :
> # Declare Python extensions
> kpython-extension core : coreextension.cpp
> /core//core
> /script//script ;
>
> In a shared file :
> # Common rules to build, install python extensions
> rule kpython-extension ( name : extra-sources * : extra-requirements * )
> {
> python-extension $(name) : $(extra-sources) :
> [ getDefines ]
> [ getRequirements ]
> $(extra-requirements) ;
>
> folder = [ getKenginPath ] ;
> folder = $(folder)/script/common/extensions ;
>
> # Install rule
> install dist$(name) : $(name) :
> <location>$(folder)
> <install-type>PYTHON_EXTENSION
> ;
> }
>
> This works properly i have no error when i compile but if i modify
> coreextension.cpp and i build gameobject lib it doesn't detect the
> change in coreextension.cpp file and doesn't rebuild it. I tried to
> remove the install rule but it doesn't change anything.
>
> Do you know why coreextension isn't rebuilt ?

   When you build gameobject, assuming your klib rule actually uses its
second parameter to define source targets, Boost Build will rebuild the
/core//core target if needed.

   Your /core//core target is declared using a python-extension rule and
gets passed the coreextensions.cpp file as a source so Boost Build will
rebuild that target if you touch the coreextensions.cpp source file.
This is all under the assumption that the python-extension rule is not
buggy and correctly lists the coreextensions.cpp parameter passed to it
as its source.

   Now I see you seem to list the /core//core target as a source for
itself. Perhaps that could be confusing Boost Jam or Boost build.

   You can test whether your /core//core target builds correctly if you
build it explicitly from the command line - 'bjam /core//core'. You can
also test this from the /core project folder by running just 'bjam core'.

   You might also have a problem with the core target having the same
name as the project so you might try playing with that as well.

   And finally, it is clear why the install rule will not be triggered
in your build through the (A) project - because that /core//distcode
target is not listed as a source of the build gameobject target.

   Can't do much more without a reproducible test-case...

   As a side-note, I'd declare that 'folder' variable in the
kpython-extension rule as local. Otherwise you're using a global
variable. Just type in 'local folder ;' before first using it or change
the first assignment to it to 'local folder = ...whatever... ;'.

   Hope this helps.

   Best regards,
     Jurko Gospodnetić


Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk