Commit graph

164 commits

Author SHA1 Message Date
Angus Gratton 9a412d3a08 Merge branch 'feature/use_new_component_registration_apis' into 'master'
Use new component registration API

See merge request idf/esp-idf!4898
2019-06-25 10:24:11 +08:00
Angus Gratton 396131433a Merge branch 'feature/idf_size_json' into 'master'
idf_size: Support JSON output

Closes IDF-264

See merge request idf/esp-idf!4987
2019-06-24 19:06:12 +08:00
Renz Christian Bagaporo 047cf71c01 tools: update make converter to use new component registration api 2019-06-21 19:53:29 +08:00
Renz Christian Bagaporo 11924d76cb cmake: clarify build trimming docs
How idf_build_component and the COMPONENTS argument to idf_build_process
interact is not clear/misleading. Clarify their interaction in the docs.

Closes: https://github.com/espressif/esp-idf/issues/3630
2019-06-20 16:02:22 +08:00
Renz Christian Bagaporo 64d37f5cb9 cmake: fix issues with build process
Fix issue when COMPONENTS are is not specified for idf_build_process,
no component is included in the build.
2019-06-20 16:02:22 +08:00
Renz Christian Bagaporo 2fff500a1c cmake: export IDF_TARGET to menuconfig
Pass value of IDF_TARGET to menuconfig invocation.
2019-06-20 16:02:22 +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
Angus Gratton eac356ef4a Merge branch 'feature/idf_version_header' into 'master'
esp_common: add esp_idf_version.h header to define IDF version

Closes IDF-253

See merge request idf/esp-idf!4596
2019-06-13 09:41:35 +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 f0f861ccd9 ldgen: use user input filename for processed template
Previously ldgen determines the output file name on its own. This commit
makes it so that user can dictate what the output file name will be
for the processed template, if the user needs it for something else.
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 33dd7011be cmake: expand build components before generating config
!4452 had config generation first before building the component list
to be used in the build. This proved to be detrimental when a new target
is added as config generation would consider configs from both targets.
2019-06-11 18:09:26 +08:00
Sergei Silnov 2557442ae9 cmake: fix crosstool-NG version check regex 2019-06-10 09:51:40 +00:00
Roland Dobai 5034a57605 Tools: Fix CMake menuconfig used with combination of MSYS and CMD 2019-05-29 14:35:57 +02:00
Angus Gratton 05be37c87c idf_size: Support JSON output
Pass -DOUTPUT_JSON=1 to get JSON formatted output from CMake targets
2019-05-29 17:11:53 +10:00
Angus Gratton 22514c1dd9 cmake: For gcc8 use linker to find paths to libc, libm, libstdc++, etc
Removes the need to know/guess the paths to these libraries. Once we are gcc 8 only, we
can remove -nostdlib and no additional arguments are needed for system libraries.

The catch is: any time IDF overrides a symbol in the toolchain sysroot, we need
an undefined linker marker to make sure this symbol is seen by linker.
2019-05-28 12:54:37 +08:00
Renz Christian Bagaporo 83ce35d638 cmake: do not use link groups 2019-05-28 10:51:02 +08:00
Angus Gratton 801f5d6e82 Merge branch 'bugfix/more_cmake_fixes' into 'master'
More CMake fixes

See merge request idf/esp-idf!5060
2019-05-27 15:48:25 +08:00
Renz Christian Bagaporo 25b539d4fc cmake: make project includes know gcc version as well 2019-05-23 18:39:31 +08:00
Renz Christian Bagaporo 74c6c926ea nghttp: move HAVE_CONFIG_H compile definition to component 2019-05-23 18:39:31 +08:00
Renz Christian Bagaporo f125a9aaf4 cmake: restore creation of kconfig_menus.json 2019-05-23 18:39:31 +08:00
Roland Dobai a52451258e Fix cmake confserver target 2019-05-23 08:29:05 +02:00
Angus Gratton c879aff6f5 Merge branch 'bugfix/cmake_git_describe' into 'master'
cmake: Project & IDF git revisions: Show un-annotated tags and -dirty flag

See merge request idf/esp-idf!5042
2019-05-23 12:36:49 +08:00
Angus Gratton 95dcfecedc cmake: Project & IDF git revisions: Show un-annotated tags and -dirty flag
Adds --tags and --dirty flags to cmake git_describe() calls, and not
pass the HEAD commit hash (incompatible with --dirty)

Makes IDF_VER output the same as in Make build system

Thanks to @william-ferguson-au for reporting this:
https://github.com/espressif/esp-idf/issues/3378#event-2355460974
2019-05-23 13:46:23 +10:00
Angus Gratton e8ade3c68d Merge branch 'feature/Kconfig_rename' into 'master'
Rename Kconfig options

Closes IDF-265

