Commit graph

598 commits

Author SHA1 Message Date
Martí Bolívar 9c92baa73f devicetree: use edt.pickle more
Consolidate creation of edtlib.EDT objects from a build directory's
devicetree into one place by loading it from build/zephyr/edt.pickle
everywhere. A previous commit creates edt.pickle from gen_defines.py.

In addition to probably speeding things up slightly by not reparsing
the devicetree, the main benefit of this approach is creating a single
point of truth for the bindings directories and warnings
configuration, meaning we don't have to worry about them getting out
of sync while being passed around between devicetree creation and
usage time.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-07-23 09:19:45 -05:00
Daniel Leung ba5f627815 scripts: size_report: rework to use pyelftools...
...instead of GNU binutils to extract DWARF information.
This is now a bit more portable across OS and toolchain.
One bouns is that this nows with on qemu_x86_64.

A few differences are:
() z_mrsh_* which are aliases to handler_no_syscalls() are now
   dropped as they are mapped to the same address, so that they
   are not counted multiple times.
() Static functions and variables with same names should now be
   attributed to the correct source files instead of being
   accumulated into the same symbol of one file (e.g. multiple
   thread_entry() in kernel tests).
() The totals for ROM and RAM are calculated from the
   corresponding sections. Previous script includes the debug
   sections as total ROM size which is not entirely correct.

Fixes #22996

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-07-16 12:14:22 +02:00
Martí Bolívar b08309e992 cmake: fix kconfig targets
Commit 269f350487 introduced a new
mechanism for loading the edtlib.EDT representation of the devicetree
from kconfigfunctions.py.

While this works for running kconfig.py from kconfig.cmake using
execute_process(), it doesn't work when kconfigfunctions.py is loaded
by the menuconfig target or any other Kconfig targets that use
add_custom_target().

The reason why is that these targets' environments do not have the
location of the EDT pickle file available. This is unlike kconfig.py,
which executes using the same environment as cmake itself, where
edt.pickle's location is already available in the environment.

Fix that by adding EDT_PICKLE to the environment for menuconfig and
friends.

Reported-by: Simon Guinot <simon.guinot@seagate.com>
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-07-10 11:26:11 +02:00
Martí Bolívar a043d48c54 cmake: fix the build on windows
Commit ef3c5e5516 changed the way
WEST_TOPDIR is initialized from calling 'west topdir' as a subprocess
to using the west API.

However, WEST_TOPDIR is a cmake variable and must be a cmake-style
path, with forward slashes. While 'west topdir' as a command does
output a forward slash separated path (basically in order to make the
zephyr build system work), west_topdir() as an API returns the path in
the host environment path style, which on Windows uses backslashes.

This turns out to be the ultimate cause of the following build error:

CMake Error at C:/.../CheckCCompilerFlag.cmake:41 (set):
  Syntax error in cmake code when parsing string
    -fmacro-prefix-map=C:\Users\Marti\zp=WEST_TOPDIR

Fix it by converting to POSIX style in Python. We could have
potentially also done this using file(TO_CMAKE_PATH "${WEST_TOPDIR}"
...), but I'm intentionally repeating the old way of doing things
since it was known to work.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-07-09 18:13:44 -04:00
Henrik Brix Andersen b36aea82ce build: reports: add pahole target
Poke-a-hole (pahole) is an object-file analysis tool to find the size of
the data structures, and the holes caused due to aligning the data
elements to the word-size of the CPU by the compiler.

http://git.kernel.org/cgit/devel/pahole/pahole.git

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2020-07-09 06:24:00 -04:00
Torsten Rasmussen ef3c5e5516 cmake: west: invoke west using same python as rest of build system
When running CMake, then Python3 will be used.
This is detected through FindPython3, with a preference for using the
python or python3 in path, if any of those matches the required Python
minimal version in Zephyr.

It is also possible for users to specify a different Python, as example
by using:
`cmake -DPYTHON_PREFER=/usr/bin/python3.x`

