Commit Graph

37 Commits

Author SHA1 Message Date
Sergei Silnov
89518ee86a build & config: Check requirements of managed components of main and add interface versioning 2022-05-30 14:36:22 +02:00
Sergei Silnov
487603b51f build & config: Add IDF_COMPONENT_MANAGER build property 2022-05-26 12:48:27 +02:00
Sergei Silnov
69cf85e6a6 tools: Enable the component manager by default in CMake 2022-05-03 17:38:36 +02:00
Ivan Grokhotkov
273633ee31
build system: add WHOLE_ARCHIVE component property
This component property allows including all component object files
into the executable. It is equivalent to wrapping the component
library with -Wl,--whole-archive and -Wl,--no-whole-archive flags.

Closes https://github.com/espressif/esp-idf/issues/8667
2022-04-05 18:50:20 +02:00
Ivan Grokhotkov
71a884571c cmake: add idf_component_optional_requires utility function
It can be used in component CMakeLists.txt files when adding "weak"
dependencies between component. A "weak" dependency from A to B is
similar to target_link_libraries(A PRIVATE B), but it gets added only
if B is included in the build.
Use it instead of specifying B as part of PRIV_REQUIRES when the
component can be built (even if with reduced functionality) without
component B being available.
2021-12-13 10:53:22 +01:00
Omar Chebib
0baf2c43cc Build: CMake compiler flags will be set, regardless of the cache status
Defining CMake variables from the command-line or from another CMake project,
such as `-DCMAKE_C_FLAGS= -DCMAKE_CXX_FLAGS=`, caused a link failure as ESP
CMake was unable to set its proper compilation flags.
Additional CMake compiler flags can now be provided by another project.

* Closes https://github.com/espressif/esp-idf/issues/7507
2021-11-29 09:48:13 +00:00
Fu Hanxi
ea1005b740 build: create BUILD_DIR/prefix_map_gdbinit when enable reproducible build
add project property BUILD_COMPONENT_DIRS
2021-10-26 10:55:00 +08:00
Ivan Grokhotkov
5a6e27b8a1 build system: quote values in __component_write_properties 2021-10-06 10:15:02 +02:00
morris
0f7b90d205 cmake: don't treat the readme file as a component 2021-09-24 10:56:58 +08:00
Sergei Silnov
37b791e242 Build System: Don't track dependencies.lock 2021-08-30 13:23:23 +02:00
Jakob Hasse
dd3f43ca2d [build system]: add ruby check before mocking 2021-08-13 14:31:44 +08:00
Ivan Grokhotkov
2f811b7975 cmake: sort lists obtained from file(GLOB)
CMake sorts result of file(GLOB) command since version 3.6.0:
https://gitlab.kitware.com/cmake/cmake/-/commit/edcccde7d

Since ESP-IDF sets cmake_minimum_required version to 3.5, and version
3.5.1 is used in CI, sort file lists obtained from file(GLOB)
manually.

This helps obtain reproducible order of libraries passed to the linker
and to ldgen.
2021-07-22 10:14:33 +08:00
Jakob Hasse
366ede3ffb [cmake]: Fixed mock register function
* REQUIRES was missing from multi value args
2021-07-19 13:57:19 +08:00
Jakob Hasse
79b0256d63 [driver]: partial mocking of driver component
* added mocking of spi master and gpio
* mock registering in one function in
  component.cmake
2021-06-24 10:10:29 +08:00
Sergei Silnov
a5981c12c2 Move call for component manager to build.cmake 2021-02-04 15:07:23 +01:00
Jakob Hasse
52093fa4ef linux: added linux target
* add toolchain file
* add linux to preview targets
* add stub for dfu number in cmake
* excluded unity runner per default
* Added esp_attr.h and esp_partition.h linux stubs
* component.cmake check list for emptyness
* added switch for linux in unity cmake file
* Added Linux host example app
2020-12-14 18:53:14 +08:00
Jakob Hasse
901925ebc5 CMake: Fix issue in newer cmake versions
* Fixes following error:

  can not determine linker language
  for target: __idf_newlib
2020-12-14 18:53:14 +08:00
Renz Bagaporo
ebf07d353d cmake: allow overriding kconfig, kconfig_projbuild on registration 2020-06-16 20:42:00 +08:00
Renz Bagaporo
f8d0c5770b cmake: take note of component overriden dir 2020-06-16 20:42:00 +08:00
Sergei Silnov
dfafa98253 Use component manager if available as python package 2019-12-19 16:48:36 +01:00
Angus Gratton
96b96ae244 Merge branch 'bugfix/cmake_component_names' into 'master'
CMake: Component name related bugfixes

