aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordimdim11 <dimdim11@yandex-team.com>2024-08-09 15:13:30 +0300
committerdimdim11 <dimdim11@yandex-team.com>2024-08-09 15:28:02 +0300
commit7f8d3c45f8e24f0142f6794301386c7e802afe66 (patch)
treee85f08a43081319081a806c0089d42b746c7b825
parentf053dd76bd0b8d096b9096701e535a620b6719bd (diff)
downloadydb-7f8d3c45f8e24f0142f6794301386c7e802afe66.tar.gz
Fix conanfile.py with empty requires
Fix conanfile.py with empty requires f7042103d19b2438d3e862281e0a6eb5f5fee67b
-rw-r--r--build/export_generators/cmake/conanfile.py.jinja20
-rw-r--r--build/export_generators/hardcoded-cmake/conanfile.py.jinja19
2 files changed, 25 insertions, 14 deletions
diff --git a/build/export_generators/cmake/conanfile.py.jinja b/build/export_generators/cmake/conanfile.py.jinja
index 5a5e0b5c0a..1374eec639 100644
--- a/build/export_generators/cmake/conanfile.py.jinja
+++ b/build/export_generators/cmake/conanfile.py.jinja
@@ -19,15 +19,21 @@ class App(ConanFile):
{%- endfor -%}
}
+{%- if (conan.requires is defined) and (conan.requires|length) %}
+
requires =
-{%- for conan_require in conan.requires %} "{{ conan_require }}"
-{%- if not loop.last -%},{%- endif -%}
-{%- endfor %}
+{%- for conan_require in conan.requires %} "{{ conan_require }}"
+{%- if not loop.last -%},{%- endif -%}
+{%- endfor -%}
+{%- endif -%}
+
+{%- if (conan.tool_requires is defined) and (conan.tool_requires|length) %}
tool_requires =
-{%- for conan_tool_require in conan.tool_requires %} "{{ conan_tool_require }}"
-{%- if not loop.last -%},{%- endif -%}
-{%- endfor %}
+{%- for conan_tool_require in conan.tool_requires %} "{{ conan_tool_require }}"
+{%- if not loop.last -%},{%- endif -%}
+{%- endfor -%}
+{%- endif -%}
{%- if use_conan2 %}
@@ -53,7 +59,7 @@ class App(ConanFile):
def layout(self):
cmake_layout(self)
-{%- else -%}
+{%- else %}
generators = "cmake_find_package", "cmake_paths"
diff --git a/build/export_generators/hardcoded-cmake/conanfile.py.jinja b/build/export_generators/hardcoded-cmake/conanfile.py.jinja
index a8db73dab1..fbaa4a8e9f 100644
--- a/build/export_generators/hardcoded-cmake/conanfile.py.jinja
+++ b/build/export_generators/hardcoded-cmake/conanfile.py.jinja
@@ -18,16 +18,21 @@ class App(ConanFile):
{%- if not loop.last -%}, {% endif -%}
{%- endfor -%}
}
+{%- if (conan_packages is defined) and (conan_packages|length) %}
requires =
-{%- for conan_require in conan_packages %} "{{ conan_require }}"
-{%- if not loop.last -%},{%- endif -%}
-{%- endfor %}
+{%- for conan_require in conan_packages %} "{{ conan_require }}"
+{%- if not loop.last -%},{%- endif -%}
+{%- endfor %}
+{% endif -%}
+
+{%- if (conan_tool_packages is defined) and (conan_tool_packages|length) %}
tool_requires =
-{%- for conan_tool_require in conan_tool_packages %} "{{ conan_tool_require }}"
-{%- if not loop.last -%},{%- endif -%}
-{%- endfor %}
+{%- for conan_tool_require in conan_tool_packages %} "{{ conan_tool_require }}"
+{%- if not loop.last -%},{%- endif -%}
+{%- endfor %}
+{% endif -%}
{%- if use_conan2 %}
@@ -50,7 +55,7 @@ class App(ConanFile):
def layout(self):
cmake_layout(self)
-{%- else -%}
+{%- else %}
generators = "cmake_find_package", "cmake_paths"