However, when running `west` as native command, then west will be
invoked on linux based on the python defined in:
`west` launcher, which could be: `#!/usr/bin/python3.y`

Thus there could be mismatch in Pythons used for `west` and the python
used for other scripts.

This is even worse on windows, where a user might experience:
```
>.\opt\bin\Scripts\west.exe --version
Traceback (most recent call last):
  File "C:\Python37\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  ...
  File "C:\Python37\lib\socket.py", line 49, in <module>
    import _socket
ImportError: Module use of python38.dll conflicts with this version of
Python.
```

when testing out a newer Python, but the python in path is still a 3.7.

By importing `west` into zephyr_module.py and by using, as example
`python -c "from west.util import west_topdir; print(topdir())"`
we ensure the same python is used in all python scripts.

Also it allows the user to control the python to use for west.

It also ensures that the west version being tested, is also the version
being used, where old code would test the version imported by python,
but using the west in path (which could be a different version)

If the west version installed in the current Python, and west invocation
is using a different Python interpreter, then an additional help text
is printed, to easier assist users with debugging.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-07-08 23:23:04 -04:00
Martí Bolívar 148542c080 build: remove dead stores to environment
Now that kconfigfunctions.py is loading the EDT object from a pickle
file, I can't find any other reads of the environment variables it was
previously using to do that.

