aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/cmake/traceparser.py
diff options
context:
space:
mode:
authorDaniel Mensinger <daniel@mensinger-ka.de>2019-09-26 11:48:24 +0200
committerJussi Pakkanen <jpakkane@gmail.com>2019-09-26 20:33:50 +0300
commit534e94ffc35dae3a0b2cc9f1e60e7e452872c512 (patch)
tree1d2b29d71df5338143f781e2bbba33282106151b /mesonbuild/cmake/traceparser.py
parentfbddeeb4ac1897cf9166317d719ae300178c85b7 (diff)
downloadmeson-534e94ffc35dae3a0b2cc9f1e60e7e452872c512.zip
meson-534e94ffc35dae3a0b2cc9f1e60e7e452872c512.tar.gz
meson-534e94ffc35dae3a0b2cc9f1e60e7e452872c512.tar.bz2
cmake: Support ALIAS libraries
Diffstat (limited to 'mesonbuild/cmake/traceparser.py')
-rw-r--r--mesonbuild/cmake/traceparser.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/mesonbuild/cmake/traceparser.py b/mesonbuild/cmake/traceparser.py
index 3a3f269..878c6a3 100644
--- a/mesonbuild/cmake/traceparser.py
+++ b/mesonbuild/cmake/traceparser.py
@@ -214,11 +214,20 @@ class CMakeTraceParser:
elif 'IMPORTED' in args:
args.remove('IMPORTED')
- # No only look at the first two arguments (target_name and target_type) and ignore the rest
+ # Now, 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], {})
+ elif 'ALIAS' in args:
+ args.remove('ALIAS')
+
+ # Now, only look at the first two arguments (target_name and target_ref) and ignore the rest
+ if len(args) < 2:
+ return self._gen_exception('add_library', 'requires at least 2 arguments', tline)
+
+ # Simulate the ALIAS with INTERFACE_LINK_LIBRARIES
+ self.targets[args[0]] = CMakeTarget(args[0], 'ALIAS', {'INTERFACE_LINK_LIBRARIES': [args[1]]})
else:
return self._gen_exception('add_library', 'non imported / interface libraries are not supported', tline)