Commit Graph

253 Commits

Author SHA1 Message Date
Mahavir Jain
8e7c71a1a0 Merge branch 'bugfix/cmake_src_exclude_issue' into 'master'
cmake: fix issue with handling of EXCLUDE_SRCS

See merge request espressif/esp-idf!5869
2019-08-23 14:21:16 +08:00
Mahavir Jain
1248f17749 cmake: fix issue with handling of EXCLUDE_SRCS 2019-08-22 13:17:44 +05:30
Angus Gratton
f85ba3516f Merge branch 'bugfix/fix_project_ver_issue' into 'master'
CMake: fix retrieving PROJECT_VER

See merge request espressif/esp-idf!5842
2019-08-22 10:47:06 +08:00
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
5a3bad6119 Merge branch 'feature/freebsd_build_system' into 'master'
build systems: Changes to work on FreeBSD

Closes IDFGH-1657

See merge request espressif/esp-idf!5821
2019-08-21 16:18:47 +08:00
Renz Christian Bagaporo
4690152eca cmake: make default version 1 2019-08-21 12:46:38 +08:00
Renz Christian Bagaporo
3eecd43b31 cmake: fix issue with checking build process args 2019-08-21 12:20:46 +08:00
Angus Gratton
60eec0e969 Merge branch 'bugfix/set_mconf_idf_build_dir' into 'master'
cmake: set build dir for mconf-idf

See merge request espressif/esp-idf!5819
2019-08-20 13:10:36 +08:00
Angus Gratton
0a0bb09585 Merge 'master' into feature/esp32s2beta_update 2019-08-20 13:55:23 +10:00
Tomoyuki Sakurai
d296aad2a9 build systems: Changes to work on FreeBSD
Merges https://github.com/espressif/esp-idf/pull/2029
2019-08-19 15:33:55 +10:00
Angus Gratton
6990a7cd54 Merge branch 'master' into feature/esp32s2beta_update 2019-08-19 15:03:43 +10:00
Renz Christian Bagaporo
ded0ac352d cmake: set build dir for mconf-idf
Fixes an issue where if idf_build_process is called in a CMake
subdirectory, menuconfig looks for the mconf-idf binary in the wrong
place (in the subdirectory build dir instead of root binary dir).
2019-08-16 17:46:50 +08:00
Ivan Grokhotkov
74fe282b73 cmake: check mconf-idf binary version
Print a warning if an outdated version of mconf-idf is found in
the PATH.
2019-08-15 17:25:26 +02:00
Ivan Grokhotkov
0a74227cfa bump version to 4.1 2019-08-13 10:09:52 +02: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
Angus Gratton
b0ef3cdc9f Merge branch 'bugfix/check_include_dirs' into 'master'
CMake: Check if component include dirs are directories

See merge request espressif/esp-idf!5701
2019-08-12 12:45:11 +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
Angus Gratton
24d26fccde Merge branch 'master' into feature/esp32s2beta_update 2019-08-08 13:44:24 +10:00
Renz Christian Bagaporo
4df98b5489 cmake: treat unregistered components as unresolved 2019-08-06 11:14:44 +08:00
Roland Dobai
bd21960955 tools: Support sdkconfig.rename files from outside IDF in confgen.py 2019-07-16 20:18:19 +02:00
Angus Gratton
56afdedf7c Merge branch 'bugfix/do_not_require_new_target_link_library_signature' into 'master'
CMake: Do not force use of new target_link_libraries signature

See merge request espressif/esp-idf!5471
2019-07-16 13:36:35 +08:00
Renz Christian Bagaporo
d3e814fe19 cmake: set COMPONENT_DIR in early expansion
Gives same treatment to COMPONENT_DIR as COMPONENT_PATH in
https://gitlab.espressif.cn:6688/espressif/esp-idf/merge_requests/4557

Closes https://github.com/espressif/esp-idf/issues/3771
2019-07-12 16:22:18 +08:00
Angus Gratton
6410f7a259 cmake: Fix some bugs building mconf-idf from scratch
- Makefile didn't quite work with out-of-tree build unless there was already an in-tree build done.
- CMake needs to delete some of the in-tree build artifacts or they're used instead of the correct
 files.
2019-07-09 20:02:44 +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
Angus Gratton
2639d5b6c3 cmake: Fix some bugs building mconf-idf from scratch
- Makefile didn't quite work with out-of-tree build unless there was already an in-tree build done.
- CMake needs to delete some of the in-tree build artifacts or they're used instead of the correct
 files.
2019-07-03 18:40:55 +10:00
Angus Gratton
9ef37270f6 Merge branch 'bugfix/make_ccache_opt_in' into 'master'
cmake: make use of ccache opt-in

See merge request idf/esp-idf!5368
2019-07-01 15:48:31 +08:00
Angus Gratton
f1e07663c4 cmake: Use environment variables file for all config binaries 2019-07-01 15:54:27 +10:00
Angus Gratton
26db058339 cmake kconfig: Pass environment variables to confgen.py via a file
Works around "command line too long" errors when using Windows
and CMake < 3.11

