← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-dev/yade/trunk] Rev 2042: 1. Add #ifndef YADE_* feature handling to implicit build scanner (till now, it was only supportin...

 

------------------------------------------------------------
revno: 2042
committer: Václav Šmilauer <eudoxos@xxxxxxxx>
branch nick: trunk
timestamp: Fri 2010-02-19 19:00:11 +0100
message:
  1. Add #ifndef YADE_* feature handling to implicit build scanner (till now, it was only supporting #ifdef YADE_*)
modified:
  yadeSCons.py


--
lp:yade
https://code.launchpad.net/~yade-dev/yade/trunk

Your team Yade developers is subscribed to branch lp:yade.
To unsubscribe from this branch go to https://code.launchpad.net/~yade-dev/yade/trunk/+edit-subscription.
=== modified file 'yadeSCons.py'
--- yadeSCons.py	2010-01-09 17:26:41 +0000
+++ yadeSCons.py	2010-02-19 18:00:11 +0000
@@ -62,10 +62,10 @@
 				for l in open(ff):
 					if re.match(r'\s*#endif.*$',l): skipping=False; continue
 					if skipping: continue
-					m=re.match(r'\s*#ifdef\s*YADE_(.*)\s*$',l)
+					m=re.match(r'\s*#(ifdef|ifndef)\s*YADE_(.*)\s*$',l)
 					if m:
-						feat=m.group(1).lower()
-						if feat not in features: skipping=True
+						cond,feat=m.group(1),m.group(2).lower()
+						if (cond=='ifdef' and feat not in features) or (cond=='ifndef' and feat in features): skipping=True
 					if re.match(r'\s*YADE_PLUGIN\(.*',l): isPlugin=True
 					m=re.match(r'^\s*#include\s*<yade/([^/]*)/(.*)>.*$',l)
 					if m: