From e5310b494e44047489d7c5a8dde5565386cb45ae Mon Sep 17 00:00:00 2001 From: Felix Mauch Date: Fri, 30 Jun 2017 23:37:55 +0200 Subject: [PATCH] replace the tmp catkin devel/include with the one from the workspace --- config_gen.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/config_gen.py b/config_gen.py index 6089b20..1ffa938 100755 --- a/config_gen.py +++ b/config_gen.py @@ -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)): @@ -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]+$")