123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- {%- 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 is_really_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_shared_library") 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 is_really_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 -%}
- {#- OpenSSL recipe under Conan2 uses another target name, patch it manually here, or else build fails -#}
- {%- if (use_conan2) and (public == "OpenSSL::OpenSSL") -%}
- {%- set public = "openssl::openssl" -%}
- {%- endif %}
- {{ 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 -%}
|