Loadable extensions need access to Zephyr (and Zephyr application)
includes and some CFLAGS to be properly built. This patch adds a new
target, `llext-edk`, which generates a tar file with those includes and
flags that can be loaded from cmake and make files.
A Zephyr application willing to expose some API to extensions it loads
only need to add the include directories describing such APIs to the
Zephyr ones via zephyr_include_directories() CMake call.
A new Kconfig option, CONFIG_LLEXT_EDK_NAME allows one to control some
aspects of the generated file, which enables some customization - think
of an application called ACME, willing to have a ACME_EXTENSION_KIT or
something.
All EDK Kconfig options are behind CONFIG_LLEXT_EDK, which doesn't
depend on LLEXT directly - so that EDK features can be leveraged by
downstream variations of loadable extensions.
Also, each arch may need different compiler flags for extensions: those
are handled by the `LLEXT_CFLAGS` cmake flag. An example is set for GCC
ARM.
Finally, EDK throughout this patch means Extension Development Kit,
which is a bad name, but at least doesn't conflict with SDK.
Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
Remove the boards and shields lists from the 'usage' target output.
That might have been readable at some point long ago in Zephyr's
history, when only a few boards were available, but right now it's
obscuring the high level targets we really want 'usage' to print.
Instead, add 'boards' and 'shields' targets which the user can run to
get those lists, and reference them from the 'usage' output. This
makes 'usage' squintable again. We use the new list_boards.py script
from the 'boards' target.
Reference the 'help' target from 'usage' as well, and drop the
recommendation that people run '--target help' from the 'west build
--help' output for the 'west build --target' option. The canonical
place to look is 'usage' now.
Use the new list_boards.py code from 'west boards' as well, which
allows us to add the board's directory as a format string key, in
addition to its name and architecture.
Keep west-completion.bash up to date. While doing that, I noticed that
a bunch of references to this file refer to a stale location, so fix
those too.
Finally, the 'usage' output is what we print for a failed board or
shield lookup, so that needs to be updated also. Handle that by
invoking boards.cmake and a new shields.cmake in CMake script mode to
print the relevant output.
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
Currently, when usage.cmake is run, the shield list is in construction
order, making it difficult to locate the shield of interest. This sorts
the list upon display and also makes the display indent consistent.
Signed-off-by: Aleksandr Koltsoff <czr@iki.fi>
Fixed usage build target.
Previously, `ninja usage` would print:
Build flags:
ninja VERBOSE=1 [targets] verbose build
This is clearly wrong, as VERBOSE=1 is for make targets.
To support both ninja based builds and make based build systems, the
CMAKE_MAKE_PROGRAM is now exported from the calling CMake / build
instance, and the verbose flag is set depending on whether ninja or
make is used as build program.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
In order to make board listing reusable by external tools, split it out
from the usage helper script into a new boards.cmake that can also be
called directly with cmake -P.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Update the files which contain no license information with the
'Apache-2.0' SPDX license identifier. Many source files in the tree are
missing licensing information, which makes it harder for compliance
tools to determine the correct license.
By default all files without license information are under the default
license of Zephyr, which is Apache version 2.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
We had been search for <BOARD>.yaml, however its possible that doesn't
match anything and we actually use <BOARD>_defconfig in
boilerplate.cmake. So search for *_defconfig instead of *.yaml to
generate the <BOARD> list.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
PR #9522 series ending with commit c2c9265b7d ("tests: cmsis: Disable
two cmsis portability tests on x86_64") added -mx32 support for the
x86_64 ARCH and qemu_x86_64. While this was implemented in
"compiler/gcc/target.cmake" as fall back from cross-compilation to the
host compiler, it worked with a direct ZEPHYR_TOOLCHAIN_VARIANT=host
too.
Later, -lgcc was added to "compiler/host-gcc/target.cmake" by PR #12674
to fix the -m32 x86 build. This broke the x86_64 build when using
ZEPHYR_TOOLCHAIN_VARIANT=host because even "multilib" packages usually
don't feature the -mx32 version of libgcc.
Fix this by excluding -lgcc in compiler/host-gcc/target.cmake just like
compiler/gcc/target.cmake always did for x86_64.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Rather than specifying SHIELD via Kconfig, we move it to being
specified via the command line, similar to board.
So we can do:
-DSHIELD=x_nucleo_iks01a1
or, for multiple shields:
-DSHIELD="x_nucleo_iks01a1 frdm_kw41z"
Following cmake change, update x_nucleo_iks01a1 sample in order
not to enable CONFIG option anymore but set SHIELD cmake option.
Last, update documentation to reflect this change.
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Cosmetics, no functional change expected.
Fixed leading space alignment.
Replaced tabs with spaces.
Emulation error message output is now aligned.
To locate tabs in cmake, the following bash is useful:
grep -PRil "\t" * | grep -i cmake | grep -v ^sanity
Signed-off-by: Mark Ruvald Pedersen <mped@oticon.com>
It is very inconvenient to maintain an application that both runs on a
Zephyr board and an out-of-tree board.
It forces one to write build scripts like this in the app:
if(BOARD STREQUAL my_out_of_tree_board)
set(BOARD_ROOT some/out/of/tree/board/path)
endif()
To avoid this we change the semantics of BOARD_ROOT. Instead of it
being a path to the board root it is now a prioritized list of board
root directories. Zephyr will append ZEPHYR_BASE to BOARD_ROOT.
This ensures that Zephyr boards can be used when the out-of-tree board
directory can not supply the requested board.
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
They will no longer be available once the C Kconfig implementation is
removed.
oldconfig and allno/yesconfig implementations are available for
kconfiglib and could be added later if needed. savedefconfig (minimal
configuration generation) is available from the menuconfig.py
configuration interface.
cmake/usage/kconfig-usage.cmake becomes kinda pointless after this
change, so merge it into cmake/usage/usage.cmake.
Remove the kconfig_target, COMMAND_FOR_*, and COMMAND_RUNS_ON_WIN_*
CMake variables, as there's just the 'menuconfig' target now.
Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
Fixes issue #7184.
Use $BOARD_ROOT to find correct list of supported boards.
This is needed since the user can set this variable to any directory.
Pass $BOARD_ROOT to usage.cmake where it is called.
Signed-off-by: Håkon Øye Amundsen <haakon.amundsen@nordicsemi.no>
$ENV{ZEPHYR_BASE} was recently search-replaced with ${ZEPHYR_BASE},
but some CMake code, like usage.cmake, is run by a seperate CMake
build system that does not have access to the CMake variable
ZEPHYR_BASE.
This patch reverts the usage of ${ZEPHYR_BASE} back to use
$ENV{ZEPHYR_BASE} in usage.cmake.
This has been proven to work on both Windows and Linux.
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
Instead of accessing the environment variable ZEPHYR_BASE every time we
require accessing the source code root, use an intermediate variable
that has OS path separators correctly set to '/' to avoid issues on
Windows.
Note: This removes the ZEPHYR_SOURCE_DIR CMake variable. External
applications using that will need to change to use the new ZEPHYR_BASE
variable.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Added posix to the list of arch's with boards. Usage will now show
native_posix as one of the available boards.
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
Introducing CMake is an important step in a larger effort to make
Zephyr easy to use for application developers working on different
platforms with different development environment needs.
Simplified, this change retains Kconfig as-is, and replaces all
Makefiles with CMakeLists.txt. The DSL-like Make language that KBuild
offers is replaced by a set of CMake extentions. These extentions have
either provided simple one-to-one translations of KBuild features or
introduced new concepts that replace KBuild concepts.
This is a breaking change for existing test infrastructure and build
scripts that are maintained out-of-tree. But for FW itself, no porting
should be necessary.
For users that just want to continue their work with minimal
disruption the following should suffice:
Install CMake 3.8.2+
Port any out-of-tree Makefiles to CMake.
Learn the absolute minimum about the new command line interface:
$ cd samples/hello_world
$ mkdir build && cd build
$ cmake -DBOARD=nrf52_pca10040 ..
$ cd build
$ make
PR: zephyrproject-rtos#4692
docs: http://docs.zephyrproject.org/getting_started/getting_started.html
Signed-off-by: Sebastian Boe <sebastian.boe@nordicsemi.no>