diff options
author | dimdim11 <dimdim11@yandex-team.com> | 2024-04-23 13:00:15 +0300 |
---|---|---|
committer | dimdim11 <dimdim11@yandex-team.com> | 2024-04-23 13:10:15 +0300 |
commit | f12862d32761cd6c9ba50446e9637f6d9b18ed43 (patch) | |
tree | a1290f1571063fb9aeb3de73dc4e6a9f7ad9b64d | |
parent | 74b23032a9cb2895736ba19d0052edd34327342a (diff) | |
download | ydb-f12862d32761cd6c9ba50446e9637f6d9b18ed43.tar.gz |
Remove prologue/epilogue from yexport code, remove platform CNameLists from code
d6bb959adffd2a72bb6b3020d69de20211bec6a6
5 files changed, 54 insertions, 42 deletions
diff --git a/build/export_generators/hardcoded-cmake/common_cmake_lists.jinja b/build/export_generators/hardcoded-cmake/common_cmake_lists.jinja index f1356eef52..2a2a76e4e5 100644 --- a/build/export_generators/hardcoded-cmake/common_cmake_lists.jinja +++ b/build/export_generators/hardcoded-cmake/common_cmake_lists.jinja @@ -2,9 +2,9 @@ {% include '[generator]/disclaimer.jinja' -%} {% set platforms_count = platform_names|length -%} {% if platforms_count > 0 -%} -{% for i in range(platforms_count) %} -{% if i != 0 %}else{% endif %}if ({{ platforms[platform_names[i]] }}) - include({{ platform_cmakelists[i] }}) -{%- endfor %} +{% for i in range(platforms_count) %} +{% if i != 0 %}else{% endif %}if ({{ platforms[platform_names[i]] }}) + include(CMakeLists.{{ platform_names[i] }}.txt) +{%- endfor %} endif() {% endif -%} diff --git a/build/export_generators/hardcoded-cmake/dir_cmake_lists.jinja b/build/export_generators/hardcoded-cmake/dir_cmake_lists.jinja index ec0d217d41..f63bcba4da 100644 --- a/build/export_generators/hardcoded-cmake/dir_cmake_lists.jinja +++ b/build/export_generators/hardcoded-cmake/dir_cmake_lists.jinja @@ -1,4 +1,7 @@ +{# DEPRECATED -#} {% include prologue ignore missing %} +{#- ENABLE AFTER yexport RELEASE #} +{#- include 'prologue.cmake' ignore missing #} {% include '[generator]/disclaimer.jinja' -%} {% for package in packages -%} @@ -8,9 +11,11 @@ find_package({{ package[0] }} REQUIRED {%- endfor %} {%- endif %}) {% endfor -%} -{% for incl in includes -%} +{% if includes is defined -%} +{% for incl in includes -%} include({{ incl }}) -{% endfor -%} +{% endfor -%} +{% endif -%} {% for subdir in subdirs -%} add_subdirectory({{ subdir }}) {% endfor -%} @@ -21,15 +26,18 @@ add_subdirectory({{ subdir }}) {% endfor -%} {% for target in targets %} -{%- set macro = target.macro -%} - {%- set name = target.name -%} - {%- set is_interface = target.is_interface -%} - {%- set macro_args = target.macro_args -%} - {%- set properties = target.properties -%} - {%- set attributes = target.attributes -%} - {%- set target_dir_macros = target.target_dir_macros -%} - {%- set target_macros = target.target_macros -%} - {%- set dependencies = target.dependencies -%} - {%- include '[generator]/target_cmake_lists.jinja' %}{{"\n"}} +{%- set macro = target.macro -%} +{%- set name = target.name -%} +{%- set is_interface = target.is_interface -%} +{%- set macro_args = target.macro_args -%} +{%- set properties = target.properties -%} +{%- set attributes = target.attributes -%} +{%- set target_dir_macros = target.target_dir_macros -%} +{%- set target_macros = target.target_macros -%} +{%- set dependencies = target.dependencies -%} +{%- include '[generator]/target_cmake_lists.jinja' %}{{"\n"}} {%- endfor %} +{# DEPRECATED -#} {% include epilogue ignore missing %} +{#- ENABLE AFTER yexport RELEASE #} +{#- include 'epilogue.cmake' ignore missing #} diff --git a/build/export_generators/hardcoded-cmake/generator.toml b/build/export_generators/hardcoded-cmake/generator.toml index 4cdb46dd7b..45081d52af 100644 --- a/build/export_generators/hardcoded-cmake/generator.toml +++ b/build/export_generators/hardcoded-cmake/generator.toml @@ -49,13 +49,13 @@ template={ path="dir_cmake_lists.jinja", dest="CMakeLists{PLATFORM}.txt" } [attrs.root] project_name="str" project_language_list="list" -platform_cmakelists="list" platform_vars="list" includes="sorted_set" use_conan="bool" vanilla_protobuf="flag" [attrs.dir] +# DEPRECATED prologue="str" epilogue="str" diff --git a/build/export_generators/hardcoded-cmake/root_cmake_lists.jinja b/build/export_generators/hardcoded-cmake/root_cmake_lists.jinja index 5107b2c42e..008bc90fed 100644 --- a/build/export_generators/hardcoded-cmake/root_cmake_lists.jinja +++ b/build/export_generators/hardcoded-cmake/root_cmake_lists.jinja @@ -23,8 +23,12 @@ cmake_policy(SET CMP0104 OLD) include(cmake/global_flags.cmake) include(cmake/global_vars.cmake) -{% for path in includes %}include({{path}}) -{%endfor%}{% if use_conan %} +{% if includes is defined -%} +{% for incl in includes -%} +include({{ incl }}) +{% endfor -%} +{% endif -%} +{% if use_conan %} if (CMAKE_CROSSCOMPILING) include(${PROJECT_BINARY_DIR}/conan_paths.cmake) else() @@ -49,7 +53,7 @@ set(vanilla_protobuf "yes") {% if platforms_count > 0 -%} {% for i in range(platforms_count) -%} {% if i != 0 %}else{% endif %}if ({{ platforms[platform_names[i]] }}) - include({{ platform_cmakelists[i] }}) + include(CMakeLists.{{ platform_names[i] }}.txt) {% endfor -%} endif() {% endif %} diff --git a/build/export_generators/hardcoded-cmake/target_cmake_lists.jinja b/build/export_generators/hardcoded-cmake/target_cmake_lists.jinja index ef317d7b8c..2e2ca52aa9 100644 --- a/build/export_generators/hardcoded-cmake/target_cmake_lists.jinja +++ b/build/export_generators/hardcoded-cmake/target_cmake_lists.jinja @@ -1,9 +1,9 @@ {{ macro }}({{ name }} {%- if is_interface %} INTERFACE{% endif %} {%- if macro_args|length > 0 %} -{%- for arg in macro_args %} +{%- for arg in macro_args %} {{ arg }} -{%- endfor -%} +{%- endfor -%} {% endif %}) {% for property in properties -%} @@ -13,39 +13,39 @@ set_property(TARGET {{ name }} PROPERTY ) {% endfor -%} {% for attribute in attributes %} -{%- if attribute[1].iface is defined %} +{%- if attribute[1].iface is defined %} {{ attribute[0] }}({{ name }} INTERFACE -{% for val in attribute[1].iface %} {{ val }} -{% endfor %}) -{%- endif %} -{%- if attribute[1].pub is defined %} +{% for val in attribute[1].iface %} {{ val }} +{% endfor %}) +{%- endif %} +{%- if attribute[1].pub is defined %} {{ attribute[0] }}({{ name }} PUBLIC -{% for val in attribute[1].pub %} {{ val }} -{% endfor %}) -{%- endif %} -{%- if attribute[1].priv is defined %} +{% for val in attribute[1].pub %} {{ val }} +{% endfor %}) +{%- endif %} +{%- if attribute[1].priv is defined %} {{ attribute[0] }}({{ name }} PRIVATE -{% for val in attribute[1].priv %} {{ val }} -{% endfor %}) -{%- endif %} +{% for val in attribute[1].priv %} {{ val }} +{% endfor %}) +{%- endif %} {% endfor %} {% for dir_macro in target_dir_macros %} {{ dir_macro[0] }}( -{% for value in dir_macro[1] %} {{ value }} -{% endfor %}) +{% for value in dir_macro[1] %} {{ value }} +{% endfor %}) {% endfor %} {% for target_macro in target_macros %} {{ target_macro[0] }}({{ name }} -{%- if target_macro[1]|length > 0 %} -{% for value in target_macro[1] -%} +{%- if target_macro[1]|length > 0 %} +{% for value in target_macro[1] -%} {{ value }} -{% endfor %} -{%- endif %}) +{% endfor %} +{%- endif %}) {% endfor %} {% if dependencies|length > 0 -%} if(NOT CMAKE_CROSSCOMPILING) add_dependencies({{ name }} -{% for dep in dependencies %} {{ dep }} -{% endfor %}) +{% for dep in dependencies %} {{ dep }} +{% endfor %}) endif() {%- endif -%} |