Â#985
authorThomas Nagy <tnagy1024@gmail.com>
Sun, 19 Jun 2011 12:54:32 +0000 (12:54 +0000)
committerThomas Nagy <tnagy1024@gmail.com>
Sun, 19 Jun 2011 12:54:32 +0000 (12:54 +0000)
git-svn-id: https://waf.googlecode.com/svn/trunk@11404 f0382ac9-c320-0410-b3f0-b508d59f5a85

waflib/extras/msvs.py

index cdf660840fac50014ccb09ff3c5c78d670df603e..b1f0fc70d6549e401f68878ae3723d0d4dcd70fa 100644 (file)
@@ -46,13 +46,16 @@ To customize the outputs, provide subclasses in your wscript files:
 from waflib.extras import msvs
 class vsnode_target(msvs.vsnode_target):
     def get_build_command(self, props):
+               # likely to be required
         return "waf.bat build"
+       def collect_source(self):
+               # likely to be required
+               ...
 class msvs_bar(msvs.msvs_generator):
     def init(self):
         msvs.msvs_generator.init(self)
         self.vsnode_target = vsnode_target
 
-
 ASSUMPTIONS:
 * a project can be either a directory or a target, vcxproj files are written only for targets that have source files
 * each project is a vcxproj file, therefore the project uuid needs only to be a hash of the absolute path
@@ -559,15 +562,13 @@ class vsnode_target(vsnode_project):
        def collect_source(self):
                tg = self.tg
                source_files = tg.to_nodes(getattr(tg, 'source', []))
-               include_dirs = Utils.to_list(getattr(tg, 'includes', [])) + Utils.to_list(getattr(tg, 'export_dirs', []))
+               include_dirs = Utils.to_list(getattr(tg, 'includes', [])) + Utils.to_list(getattr(tg, 'export_includes', []))
                include_files = []
                for x in include_dirs:
-                       if not isinstance(x, str):
-                               include_files.append(x)
-                               continue
-                       d = tg.path.find_node(x)
-                       if d:
-                               lst = [y for y in d.ant_glob(HEADERS_GLOB, flat=False)]
+                       if isinstance(x, str):
+                               x = tg.path.find_node(x)
+                       if x:
+                               lst = [y for y in x.ant_glob(HEADERS_GLOB, flat=False)]
                                include_files.extend(lst)
 
                # remove duplicates