Closes IDF-711
2019-07-01 15:54:10 +10:00
Renz Christian Bagaporo
72a5762525 cmake: make use of ccache opt-in 2019-06-29 00:22:57 +00:00
Angus Gratton
265d7dc4e5 Merge branch 'bugfix/fix_secure_boot_support' into 'master'
Fixes to secure boot support in CMake

See merge request idf/esp-idf!4977
2019-06-28 15:38:59 +08:00
Angus Gratton
d9ca915fa4 Merge branch 'bugfix/cmake_project_vars_not_set_by_redefinition' into 'master'
cmake: set variables set by project call

See merge request idf/esp-idf!5187
2019-06-28 15:31:10 +08:00
Renz Christian Bagaporo
e4a4063e4c cmake: fix issue with fail at build time
Fix issue that next build retry does not succeed once the requirement is
satisfied.
2019-06-28 10:54:21 +08:00
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
7edef74347 cmake: set variables set by project call
ESP-IDF overrides project() definition for user convenience. This
redefinition lacks setting the variables documented at
the project command documentation
https://cmake.org/cmake/help/v3.5/command/project.html in the parent
scope.

This commit sets those variables.

Closes https://github.com/espressif/esp-idf/issues/3611.
2019-06-12 11:01:59 +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
Angus Gratton
a37ad24137 cmake: Always pass IDF_TARGET into mconf, avoid error about uninitialized environment variable 2019-06-11 13:07:37 +08:00
Ivan Grokhotkov
7dcc5f4d15 idf.py: pass correct toolchain prefix to the monitor 2019-06-11 13:07:37 +08:00
suda-morris
84b2f9f14d build and link hello-world for esp32s2beta 2019-06-11 13:07:37 +08:00
suda-morris
61ce868396 make bootloader_support support esp32s2beta 2019-06-11 13:07:02 +08:00
suda-morris
c926f7515e add toolchain setting for esp32s2 2019-06-11 13:06:32 +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
Renz Christian Bagaporo
d0b2d5ec95 cmake: Fix for Python files executed directly, not via PYTHON variable
A problem if the Python interpreter used for idf.py (or set via PYTHON
variable) didn't match
"/usr/bin/env python" (or the associated executable for .py files, on
Windows).

Closes https://github.com/espressif/esp-idf/issues/3160
Possibly also fix for https://github.com/espressif/esp-idf/issues/2936

Adds build system test to catch any future direct execution of Python in
the standard build process.
2019-03-12 13:31:44 +08:00
morris
9297b07a97 cmake: add spaces2list for COMPONENT_SRCS
According to ESP-IDF Cmake build system document, COMPONENT_SRCS should support using spaces to sperate source files.

Closes https://github.com/espressif/esp-idf/issues/3130
2019-03-06 20:55:38 +08:00
Angus Gratton
da390618c2 cmake: Fix psram workaround compiler flag application
Previously, this compiler flag was not being applied
regardless of CONFIG_SPIRAM_CACHE_WORKAROUND setting.

Explanation: add_compile_options() only applies to
source files added after the function is run, or in
subdirectories added after the function is run. In
this case, no new source files were being added after
this function was run.
2019-02-26 04:07:51 +00:00
Renz Christian Bagaporo
24284b3afd ldgen: remove resolution of template includes 2019-02-22 08:25:56 +08:00
Renz Christian Bagaporo
acd0be8239 cmake,make: add dependencies on template included scripts 2019-02-14 18:58:48 +08:00
KonstantinKondrashov
187f9945bc tools: Add --always option to git describe for Cmake
Fixed differences in getting of the project version for Make and Cmake.
2019-01-24 12:06:55 +08:00
Angus Gratton
58acac883d Merge branch 'bugfix/regenerate_sdkconfig_fails' into 'master'
Fix issues with regenerating sdkconfig on modification

Closes #58

See merge request idf/esp-idf!4115
2019-01-24 11:56:52 +08:00
Sagar Bijwe
05220d9cda CMake: Make IDF_PATH available to Kconfiglib when not explicitly set.
When IDF_PATH is not set by the user, cmake infers the same through
other means and sets it as an environment variable. However, some
sub-invocation of cmake may not see this variable as it is not set
in the parent. This change adds a custom command for exporting IDF_PATH
just before invoking ldgen so that IDF_PATH can be used in Kconfig
without any errors.
2019-01-21 17:02:31 +05:30
Renz Christian Bagaporo
08f472ad1e cmake: only generate sdkconfig on top level project 2019-01-16 08:16:09 +08:00
Angus Gratton
6578673ed4 Merge branch 'feature/esp_platform_cmake_pr2601' into 'master'
cmake: Add ESP_PLATFORM in CMake build (PR 2601)

See merge request idf/esp-idf!3823
2019-01-02 14:03:52 +08:00
Renz Christian Bagaporo
50fa7c5a89 cmake: fix unable to start confserver on windows 2018-12-23 19:52:58 +08:00