[Scons-users] Error while refreshing build settings
Michael Potter
michael at potter.name
Wed Feb 13 22:04:12 EST 2013
All,
I am trying to make use of your suggestions. They were very helpful,
especially:
1) env.Append(CPPPATH='#')
and 2) getting rid of relative paths.
After rearranging the code, I am having other problems and decided to
make a mini version of my code to test with. I have attached that as
a .zip file. If you care to reproduce the problems I am having you
can use it to test. What I am doing that is unusual is generating
code AND using VariantDir().
I started to move my code around and am not stuck with a problem
compiling on the command line. I have to resolve that before figuring
out what is wrong with Eclipse.
Here is the error I am getting when doing the out-of-source build:
[pottmi at CentOS6-3 sconstest]$ scons -u
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
gcc -o build/src/diamond.o -c -I. -Isource build/src/diamond.c
build/src/diamond.c:3:26: error: gensrc/joker.h: No such file or directory
build/src/diamond.c: In function 'main':
build/src/diamond.c:7: error: 'joker' undeclared (first use in this function)
build/src/diamond.c:7: error: (Each undeclared identifier is reported only once
build/src/diamond.c:7: error: for each function it appears in.)
scons: *** [build/src/diamond.o] Error 1
scons: building terminated because of errors.
Here is a successful run doing an in-source build:
[pottmi at CentOS6-3 sconstest]$ scons -u
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
make_define(["source/gensrc/joker.h"], ["source/src/joker.txt"])
gcc -o source/src/diamond.o -c -I. -Isource source/src/diamond.c
gcc -o source/src/queen.o -c -I. -Isource source/src/queen.c
gcc -o source/diamond source/src/diamond.o source/src/queen.o
scons: done building targets.
Once the in-source build runs, the out-of-source build will work
(because the code is generated):
[pottmi at CentOS6-3 sconstest]$ scons -u
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
gcc -o build/src/diamond.o -c -I. -Isource build/src/diamond.c
gcc -o build/src/queen.o -c -I. -Isource build/src/queen.c
gcc -o build/diamond build/src/diamond.o build/src/queen.o
make_define(["build/gensrc/joker.h"], ["build/src/joker.txt"])
scons: done building targets.
SConstruct for in-source build:
SConscript('source/SConscript')
SConstruct for out-of-source build:
VariantDir('build', 'source')
SConscript('build/SConscript')
My question is:
How can I get my generator to work with out-of-source builds?
--
potter
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sconstest.zip
Type: application/zip
Size: 2338 bytes
Desc: not available
Url : <http://four.pairlist.net/pipermail/scons-users/attachments/20130213/5b3eb4b4/attachment-0001.zip>
More information about the Scons-users
mailing list