[Scons-users] C/C++ Object Suffix to include source names

Hua Yanghao huayanghao at gmail.com
Fri Dec 7 06:19:14 EST 2018


This is an example for anyone who might have a similar issue, not sure
if this is the best way to do it in scons.
I have to use the variant_dir passed explicity through env, any way to
get it out of the FS node object?

  1 import os
                                                        | |
  2
                                                        | |
  3 def targets_change(targets, sources, env):
                                                        | |
  4     new_targets = []
                                                        | |
  5     build_dir = env['USW_BUILD_ROOT']
                                                        | |
  6     for i in sources:
                                                        | |
  7         new = i.path +'.o'
                                                        | |
  8         new = os.path.relpath(new, build_dir)
                                                        | |
  9         new_targets.append(new)
                                                        | |
 10     return new_targets, sources


More information about the Scons-users mailing list