Commit graph

8 commits

Author SHA1 Message Date
Sebastian Bøe
8b6d3ad69b cmake: Improve error messages for detecting libgcc
Use two different variables for the distinct values LIBGCC_FILE_NAME
and LIBGCC_DIR and assert that each of them exists.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-01-12 08:37:41 -05:00
Sebastian Bøe
15ca6da4c8 cmake: Re-introduce support for CROSS_COMPILE
CROSS_COMPILE is a KBuild feature that was dropped during the CMake
migration. It is now re-introduced. Documentation for it is still
lacking, but at least it now behaves as expected.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-01-12 08:37:41 -05:00
Carles Cufi
07a64f19ed cmake: Use find_program() to locate the toolchain
Instead of hard-coding the path use find_program(), since that allows
CMake to sort out platform-specific details such as .exe extensions on
Windows.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2018-01-11 16:05:05 -05:00
Carles Cufi
7d764b35f3 cmake: Use path-corrected version of ZEPHYR_BASE
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>
2018-01-11 14:59:03 -05:00
Sebastian Bøe
11c020ebf7 cmake: Support installing toolchains in "Program Files"
Support installing toolchains in "Program Files", or more generally,
in paths that contain whitespace. This is a common bug for new users
to discover.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2017-12-12 11:53:45 -06:00
Sebastian Bøe
c87d262295 size_report: Use the CMake-discovered toolchain instead of ENV vars
size_report was using the environment variables NM and OBJDUMP to find
it's toolchain dependencies. It is not clear how well this will work
on different platforms; OSX, Windows. So we now pass the paths of
these dependencies from the build system to the script.

PS: This ensures that size_report uses the cross-compiler's GNU bin
tool instead of the host GNU bin tools. This is presumably beneficial
as it has been required for other GNU bin tools like GDB.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2017-12-12 11:42:05 -05:00
Sebastian Bøe
4449bef955 cmake: Pass GDB env var to flasher script
Signed-off-by: Sebastian Boe <sebastian.boe@nordicsemi.no>
2017-11-08 20:00:22 -05:00
Sebastian Bøe
12f8f76165 Introduce cmake-based rewrite of KBuild
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>
2017-11-08 20:00:22 -05:00