See merge request idf/esp-idf!4883
2019-05-22 11:08:36 +08:00
Roland Dobai 997b29a9ca Rename Kconfig options (components/esptool_py) 2019-05-21 09:32:55 +02:00
Renz Christian Bagaporo b4ad6c1426 cmake: refactor quick check given component dirs 2019-05-20 19:24:17 +08:00
Renz Christian Bagaporo e1726a91ce cmake: project includes should know about ESP_PLATFORM variable 2019-05-20 18:24:34 +08:00
Renz Christian Bagaporo e3eb945fd2 cmake: restore use of GNU extensions from libc 2019-05-20 18:24:34 +08:00
Renz Christian Bagaporo 5175a152d9 cmake: exclude dot-dirs from added components 2019-05-20 18:24:34 +08:00
Renz Christian Bagaporo 078c69e689 cmake: remove redundant variable setting 2019-05-20 18:24:34 +08:00
Ivan Grokhotkov 6ca07eca68 esp_common: add version definitions in code and build system
Closes https://github.com/espressif/esp-idf/issues/2482
Closes IDF-253
2019-05-20 13:14:56 +08:00
Renz Christian Bagaporo 7493bd2e28 cmake: add command to get config value 2019-05-14 18:01:14 +08:00
Renz Christian Bagaporo de9bb5a160 cmake: fix scope issues 2019-05-14 18:01:14 +08:00
Renz Christian Bagaporo c564d1730f esp_common: append gc sections link flag 2019-05-14 18:01:14 +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
Angus Gratton 3cf56ea6b6 cmake: Fix menuconfig target
need to load mconf path as build property
2019-05-13 19:57:39 +08:00
Renz Christian Bagaporo c6dc47b3e2 cmake: build system changes 2019-05-13 19:57:39 +08:00
Renz Christian Bagaporo 459dd29444 cmake: restore ccache use when present
Closes https://github.com/espressif/esp-idf/issues/3116
2019-05-06 20:04:07 +08:00
Renz Christian Bagaporo b1ecd75d83 ldgen: pass component libraries directly 2019-04-26 20:06:53 +08:00
Roland Dobai 23ee93ea76 Rename deprecated Kconfig options in a backward compatible way 2019-04-24 12:53:02 +02:00
Angus Gratton a20d02b7f1 Merge branch 'feature/remove_dependency_to_soc' into 'master'
global: remove dependency to soc everywhere except driver and kernel components

See merge request idf/esp-idf!4678
2019-04-18 08:08:41 +08:00
Anton Maklakov 410f5c3f7d build: Add a standard way to use GNU extensions from libc, since we have a general configured newlib in the toolchain 2019-04-17 12:08:36 +07:00
Michael (XIAO Xufeng) 562af8f65e global: move the soc component out of the common list
This MR removes the common dependency from every IDF components to the SOC component.

Currently, in the ``idf_functions.cmake`` script, we include the header path of SOC component by default for all components.
But for better code organization (or maybe also benifits to the compiling speed), we may remove the dependency to SOC components for most components except the driver and kernel related components.

In CMAKE, we have two kinds of header visibilities (set by include path visibility):

(Assume component A --(depends on)--> B, B is the current component)

1. public (``COMPONENT_ADD_INCLUDEDIRS``): means this path is visible to other depending components (A) (visible to A and B)
2. private (``COMPONENT_PRIV_INCLUDEDIRS``): means this path is only visible to source files inside the component (visible to B only)

and we have two kinds of depending ways:

(Assume component A --(depends on)--> B --(depends on)--> C, B is the current component)

1. public (```COMPONENT_REQUIRES```): means B can access to public include path of C. All other components rely on you (A) will also be available for the public headers. (visible to A, B)
2. private (``COMPONENT_PRIV_REQUIRES``): means B can access to public include path of C, but don't propagate this relation to other components (A). (visible to B)

1. remove the common requirement in ``idf_functions.cmake``, this makes the SOC components invisible to all other components by default.
2. if a component (for example, DRIVER) really needs the dependency to SOC, add a private dependency to SOC for it.
3. some other components that don't really depends on the SOC may still meet some errors saying "can't find header soc/...", this is because it's depended component (DRIVER) incorrectly include the header of SOC in its public headers. Moving all this kind of #include into source files, or private headers
4. Fix the include requirements for some file which miss sufficient #include directives. (Previously they include some headers by the long long long header include link)

This is a breaking change. Previous code may depends on the long include chain.
You may need to include the following headers for some files after this commit:

- soc/soc.h
- soc/soc_memory_layout.h
- driver/gpio.h
- esp_sleep.h

The major broken include chain includes:

1. esp_system.h no longer includes esp_sleep.h. The latter includes driver/gpio.h and driver/touch_pad.h.
2. ets_sys.h no longer includes soc/soc.h
3. freertos/portmacro.h no longer includes soc/soc_memory_layout.h

some peripheral headers no longer includes their hw related headers, e.g. rom/gpio.h no longer includes soc/gpio_pins.h and soc/gpio_reg.h

BREAKING CHANGE
2019-04-16 13:21:15 +08:00
Anton Maklakov 2e6c8cdce3 esp32: disable -Wframe-address
Since the behavior is well defined on Xtensa with Window ABI we can
suppress a frame-address warning. Also fix the CMAKE_C*_FLAGS parsing.
2019-04-10 13:52:30 +08:00
suda-morris 78034879a8 make bootloader depend on IDF_TARGET 2019-04-08 11:08:06 +08:00
morris dbdb299bb1 create xtensa component
1. move xtensa specific files out of esp32 component
2. merge xtensa-debug-module component into xtensa
2019-03-27 20:24:28 +08:00
morris a2f07b0806 move common include files from esp32 into esp_common 2019-03-26 11:57:03 +08:00
Angus Gratton abdc9f50d8 cmake: Set COMPONENT_PATH during early expansion of dependencies
Works around bug where components/soc/CMakeLists.txt was testing "EXISTS
${COMPONENT_PATH}/${SOC_NAME}" and this test could pass during early
expansion if COMPONENT_PATH was empty and a directory /esp32 exists
on Windows.

Closes https://github.com/espressif/esp-idf/issues/3195
2019-03-20 10:45:45 +11:00
Konstantin Kondrashov f8ca296438 cmake: Trim IDF_VER to fit a 32-bit field 2019-03-13 20:04:43 +08:00