From 723677d43137e7e3686466cdbf348ddc7d7aeea0 Mon Sep 17 00:00:00 2001 From: Simon Robertshaw Date: Mon, 13 Aug 2012 18:23:33 +0100 Subject: [PATCH] Add CPPDEFINES to the compile command --- SConscript | 2 +- site_scons/site_tools/mfprogram/__init__.py | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/SConscript b/SConscript index 35f0a9b0d..796ed9701 100644 --- a/SConscript +++ b/SConscript @@ -237,7 +237,7 @@ if(GetOption('everythingAtOnce')): env.Command(['generated/ElementClasses.cpp', 'generated/ElementClasses.h'], Glob('src/simulation/elements/*.cpp'), "python generator.py elements $TARGETS $SOURCES") env.Command(['generated/ToolClasses.cpp', 'generated/ToolClasses.h'], Glob('src/simulation/tools/*.cpp'), "python generator.py tools $TARGETS $SOURCES") env.Decider('MD5') - t=env.Program(target=programName, source=sources) + t=env.MFProgram(target=programName, source=sources) Default(t) else: env.Command(['generated/ElementClasses.cpp', 'generated/ElementClasses.h'], Glob('src/simulation/elements/*.cpp'), "python generator.py elements $TARGETS $SOURCES") diff --git a/site_scons/site_tools/mfprogram/__init__.py b/site_scons/site_tools/mfprogram/__init__.py index 2d94ac29c..97f075a57 100644 --- a/site_scons/site_tools/mfprogram/__init__.py +++ b/site_scons/site_tools/mfprogram/__init__.py @@ -203,8 +203,13 @@ def MFProgramGenerator(source, target, env, for_signature): #else: # _CPPPATH.append(relpath(os.path.join(sconscript_dir, i), # destdir)) + + defines = "" + for t in env['CPPDEFINES']: + defines += ("-D"+str(t)+" ") + _CPPINCFLAGS = ['-I' + i for i in _CPPPATH] - _CCOMCOM = '$CPPFLAGS $_CPPDEFFLAGS %s' % ' '.join(_CPPINCFLAGS) + _CCOMCOM = '$CPPFLAGS $_CPPDEFFLAGS $defines %s' % ' '.join(_CPPINCFLAGS) libstr = "" for t in env['LIBS']: