diff --git a/helpers/create-abi-dump.py b/helpers/create-abi-dump.py --- a/helpers/create-abi-dump.py +++ b/helpers/create-abi-dump.py @@ -8,7 +8,7 @@ import subprocess import sys from collections import defaultdict -from typing import Dict, List, Union +from typing import Dict, List, Union, Set from helperslib import Packages, EnvironmentHandler @@ -73,6 +73,8 @@ "INTERFACE_COMPILE_OPTIONS", "INTERFACE_COMPILE_DEFINITIONS", "IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG", + "IMPORTED_CONFIGURATIONS", + "DOXYGEN_TAGFILE", ] tmpKeyword = None @@ -131,7 +133,7 @@ proc = subprocess.Popen(['cmake', '.', '--trace-expand'], cwd=d, stdout=subprocess.DEVNULL, stderr=subprocess.PIPE, env=runtimeEnvironment) # cmake prefixes outout with the name of the file, filter only lines with interessting files - retarget = re.compile( '.*/{self.name}(Targets[^/]*|Config[^/]*)\.cmake\(\d+\):\s*(.*)$'.format(self=self) ) # replace with f-String in python 3.6 + retarget = re.compile( '.*/{self.name}/[^/]*(Targets[^/]*|Config[^/]*)\.cmake\(\d+\):\s*(.*)$'.format(self=self) ) # replace with f-String in python 3.6 # Start processing the output of CMake, one line at a time for line in proc.stderr: @@ -204,28 +206,29 @@ # Start preparations to run abi-compliance-checker # Gather the information we'll need to write the XML configuration file it uses version = self.version - headers = [] # type: List[str] - libs = [] # type: List[str] - additionalIncludes = [] # type: List[str] + headers = set() # type: Set[str] + libs = set() # type: Set[str] + additionalIncludes = set() # type: Set[str] + + # list of general include directories + noHeaders = set(buildEnvironment.get('CMAKE_PREFIX_PATH').split(":")) + noHeaders |= set([i+"/include" for i in buildEnvironment.get('CMAKE_PREFIX_PATH').split(":")]) # From the target information we previously collected... # Grab the list of libraries and include headers for abi-compliance-checker for target in self.targets.values(): # Check each include directory to see if we need to add it.... for i in target['include_dirs']: # ignore general folders, as there are no lib specific headers are placed - if i == '/usr/include' or i.endswith("/KF5"): - if not i in additionalIncludes: - additionalIncludes.append(i) + if i in noHeaders or i.endswith("/KF5"): + additionalIncludes.add(i) continue - + # Otherwise, if we don't already have it - add it to the list! - if not i in headers: - headers.append(i) + headers.add(i) # If the library path isn't in the list, then we should add it to the list - if not target['path'] in libs: - libs.append(target['path']) + libs.add(target['path']) # Now we can go ahead and generate the XML file for abi-compliance-checker xml = """