17
17
import warnings
18
18
from shutil import copyfile
19
19
from os import makedirs
20
- from os .path import basename , isdir , isfile , join
20
+ from os .path import basename , isabs , isdir , isfile , join
21
21
22
22
from SCons .Script import COMMAND_LINE_TARGETS , Builder , DefaultEnvironment
23
23
@@ -93,7 +93,9 @@ def _fix_paths(paths, lib_path):
93
93
94
94
config = lib_processor .extract_project_info (generate_config = False )
95
95
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 )]
97
99
98
100
name = basename (lib_path )
99
101
@@ -106,8 +108,14 @@ def _fix_paths(paths, lib_path):
106
108
}
107
109
}
108
110
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 ) + "'" ))
111
119
112
120
for f in src_files :
113
121
manifest ['build' ]['srcFilter' ].extend ([" +<%s>" % f ])
0 commit comments