c++ - Scons - using custom preprocessor with scons cache -


i trying make build system around scons, use boost wave driver custom c++ code preprocessor. after preprocessing code compiled msvc. @ moment launch wave each source file seen scons, within sconscript file. works, has issue - it's pretty slow because doesn't take advantage of scons compilation cache.

how recommend integrate custom preprocessing step scons build system, in way compilation cache used? need proper #include dependencies scanning, parallel compilation etc. i'm not experienced scons, i'm looking point me in right direction.

my current 2 areas of research are:

  • finding way invoke put/retrieve cache functions manually, risky - don't want pollute cache invalid entries.
  • creating custom tool/pseudobuilder/something, allow me execute 2 commands. or try make scons use 2 tools/pseudobuilders. seems complicated.
  • tom tanner's answer, seems suffer #include dependencies not being detected correctly.

to use scons cache have have target. scons caches target based on contributing files , build command.

even without builder, can write command processor bit this.

out_cc = env.command('file.wave.cpp', 'file.cpp', 'wave command < $source > $target') env.program('myprog', ['this.cc', 'that.cc', out_cc]) 

this use cache.

you can add builder if like, can in 1 step. builders nice you'll use same command in multiple places or have more complex requirements can described simple command. however, aren't essential cache work.

edit: updated include liosan's solution wave taking .cpp files , producing .cpp files , hence getting include dependencies right. desperate reputation am...


Comments

Popular posts from this blog

assembly - 8086 TASM: Illegal Indexing Mode -

Java, LWJGL, OpenGL 1.1, decoding BufferedImage to Bytebuffer and binding to OpenGL across classes -

javascript - addthis share facebook and google+ url -