target_macroses.jinja 1.1 KB

12345678910111213141516171819
  1. {%- if (current_target.target_macroses is defined) and (current_target.target_macroses|length) -%}
  2. {%- set ONE_CALL_MACROSES = [ 'target_cuda_flags', 'target_cuda_cflags', 'target_proto_outs', 'target_proto_addincls', 'use_export_script', 'target_cython_options', 'target_cython_include_directories', 'set_python_type_for_cython' ] -%}
  3. {#- Apply one call macroses (apply only first found macros) -#}
  4. {%- for ONE_CALL_MACRO in ONE_CALL_MACROSES -%}
  5. {%- set macroses = current_target.target_macroses|selectattr('macro', 'eq', ONE_CALL_MACRO) -%}
  6. {%- if macroses|length -%}
  7. {%- set target_macros = macroses|first -%}
  8. {%- if target_macros.args|length %}
  9. {{ target_macros.macro }}({{ name }}
  10. {%- for arg in target_macros.args %}
  11. {{ arg }}
  12. {%- endfor %}
  13. )
  14. {% endif -%}
  15. {%- endif -%}
  16. {%- endfor -%}
  17. {#- Apply macroses called any times (concat all args and make one call) -#}
  18. {{ Macroses(name, current_target.target_macroses, 'macro', 'args', ONE_CALL_MACROSES) }}
  19. {%- endif -%}