Boost logo

Boost-Build :

Subject: Re: [Boost-build] A last minute link inclusion.
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2009-01-10 12:32:48


william.crocker_at_[hidden] wrote:
> If my application needs to be relinked, I need
> to sneak in a specially created/compiled source file.
> I include the build date into my application with a
> link action which looks like this (using
> good old Jam (I removed some boiler plate)) :
> actions Link bind {
> echo 'const char *link_date() { return("'`date`'"); }' >
> $(C++) $(C++FLAGS) -c -o link_date.o
> $(LINK) $(LINKFLAGS) -o $(<) $(>) link_date.o $(LINKLIBS)
> $(RM) link_date.o
> }
> Note that this is a NOT a dependency which causes the app to be relinked.
> What is the cool way of doing this using BBV2?

So, given a declaration like this

exe-with-date test : test.cpp ;

dependencies like this should do the trick, right:

test.o: test.cpp
test-date.cpp: test.o
test-date.o: test-date.cpp
test: test.o test-date.o

In Christ,
Steven Watanabe

Boost-Build list run by bdawes at, david.abrahams at, gregod at, cpdaniel at, john at