1717import warnings
1818from shutil import copyfile
1919from os import makedirs
20- from os .path import basename , isdir , isfile , join
20+ from os .path import basename , isabs , isdir , isfile , join
2121
2222from SCons .Script import COMMAND_LINE_TARGETS , Builder , DefaultEnvironment
2323
@@ -93,7 +93,9 @@ def _fix_paths(paths, lib_path):
9393
9494 config = lib_processor .extract_project_info (generate_config = False )
9595 src_files = _fix_paths (config .get ("src_files" ), lib_path )
96- inc_dirs = _fix_paths (config .get ("inc_dirs" ), lib_path )
96+
97+ inc_dirs = [join (FRAMEWORK_DIR , d ).replace ("\\ " , "/" ) for d in config .get (
98+ "inc_dirs" ) if not isabs (d )]
9799
98100 name = basename (lib_path )
99101
@@ -106,8 +108,14 @@ def _fix_paths(paths, lib_path):
106108 }
107109 }
108110
109- manifest ['build' ]['flags' ].extend (
110- ['-I "%s"' % d for d in inc_dirs ])
111+ if inc_dirs :
112+ extra_script = join (env .subst ("$BUILD_DIR" ), name + "_extra_script.py" )
113+ manifest ['build' ]['extraScript' ] = extra_script .replace ("\\ " , "/" )
114+ if not isfile (extra_script ):
115+ with open (extra_script , "w" ) as fp :
116+ fp .write ("Import('env')\n " )
117+ fp .write (
118+ "env.Prepend(CPPPATH=[%s])" % ("'" + "', '" .join (inc_dirs ) + "'" ))
111119
112120 for f in src_files :
113121 manifest ['build' ]['srcFilter' ].extend ([" +<%s>" % f ])
0 commit comments