diff options
author | Xavier Claessens <xavier.claessens@collabora.com> | 2019-09-25 15:45:22 -0400 |
---|---|---|
committer | Xavier Claessens <xclaesse@gmail.com> | 2019-10-01 13:30:15 -0400 |
commit | 7a83668b6b05ecdabe210a5e3a507df2339099bb (patch) | |
tree | c3e4c3a342fc8bed0022338cf2766087784cdd84 /mesonbuild/cmake/interpreter.py | |
parent | 71bfec7ec14b28adec32772c84bbf477e3a75e77 (diff) | |
download | meson-7a83668b6b05ecdabe210a5e3a507df2339099bb.zip meson-7a83668b6b05ecdabe210a5e3a507df2339099bb.tar.gz meson-7a83668b6b05ecdabe210a5e3a507df2339099bb.tar.bz2 |
cmake: Generate declare_dependency() only for libraries
Diffstat (limited to 'mesonbuild/cmake/interpreter.py')
-rw-r--r-- | mesonbuild/cmake/interpreter.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/mesonbuild/cmake/interpreter.py b/mesonbuild/cmake/interpreter.py index 5687ad2..381f829 100644 --- a/mesonbuild/cmake/interpreter.py +++ b/mesonbuild/cmake/interpreter.py @@ -783,23 +783,23 @@ class CMakeInterpreter: } # Generate the function nodes - node_list = [] + inc_node = assign(inc_var, function('include_directories', tgt.includes)) + node_list = [inc_node] if tgt_func == 'header_only': del dep_kwargs['link_with'] - inc_node = assign(inc_var, function('include_directories', tgt.includes)) dep_node = assign(dep_var, function('declare_dependency', kwargs=dep_kwargs)) - - node_list = [inc_node, dep_node] + node_list += [dep_node] src_var = '' tgt_var = '' - else: - inc_node = assign(inc_var, function('include_directories', tgt.includes)) src_node = assign(src_var, function('files', sources)) tgt_node = assign(tgt_var, function(tgt_func, [base_name, [id_node(src_var)] + generated], tgt_kwargs)) - dep_node = assign(dep_var, function('declare_dependency', kwargs=dep_kwargs)) - - node_list = [inc_node, src_node, tgt_node, dep_node] + node_list += [src_node, tgt_node] + if tgt_func in ['static_library', 'shared_library']: + dep_node = assign(dep_var, function('declare_dependency', kwargs=dep_kwargs)) + node_list += [dep_node] + else: + dep_var = '' # Add the nodes to the ast root_cb.lines += node_list |