See merge request espressif/esp-idf!5921
2019-09-17 11:16:25 +08:00
Angus Gratton
5b9576e282 Merge branch 'bugfix/hide_component_internal_targets' into 'master'
cmake: hide component internal targets

See merge request espressif/esp-idf!5866
2019-09-03 09:24:34 +08:00
Per Malmberg
31cdd38744 Make sure ESP_PLATFORM is defined when processing CMake files. 2019-08-28 09:44:06 +08:00
Renz Christian Bagaporo
826568a120 cmake: introduce BUILD_COMPONENT_ALIASES
This commit makes it so that BUILD_COMPONENT holds only the component,
and a new property BUILD_COMPONENT_ALIASES hold the full name of the
component.

This also removes erroneous check for duplicate components, as this can
never happen:

(1) if two components have the same name but different prefixes,
the internal names are still unique between them

(2)if two components happen to have the same name and same prefix, the
latter would override the former
2019-08-27 20:40:29 +08:00
Renz Christian Bagaporo
88320062b8 cmake: make build components available before immediately
Previous implementation only builds list of components included in the
build during component registration.

Since the build components is known as the requirements expansion is
ongoing, update the list here instead.
2019-08-27 15:24:31 +08:00
Mahavir Jain
1248f17749 cmake: fix issue with handling of EXCLUDE_SRCS 2019-08-22 13:17:44 +05:30
Renz Christian Bagaporo
72ddc940e0 cmake: hide internal targets
Use imported library, which does not create additional rules, but still
allows attaching arbitraty properties instead of custom targets. This
allows the targets to not appear in the target list of IDEs such as
CLion.
2019-08-22 09:39:24 +08:00
Angus Gratton
5e39718c22 Merge branch 'bugfix/component_set_properties' into 'master'
CMake: Set component properties

See merge request espressif/esp-idf!5738
2019-08-13 10:23:30 +08:00
Renz Christian Bagaporo
87ebdaa74e cmake: set component properties 2019-08-09 20:51:20 +08:00
Renz Christian Bagaporo
08de39c226 cmake: check include directories 2019-08-09 08:40:17 +08:00
Renz Christian Bagaporo
2a5b02097b cmake: do not force use of new signature for target_link_libraries 2019-07-08 19:43:57 +08:00
Renz Christian Bagaporo
8424822150 cmake: set CONFIG_DIR build property
Add CONFIG_DIR as a build property, so that components don't have to
derive it from one of the generated config files.
2019-06-20 16:02:22 +08:00
Renz Christian Bagaporo
3882e48e8a cmake: use new signature form of target_link_library to link components
!4452 used setting LINK_LIBRARIES and INTERFACE_LINK_LIBRARIES to link
components built under ESP-IDF build system. However, LINK_LIBRARIES does
not produce behavior same as linking PRIVATE. This MR uses the new
signature for target_link_libraries directly instead. This also moves
setting dependencies during component registration rather than after all
components have been processed.

The consequence is that internally, components have to use the new
signature form as well. This does not affect linking the components to
external targets, such as with idf_as_lib example. This only affects
linking additional libraries to ESP-IDF libraries outside component processing (after
idf_build_process), which is not even possible for CMake<v3.13 as
target_link_libraries is not valid for targets not created in current
directory. See https://cmake.org/cmake/help/v3.13/policy/CMP0079.html#policy:CMP0079
2019-06-11 18:09:26 +08:00
Renz Christian Bagaporo
297b2c5a39 cmake: evaluate component requirements in one go
!4452 simplified early expansion by using an early expansion script that
only does one thing: get the public and private requirements for each
component, albeit one by one. This was also dependent on parsing
the command output of the expansion script.  This commit makes it so that a list of all
components to be processed to passed to the expansion script, generating a cmake
file that sets each component requirements in one go.

This also makes sure that only components that registered themselves get
included in the final build list.
2019-06-11 18:09:26 +08:00
Renz Christian Bagaporo
b4ad6c1426 cmake: refactor quick check given component dirs 2019-05-20 19:24:17 +08:00
Angus Gratton
99f8a811fd cmake: Warn if something which looks like a component directory isn't
Otherwise, fails build at the add_subdirectory stage
2019-05-13 19:57:39 +08:00
Renz Christian Bagaporo
c6dc47b3e2 cmake: build system changes 2019-05-13 19:57:39 +08:00