Skip to content

Commit

Permalink
fix _depends_incpaths_s empty bug
Browse files Browse the repository at this point in the history
  • Loading branch information
str2num committed Oct 24, 2018
1 parent 9bacffb commit e6b3f7b
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions libbuildmake/bsource.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,11 @@ def pre_action(self):
self._cppflags = self._ctx.cpp_flags().v()
if (not self._cflags_flag):
self._cflags = self._ctx.c_flags().v()

if (not self._depends_incpaths):
self._depends_incpaths = self._ctx.depends_include_paths()

self._incpaths_s = self._line_delim.join(map(lambda x:'-I%s' % x, self._incpaths))
self._depends_incpaths_s = self._line_delim.join(map(lambda x:'-I%s' % x, self._depends_incpaths))
self._cxxflags_s = self._line_delim.join(self._cxxflags)
self._cppflags_s = self._line_delim.join(self._cppflags)
self._cflags_s = self._line_delim.join(self._cflags)
Expand Down Expand Up @@ -142,17 +145,19 @@ def action(self):
cxxfile = self._infile
objfile = bfunction.replace_file_ext_name(
bfunction.add_prefix_to_basename(cxxfile, self._target.basename() + '_'), '.o')
gccflags_s = '%(_incpaths_s)s %(_depends_incpaths_s)s' % (self.__dict__)
gccflags_s += '%(_cppflags_s)s %(_cxxflags_s)s' % (self.__dict__)
gccflags_s = '%(_incpaths_s)s %(_depends_incpaths_s)s ' % (self.__dict__)
gccflags_s += '%(_cppflags_s)s %(_cxxflags_s)s ' % (self.__dict__)

real_cc = self._ctx.cxx()
command1 = '%(real_cc)s -MG -MM %(gccflags_s)s %(cxxfile)s' % (locals())
command2 = 'cpp -E %(gccflags_s)s %(cxxfile)s' % (locals())
cxx = '$(CXX)'

depfiles = []
depfiles.append(cxxfile)
depfiles.extend(self._prefixes)
depfiles.extend(get_cpp_depend_files(command1, command2, self._ctx, self._infile))
cxx = '$(CXX)'


if (not self._incpaths_flag):
r_gccflags_s = '$(INCPATH) '
else:
Expand All @@ -169,7 +174,7 @@ def action(self):
r_gccflags_s += '$(CXXFLAGS) '
else:
r_gccflags_s += '%(_cxxflags_s)s ' % (self.__dict__)

cmd='%(cxx)s -c %(r_gccflags_s)s -o %(objfile)s %(cxxfile)s' % (locals())
commands = []
commands.append(cmd)
Expand Down

0 comments on commit e6b3f7b

Please sign in to comment.