Skip to content
This repository was archived by the owner on Aug 30, 2020. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions config_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,10 @@ def parse_flags(build_log):
# Used to only bundle filenames with applicable arguments
filename_flags = ["-o", "-I", "-isystem", "-iquote", "-include", "-imacros", "-isysroot"]

temp_catkin_regex = re.compile("-I/tmp/tmp[a-zA-Z0-9]+/")
catkin_ws_regex = re.compile("-I.*(catkin_workspace|catkin_ws)/")
catkin_ws = ''

# Process build log
for line in build_log:
if(temp_output.search(line)):
Expand All @@ -455,12 +459,21 @@ def parse_flags(build_log):

continue

# Find our what the catkin_ws path is
if catkin_ws_regex.search(word):
catkin_ws = catkin_ws_regex.search(word).group()

# include arguments for this option, if there are any, as a tuple
if(i != len(words) - 1 and word in filename_flags and words[i + 1][0] != '-'):
flags.add((word, words[i + 1]))
elif temp_catkin_regex.search(word):
# replace the tmp catkin devel/include folder
word = temp_catkin_regex.sub(catkin_ws, word)
flags.add(word)
else:
flags.add(word)


# Only specify one word size (the largest)
# (Different sizes are used for different files in the linux kernel.)
mRegex = re.compile("^-m[0-9]+$")
Expand Down