aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Mensinger <daniel@mensinger-ka.de>2019-07-11 16:23:37 +0200
committerDaniel Mensinger <daniel@mensinger-ka.de>2019-07-25 17:41:14 +0200
commit1a4fae28ad0b4655068842b64d4e051e88523c07 (patch)
tree868213eb789f83b56f4aa5dc545635cceb0c1f42
parente7948508d73e44d930daa325353aac64f0405fca (diff)
downloadmeson-1a4fae28ad0b4655068842b64d4e051e88523c07.zip
meson-1a4fae28ad0b4655068842b64d4e051e88523c07.tar.gz
meson-1a4fae28ad0b4655068842b64d4e051e88523c07.tar.bz2
cmake: trace: support interface libraries
-rw-r--r--mesonbuild/cmake/traceparser.py21
1 files changed, 14 insertions, 7 deletions
diff --git a/mesonbuild/cmake/traceparser.py b/mesonbuild/cmake/traceparser.py
index 3b9f92b..2c62c5d 100644
--- a/mesonbuild/cmake/traceparser.py
+++ b/mesonbuild/cmake/traceparser.py
@@ -199,16 +199,23 @@ class CMakeTraceParser:
args = list(tline.args) # Make a working copy
# Make sure the lib is imported
- if 'IMPORTED' not in args:
- return self._gen_exception('add_library', 'non imported libraries are not supported', tline)
+ if 'INTERFACE' in args:
+ args.remove('INTERFACE')
- args.remove('IMPORTED')
+ if len(args) < 1:
+ return self._gen_exception('add_library', 'interface library name not specified', tline)
- # No only look at the first two arguments (target_name and target_type) and ignore the rest
- if len(args) < 2:
- return self._gen_exception('add_library', 'requires at least 2 arguments', tline)
+ self.targets[args[0]] = CMakeTarget(args[0], 'INTERFACE', {})
+ elif 'IMPORTED' in args:
+ args.remove('IMPORTED')
- self.targets[args[0]] = CMakeTarget(args[0], args[1], {})
+ # No only look at the first two arguments (target_name and target_type) and ignore the rest
+ if len(args) < 2:
+ return self._gen_exception('add_library', 'requires at least 2 arguments', tline)
+
+ self.targets[args[0]] = CMakeTarget(args[0], args[1], {})
+ else:
+ return self._gen_exception('add_library', 'non imported / interface libraries are not supported', tline)
def _cmake_add_custom_command(self, tline: CMakeTraceLine):
# DOC: https://cmake.org/cmake/help/latest/command/add_custom_command.html