diff options
author | Daniel Mensinger <daniel@mensinger-ka.de> | 2020-06-12 22:03:50 +0200 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek.chauhan@gmail.com> | 2020-06-13 18:50:00 +0000 |
commit | 6c56478ee1e15477b54d92bf25b7b4b1489bfcdb (patch) | |
tree | 91152b2875100d99a00a8728a5dcc795740ed656 /mesonbuild/cmake/interpreter.py | |
parent | 3babaaaeecb01ceefb25508783207f1bf7876447 (diff) | |
download | meson-6c56478ee1e15477b54d92bf25b7b4b1489bfcdb.zip meson-6c56478ee1e15477b54d92bf25b7b4b1489bfcdb.tar.gz meson-6c56478ee1e15477b54d92bf25b7b4b1489bfcdb.tar.bz2 |
cmake: fix definitions with interface libraries (fixes #7299)
Diffstat (limited to 'mesonbuild/cmake/interpreter.py')
-rw-r--r-- | mesonbuild/cmake/interpreter.py | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/mesonbuild/cmake/interpreter.py b/mesonbuild/cmake/interpreter.py index a5bf545..d5ec0a7 100644 --- a/mesonbuild/cmake/interpreter.py +++ b/mesonbuild/cmake/interpreter.py @@ -317,13 +317,6 @@ class ConverterTarget: tgt = trace.targets.get(self.cmake_name) if tgt: self.depends_raw = trace.targets[self.cmake_name].depends - if self.type.upper() == 'INTERFACE_LIBRARY': - props = tgt.properties - - self.includes += props.get('INTERFACE_INCLUDE_DIRECTORIES', []) - self.public_compile_opts += props.get('INTERFACE_COMPILE_DEFINITIONS', []) - self.public_compile_opts += props.get('INTERFACE_COMPILE_OPTIONS', []) - self.link_flags += props.get('INTERFACE_LINK_OPTIONS', []) # TODO refactor this copy paste from CMakeDependency for future releases reg_is_lib = re.compile(r'^(-l[a-zA-Z0-9_]+|-l?pthread)$') @@ -342,6 +335,12 @@ class ConverterTarget: libraries = [] mlog.debug(tgt) + if 'INTERFACE_INCLUDE_DIRECTORIES' in tgt.properties: + self.includes += [x for x in tgt.properties['INTERFACE_INCLUDE_DIRECTORIES'] if x] + + if 'INTERFACE_LINK_OPTIONS' in tgt.properties: + self.link_flags += [x for x in tgt.properties['INTERFACE_LINK_OPTIONS'] if x] + if 'INTERFACE_COMPILE_DEFINITIONS' in tgt.properties: self.public_compile_opts += ['-D' + re.sub('^-D', '', x) for x in tgt.properties['INTERFACE_COMPILE_DEFINITIONS'] if x] |