{%- set interfaces = [] -%} {%- set publics = [] -%} {%- set privates = [] -%} {%- set allocators = [] -%} {%- set add_interfaces = current_target.link|map(attribute='interfaces')|sum -%} {%- if add_interfaces|length -%} {%- set interfaces = interfaces + add_interfaces -%} {%- endif -%} {%- if current_target.is_fake_module -%} {%- set add_interfaces = current_target.link|map(attribute='publics')|sum -%} {%- if add_interfaces|length -%} {%- set interfaces = interfaces + add_interfaces -%} {%- endif -%} {%- else -%} {%- set add_publics = current_target.link|map(attribute='publics')|sum -%} {%- if add_publics|length -%} {%- set publics = publics + add_publics -%} {%- endif -%} {%- if (current_target.macro == "add_global_library_for") and (target.link|length) -%} {%- set add_publics = target.link|map(attribute='publics')|sum -%} {%- if add_publics|length -%} {%- set publics = publics + add_publics -%} {%- endif -%} {%- endif -%} {%- set add_privates = current_target.link|map(attribute='privates')|sum -%} {%- if add_privates|length -%} {%- set privates = privates + add_privates -%} {%- endif -%} {%- endif -%} {%- if (current_target.allocators is defined) and (current_target.allocators|length) -%} {%- if (current_target.macro == "add_executable") or (current_target.macro == "add_library" and ("SHARED" in current_target.macro_args)) -%} {#- support allocators -#} {%- set allocators = allocators + current_target.allocators -%} {%- else -%} {#- not supported allocators -#} {%- if current_target.is_fake_module -%} {%- set interfaces = interfaces + current_target.allocators -%} {%- else -%} {%- set publics = publics + current_target.allocators -%} {%- endif -%} {%- endif -%} {%- endif -%} {%- if interfaces|length %} target_link_libraries({{ name }} INTERFACE {%- for interface in interfaces %} {{ interface }} {%- endfor %} ) {% endif -%} {%- if publics|length %} target_link_libraries({{ name }} PUBLIC {%- for public in publics %} {{ public }} {%- endfor %} ) {% endif -%} {%- if privates|length %} target_link_libraries({{ name }} PRIVATE {%- for private in privates %} {{ private }} {%- endfor %} ) {% endif -%} {%- if allocators|length %} target_allocator({{ name }} {%- for allocator in allocators %} {{ allocator }} {%- endfor %} ) {% endif -%}