(The CMake variables with the same names are read in different places;
I'm specifically talking about environment variables here.)

Remove the dead stores.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-07-08 14:02:44 -05:00
Martí Bolívar 269f350487 kconfig: load edt from edt.pickle
This saves time and avoids the need to pass additional state around in
the environment to recreate the edt exactly.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-07-08 14:02:44 -05:00
Martí Bolívar 533f451e7e dts: marshal the EDT object for later use
We need to save and restore the devicetree data to generate optimized
dependency information later on in the build, in particular during the
final application link.

Make this happen by pickling the EDT object in BUILD_DIR/edt.pickle.

The existence of this file is an implementation detail, so do not add
it to the documentation.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-07-08 14:02:44 -05:00
Torsten Rasmussen 13642fe013 cmake: west: west flash dependencies in sync with CMake flash target
This commit creates a list of a phony targets for each runner, that is:
`west_flash_depends`, `west_debug_depends`, and so on.
Those targets has identical dependencies as CMake runner target.
flash, debug, debugserver, attach targets.

As example `ninja flash` correctly ensures dependencies are taken into
consideration before calling `west flash`.

Unfortunately, calling `west flash` directly would not re-run the flash
dependencies, cause `west flash` would only build the default CMake
target.

Now, `west flash` calls the phony `west_flash_depends` target, ensuring
all deps are up-to-date before flashing (unless --skip-rebuild is given)

The same is true for the other mentioned runners.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-07-01 07:58:10 -04:00
Torsten Rasmussen d38da9d386 cmake: runners dependencies cleanup
This commit renames `FLASH_DEPS` to `RUNNERS_DEPS`.
The current name `FLASH_DEPS` is misleading in the sense that this
depency is added to all runner targets, flash, debug, debugserver,
attach, and not only the flash runners.

Therefore this is now named `RUNNERS_DEPS` instead.

Similar, zephyr_property_target now contains the property
FLASH_DEPENDENCIES, DEBUG_DEPENDENCIES, and so on, so that additional
dependencies can be added for each runner.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-07-01 07:58:10 -04:00
Andrew Boie a9670ab5cf boards: centralize QEMU icount management
Instead of endlessly repeating the same command line args,
centralize this and tune the shift value on a per-board
basis.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-06-24 20:28:36 -04:00
Torsten Rasmussen b69a3d8824 cmake: Allow projects to add additional dependencies to flash target
Using zephyr_target_property::FLASH_DEPENDENCIES to fetch additional
dependencies to the flash operation.

The properties are fetched using a generator expression which allows
users of Zephyr to add dependencies both before and after the flash
target has been defined.

Dependencies can be other targets that must be build / custom commands
which must be executed before the flash operation. Or it can be targets
which must be built.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Signed-off-by: Haakon Oeye Amundsen <haakon.amundsen@nordicsemi.no>
2020-06-22 12:44:39 +02:00
Torsten Rasmussen 8e8c6cd92b cmake: improved DTC detection handling
Fixes: #26096

In some cases DTC may be installed, but in a non-working state.
In such cases, CMake will abort processing with an cryptic error.

This commit now handles dtc version errors and print a warning., and
CMake processing continues.

dtc is an optional component and failures should not break CMake run.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-06-12 17:10:36 +02:00
Torsten Rasmussen e1c1d1daca cmake: make find_package(ZephyrUnittest...) REQUIRED
This commit is a followup to PR #25808 which updates the tests to
ensure the REQUIRED keyword is also used for the ZephyrUnitest package.

This provides a better error message when building with CMake and
forgetting ZEPHYR_BASE or not registering Zephyr in the CMake package
registry.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-06-12 11:10:23 +02:00
Pete Johanson 9b27cfd8c4 cmake: Fixes for shields in multiple roots
* Reset SHIELD_LIST on each root loop, to avoid matching
  on shields from the previous iteration of the loop.

Signed-off-by: Pete Johanson <peter@peterjohanson.com>
2020-06-09 15:24:48 +02:00
Reto Schneider 0b4b3ae4dd cmake, samples, tests: Use semi-accurate project names
When using an IDE (e.g. Eclipse, Qt Creator), the project name gets
displayed. This greatly simplifies the navigation between projects when
having many of them open at the same time. Naming multiple projects
"NONE" defeats this functionality.

This patch tries to use sensible project names while not duplicating
too much of what is already represented in the path. This is done by
using the name of the directory the relevant CMakeLists.txt file is
stored in. To ensure unique project names, small, manual adjustments
have been done.

See also 7eabab2f5d ("samples, tests: Use semi-accurate project names")

Signed-off-by: Reto Schneider <reto.schneider@husqvarnagroup.com>
2020-06-09 08:18:29 -04:00
Torsten Rasmussen 8d3e822e79 cmake: resolved list issue when parsing shield list
Fixes: #25656

The commit a8e90cbfb3 improved handling of
shields. Unfortunately it pops items from the SHIELD variable which
works well if SHIELD is a CMake ;-separated list, but if the list is
a space separated list, as may be provided by the user, then this
principle fails as reported in #25656.

This is fixed by keeping improved behaviour, while popping from an
alternative SHIELD-NOTFOUND list instead.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-05-29 13:11:17 +02:00
Marc Herbert 3a04536487 doc,cmake: make find_package(Zephyr...) REQUIRED
This provides a better error message when building with CMake and
forgetting ZEPHYR_BASE or not registering Zephyr in the CMake package
registry. See parent commit for more details (split from parent for
better readability).

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-05-29 10:47:25 +02:00
Torsten Rasmussen 9adcabe38d cmake: introduction of ZephyrBuildConfiguration package
The ZephyrBuildConfiguration package allow downstream users to control
the Zephyr build system using a cmake package.

A Zephyr Build Configuration package allows for setting of additional
DTS_ROOT, BOARD_ROOT, and similar variables without having to patch
Zephyr repo, but it also allows for inclusion of additional boilerplate
code for more advanced use cases.

The repository or folder containing the Zephyr Build Configuration
package must be on toplevel in the Zephyr workspace.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-05-27 17:58:50 +02:00
Martí Bolívar 3ea8293ef0 Revert "cmake: introduction of ZephyrExtension package"
This reverts commit ac898bc49e.

This commit was merged by mistake, but in a way that was against the
decision of the TSC on May 20, 2020, which was to wait a week to let
people digest befor merging.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-05-21 00:33:06 +02:00
Torsten Rasmussen ac898bc49e cmake: introduction of ZephyrExtension package
The ZephyrExtension package allow downstream users to extend the current
Zephyr package.
A ZephyrExtension package allows for setting of additional DTS_ROOT,
BOARD_ROOT, and similar variables without having to patch Zephyr repo.

The repository or folder containing the ZephyrExtension package must be
on toplevel in the Zephyr workspace.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-05-20 19:27:15 +02:00
Jukka Rissanen c6a19a2046 cmake: qemu: Allow user to add parameters to Ethernet TAP
User can now add extra Ethernet TAP parameters when starting QEMU.
This is useful if we want to set for example the MAC address
of the network interface.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-05-20 15:36:39 +02:00
Stephanos Ioannidis fb35591f1e cmake: Correct PATHS usage
`PATH` is not a valid option for `find_program`; correct all such
usages to `PATHS`.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-05-20 12:10:20 +02:00
Torsten Rasmussen c519f6ee87 cmake: fix usage of Zephyr SDK tools with 3rd party toolchains
Fixes: #25183

This commit fixes the issue where combining a 3rd party toolchain with
Zephyr SDK Tools would result in the Zephyr SDK overruling the toolchain
in use.

This is fixed by keeping track of current toolchain variant.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-05-19 17:12:11 +02:00
Torsten Rasmussen 32f351a7a2 cmake: raise a fatal error when C compiler is not found
This commit introduces an early error in case a valid C compiler is not
found in the system.

This will help to early identify misconfigured systems with the error:
  C compiler <compiler> not found - Please check your toolchain
  installation

instead of an obscure error, such as:
No such file or directory: LIBGCC_FILE_NAME: ''

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-05-19 14:45:36 +02:00
Torsten Rasmussen 3a2f8349fd cmake: find python3 on windows when multiarch are installed
Fixes: #24692

This commit fixes an issue where FindPython3 could wrongly select the
Python version not in environment path.

If user installed both 32 and 64 bit versions of the same Python, for
example 3.7.x, the current search would only specify that 3.7 is needed.

In some cases, FindPython3 could select the 32 bit version, even if the
64 bit version is the one on %PATH%.

This is fixed, by setting Python3_ROOT_DIR to point to the tested Python
in %PATH%.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-05-13 12:13:36 +02:00
Torsten Rasmussen b557bd90a6 cmake: Zephyr sdk backward compatibility with 0.11.1 and 0.11.2
This commit introduces backward compatibility with Zephyr SDK 0.11.1
and 0.11.2 so that users having one of those versions installed can
continue to use that version.

This remove the need to force users to update their SDK.

This is kept in independent commit to ensure it can easily be reverted
when minimum required Zephyr SDK is bumped to version 0.12.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-05-08 17:15:55 +02:00
Torsten Rasmussen 299a154fdd cmake: Zephyr sdk package handling
This commit introduces Zephyr SDK CMake config package.

This removes the need for setting ZEPHYR_SDK_INSTALL_DIR and
ZEPHYR_TOOLCHAIN_VARIANT when using Zephyr SDK in Linux.
It also allows to introduces never SDKs without breaking Zephyr.

For example, with this PR, the current Zephyr SDK is 0.11.1 but when
releasing 0.12 then the current Zephyr will no longer built.
This PR moves the Zephyr SDK CMake related code to the SDK and thus
allowing to use newer SDKs, as long as they are backwards compatible.

It also allows multiple SDK installations, and will automatically select
the version closet to the required version.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-05-08 17:15:55 +02:00
Rohit Gujarathi 35713f2ef6 cmake: Assembly listing containing all sections
Added support for creating an assembly listing containing all sections
like rodata, data and debug sections, not just those expected to
contain instructions.

Signed-off-by: Rohit Gujarathi <gujju.rohit@gmail.com>
2020-05-08 09:03:18 -04:00
Bilal Wasim 54550c04eb net: qemu: Adding support for User Networking
Added support for Qemu User Networking and tested with
qemu_x86 model. The support is kept simple assuming that
the TAP interface will always be preferred for more
sophisticated / practical use cases.

QEMU User Networking is implemented using "slirp", which
provides a full TCP/IP stack within QEMU and uses that
stack to implement a virtual NAT'd network. As this
support is built into QEMU, it can be used with any model
and requires no admin privileges on the host machine,
unlike TAP.

Added documentation to facilitate the user.

Signed-off-by: Bilal Wasim <bilalwasim676@gmail.com>
2020-05-08 10:47:38 +02:00
Abhishek Shah 2f85c01eaa arch: arm: aarch64: Add Cortex-A72 config
Add Cortex-A72 config in order to set "-mcpu" correctly.

Signed-off-by: Abhishek Shah <abhishek.shah@broadcom.com>
2020-05-08 10:46:23 +02:00
Stephanos Ioannidis 2c00c8e504 cmake: emu: Support QEMU semihosting console emulation
The QEMU '-semihosting' option enables the emulation of the semihosting
mechanism that can be used to interface the Zephyr RTOS to the host
operating system.

In order to support semihosting console output, the QEMU semihosting
feature is enabled and its console is connected to the console backend
chardev.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-05-07 23:33:38 -05:00
Martí Bolívar 14d55bcad8 cmake: host-tools fixes for DTC
1. Fix the regular expression used to parse version numbers. This uses
\. and . to parse literal dots; the second one matches any character.
Just use [.] instead in both cases.

2. Don't error out if the installed dtc is too old. It's optional, so
we should just proceed without it. Print a warning instead, and make
it so dts.cmake won't do anything with the installed dtc.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-05-05 11:05:58 -05:00
Martí Bolívar 53f6aaee2e cmake: host-tools cosmetics
Align the comment styles for each tool.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-05-05 11:05:58 -05:00
Anas Nashif 800c960d0d build: reports: add puncover target
puncover is a footprint and stack analysis tool in python, see

https://github.com/HBehrens/puncover

Add custom target puncover which launches puncover with the right
options.

Launch for example with:

west  build -b frdm_k64f samples/hello_world/ -t puncover

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-05-04 17:33:56 -04:00
Stephanos Ioannidis 0e6ede8929 kconfig: Rename CONFIG_FLOAT to CONFIG_FPU
This commit renames the Kconfig `FLOAT` symbol to `FPU`, since this
symbol only indicates that the hardware Floating Point Unit (FPU) is
used and does not imply and/or indicate the general availability of
toolchain-level floating point support (i.e. this symbol is not
selected when building for an FPU-less platform that supports floating
point operations through the toolchain-provided software floating point
library).

Moreover, given that the symbol that indicates the availability of FPU
is named `CPU_HAS_FPU`, it only makes sense to use "FPU" in the name of
the symbol that enables the FPU.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-04-27 19:03:44 +02:00
Corey Wharton c8f7cd5462 kconfig: Make the CPU_HAS_FPU_DOUBLE_PRECISION option global.
This option now applies to the RISC-V architecture and is no longer
a ARM only configuration.

Signed-off-by: Corey Wharton <coreyw7@fb.com>
2020-04-22 16:39:48 -07:00
Corey Wharton 22c52846a5 riscv: Set mabi and march flags for floating point
Adds handling of the FLOAT_64BIT option when determining the ISA
flags as well as introduces a new Kconfig option to enable/disable
the hard-float calling convention.

Signed-off-by: Corey Wharton <coreyw7@fb.com>
2020-04-22 16:39:48 -07:00
Stephanos Ioannidis 1d9b08aef5 arch: arm: Remove -march compiler flag
The ARM GCC `-march` compiler flag is completely redundant when the
`-mcpu` flag is specified, since the `-mcpu` selects the target ARM
architecture as well as CPU-specific optimisations.

In fact, it is disadvantageous to specify both `-march` and `-mcpu`
flags because the `-march` flag overrides and disables any CPU-specific
optimisations enabled by the `-mcpu` flag.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-04-22 09:43:24 +02:00
Stephanos Ioannidis df4fdeed97 arch: arm: aarch64: Force LP64 ABI
This commit adds the GCC `-mabi=lp64` flag to force the LP64 (64-bit
long and pointer) ABI, which is mandatory for running the Zephyr
AArch64 architecture port.

Note that this flag is, strictly speaking, not necessary in most cases
because the AArch64 GCC defaults to using the LP64 ABI. This flag is
required, however, if compiling Zephyr with a GCC that is configured
with `--with-abi=ilp32`, which makes ILP32 the default ABI.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-04-21 18:26:52 +02:00
Torsten Rasmussen 94de3e9f60 cmake: FindPython3: Adjust python3 program search
Fixes: #24340

Using find_package(Python3 3.6) will select the highest available
python3.

This means that in case user has:
/usr/bin/python  --> python2.7
/usr/bin/python3 --> python3.6
/usr/bin/python3.6
/usr/bin/python3.8

then CMake will choose python 3.8.
This commit changes that behavior, so that in the above scenario, then
Python 3.6 will be preferred.

It also adds the following, python will be preferred over python3, if
both meets the minimum requirement.
For example:
/usr/bin/python  --> python3.6
/usr/bin/python3 --> python3.7
then Python 3.6 is prefered.

It further introduces PYTHON_PREFER variable, which can be used to
further control the behavior.
As example -DPYTHON_PREFER=python3.7 will choose Python 3.7 if
installed.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-04-16 07:43:14 -04:00
Kumar Gala 9aefdaff2e cmake: kconfig: pass EXTRA_DTC_FLAGS to kconfig for EDT init
Pass EXTRA_DTC_FLAGS to kconfig so the EDT object we have in
kconfigfunctions can use that to set warn_reg_unit_address_mismatch
properly.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-16 06:07:24 -05:00
Stephanos Ioannidis a1e838872c arch: arm: Remove extraneous root cmake files
The ARM architecture root directory contains `aarch32.cmake` and
`aarch64.cmake` files whose contents are better suited to go into other
more purpose-specific files.

This commit removes the aforementioned files and moves their contents
to other files following the convention used by other architectures.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-04-15 11:23:56 +02:00
Torsten Rasmussen b5a612d7bc cmake: now using find_package(python3) from CMake to located python3
Fixes: #23922, #24252, #11103

This commit switches to use the find_package(Python3) introduced with
CMake 3.12.

This removes the need for a Zephyr backport of Python detection module.

The search order for Python3 is following CMake search order and can be
controlled through CMake flags (See CMake documentation).

Default it will use the Python version found in PATH.
If multiple Python3 versions are found in PATH, the newest version will
be selected (Can be controlled using `Python3_FIND_STRATEGY`)

Using find_package(Python3) also ensures Python2.7 will never be
selected, issue #11103, which was re-introduced in Zephyr.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-04-13 15:34:35 -04:00
Martí Bolívar ee955c28c4 cmake: re-run if gen_defines changes
Since gen_defines.py is run using execute_process() at CMake time, the
entire build system must be regenerated if it changes. Add the
dependency tracking to make this possible.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-04-13 08:22:46 -05:00
Kumar Gala 86887dafde dts: Remove conf file generation support
The last user of the .conf file format DTS data has been removed.  We
can now remove the generation and associated support for the .conf file.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-12 09:49:16 -05:00
Torsten Rasmussen b6c18dde1f cmake: board alias message when hiding existing board
This commit will print a CMake notice if a user defines a board alias
that is identical to an existing board name.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-04-09 14:38:36 +02:00
Peter A. Bigot c790783c2e cmake: add support for user-defined board aliases
Zephyr board names must be globally unique which requires that they
encode all necessary information to identify a specific target.
Typing in these names can be inconvenient to developers working on
multiple targets within a single workspace.

Extend the cmake infrastructure to read an optional board aliases file
that will map custom aliases to the corresponding canonical Zephyr
board name.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2020-04-09 14:38:36 +02:00
Håkon Øye Amundsen 42f75fc1a4 cmake: fix bug in generated runners.yaml
If a runner had no args, the format of the generated runners.yaml
was invalid due to missing indentation.

This commit fixes this issue by adding the required indentation.

This fixes issue #24215

Signed-off-by: Håkon Øye Amundsen <haakon.amundsen@nordicsemi.no>
2020-04-09 14:04:27 +02:00