{"id":1371,"date":"2023-03-06T11:34:29","date_gmt":"2023-03-06T11:34:29","guid":{"rendered":"https:\/\/ibex.tech\/c\/?p=1371"},"modified":"2023-03-06T11:46:51","modified_gmt":"2023-03-06T11:46:51","slug":"requires-list","status":"publish","type":"post","link":"https:\/\/ibex.tech\/c\/compilers\/gcc-compiler\/cmake\/requires-list","title":{"rendered":"REQUIRES list"},"content":{"rendered":"\n<p>If you don\u2019t have a REQUIRES list in CMakeLists.txt that is declaring dependencies on certain special components, you typically don\u2019t have to add basic components as REQUIRES also, due to the implicit dependency behaviour of main component (for an Espressif ESP-IDF explanation see\u00a0<a rel=\"noreferrer noopener\" href=\"https:\/\/docs.espressif.com\/projects\/esp-idf\/en\/latest\/esp32\/api-guides\/build-system.html#main-component-requirements\" target=\"_blank\">here<\/a>).<\/p>\n\n\n\n<p>If you do have a REQUIRES section, you will need to add things like esp_timer, esp_adc, etc components to the REQUIRES list if you are using them, otherwise you will get errors like these:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>fatal error: esp_adc\/adc_oneshot.h: No such file or directory<\/li>\n\n\n\n<li>fatal error: esp_timer.h: No such file or directory<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">Example CMakeLists.txt with a REQUIRES list<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>idf_component_register(\r\n\t\t\t\t\tSRCS\r\n\t\t\t\t\t\t\t\"ap-main.c\"\r\n\t\t\t\t\t\t\t\"led-is31fl3238.c\"\r\n\t\t\t\t\t\t\t\"io-pca9539.c\"\r\n\t\t\t\t\t\t\t\"usb-memory-stick.c\"\r\n\t\t\t\t\tINCLUDE_DIRS\r\n\t\t\t\t\t\t\t\".\"\r\n\t\t\t\t\tREQUIRES\r\n\t\t\t\t\t\t\tesp_timer\r\n\t\t\t\t\t\t\tesp_adc\r\n\t\t\t\t\t\t\tusb\r\n\t\t\t\t\t\t\tvfs\r\n\t\t\t\t\t)<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>If you don\u2019t have a REQUIRES list in CMakeLists.txt that is declaring dependencies on certain special components, you typically don\u2019t have to add basic components as REQUIRES also, due to the implicit dependency behaviour of main component (for an Espressif ESP-IDF explanation see\u00a0here). If you do have a REQUIRES section, you will need to add [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[104],"tags":[],"class_list":["post-1371","post","type-post","status-publish","format-standard","hentry","category-cmake"],"_links":{"self":[{"href":"https:\/\/ibex.tech\/c\/wp-json\/wp\/v2\/posts\/1371","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ibex.tech\/c\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ibex.tech\/c\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ibex.tech\/c\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/ibex.tech\/c\/wp-json\/wp\/v2\/comments?post=1371"}],"version-history":[{"count":2,"href":"https:\/\/ibex.tech\/c\/wp-json\/wp\/v2\/posts\/1371\/revisions"}],"predecessor-version":[{"id":1377,"href":"https:\/\/ibex.tech\/c\/wp-json\/wp\/v2\/posts\/1371\/revisions\/1377"}],"wp:attachment":[{"href":"https:\/\/ibex.tech\/c\/wp-json\/wp\/v2\/media?parent=1371"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibex.tech\/c\/wp-json\/wp\/v2\/categories?post=1371"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibex.tech\/c\/wp-json\/wp\/v2\/tags?post=1371"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}