1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- {%- 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 -%}
|