Using find_package to locate Zephyr.
Old behavior was to use $ENV{ZEPHYR_BASE} for inclusion of boiler plate
code.
Whenever an automatic run of CMake happend by the build system / IDE
then it was required that ZEPHYR_BASE was defined.
Using ZEPHYR_BASE only to locate the Zephyr package allows CMake to
cache the base variable and thus allowing subsequent invocation even
if ZEPHYR_BASE is not set in the environment.
It also removes the risk of strange build results if a user switchs
between different Zephyr based project folders and forgetting to reset
ZEPHYR_BASE before running ninja / make.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
There is absolutely no other test in the entire codebase that hardcodes
this setting. I found no comment or any other explanation why this test
should be unique. So it really looks like just a glitch introduced when
this test was added by PR #17618 / commit f1afb4c24d.
This was discovered in three different ways:
- COVERAGE=y adds the absolute and non-deterministic source path in
.rodata sections
- it adds .gnco files in the build directory
- it makes (some) tests run 10 times slower:
qemu_x86_64 lib/fdtable/libraries.os.fdtable PASSED (qemu 2.086s)
qemu_x86_long lib/fdtable/libraries.os.fdtable PASSED (qemu 2.316s)
qemu_xtensa lib/fdtable/libraries.os.fdtable PASSED (qemu 2.033s)
mps2_an385 lib/fdtable/libraries.os.fdtable PASSED (qemu *31.286s*)
qemu_x86 lib/fdtable/libraries.os.fdtable PASSED (qemu *31.862s*)
Signed-off-by: Marc Herbert <marc.herbert@intel.com>