Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmake: default to linking 'app' with the interface library 'FS' #8533

Conversation

SebastianBoe
Copy link
Collaborator

This patch removes the need for application build script code to
explicitly link 'app' with a filesystem implementation.

It does this by introducing a zephyr interface library called 'FS'
that contains the usage requirements for linking with the filesystem
library subsys__fs and using Kconfig to default to linking the 'app'
library with this interface library.

This patch removes the need for application build script code to
explicitly link 'app' with a filesystem implementation.

It does this by introducing a zephyr interface library called 'FS'
that contains the usage requirements for linking with the filesystem
library subsys__fs and using Kconfig to default to linking the 'app'
library with this interface library.

Signed-off-by: Sebastian Bøe <[email protected]>
It is not necessary to link 'app' with ELMFAT or NFFS because their
usage requirements are covered by the 'APP_LINK_WITH_MBEDTLS'
mechanism that automatically links 'app' with the interface library
FS.

This patch removes the redundant target_link_libraries invocations.

Signed-off-by: Sebastian Bøe <[email protected]>
@@ -33,6 +33,14 @@ config SYS_LOG_FS_LEVEL

if FILE_SYSTEM

config APP_LINK_WITH_FS
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not see this being used

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@codecov-io
Copy link

codecov-io commented Jun 22, 2018

Codecov Report

Merging #8533 into master will decrease coverage by 0.65%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #8533      +/-   ##
==========================================
- Coverage    63.8%   63.14%   -0.66%     
==========================================
  Files         426      447      +21     
  Lines       40890    47803    +6913     
  Branches     6921     8802    +1881     
==========================================
+ Hits        26089    30185    +4096     
- Misses      11666    14006    +2340     
- Partials     3135     3612     +477
Impacted Files Coverage Δ
boards/posix/native_posix/timer_model.c 77.07% <0%> (-18.1%) ⬇️
arch/posix/core/posix_core.c 91.91% <0%> (-7.08%) ⬇️
arch/posix/soc/inf_clock/soc.c 97.91% <0%> (-2.09%) ⬇️
boards/posix/native_posix/main.c 90% <0%> (-0.91%) ⬇️
boards/posix/native_posix/cmdline.c 15.38% <0%> (-0.84%) ⬇️
include/net/net_context.h 93.25% <0%> (-0.36%) ⬇️
subsys/net/ip/l2/ethernet/ethernet.c 51.74% <0%> (-0.06%) ⬇️
...nel/sched/schedule_api/src/test_slice_scheduling.c 96.96% <0%> (ø) ⬆️
kernel/include/kernel_structs.h 100% <0%> (ø) ⬆️
include/net/net_pkt.h 84.61% <0%> (ø) ⬆️
... and 72 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 13eba39...588f77a. Read the comment docs.

zephyr_library_link_libraries(FS)

target_link_libraries_ifdef(CONFIG_FAT_FILESYSTEM_ELM FS INTERFACE ELMFAT)
target_link_libraries_ifdef(CONFIG_FILE_SYSTEM_NFFS FS INTERFACE NFFS)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't these two lines be in the CMakeList.txt of NFFS and ELMFAT respectively?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe, but they can't because FS can only be modified in the CMakeLists.txt directory that created it.

@ifillonneau
Copy link
Contributor

in subsys/settings/src/CMakeLists.txt, is it necessary to keep following line:
zephyr_include_directories($ENV{ZEPHYR_BASE}/ext/fs/nffs/include)

The settings subsystem has been adding nffs's include dir to the
global set of paths. Presumably because app's will need acces. But
this is no longer necessary as we default to linking 'app' with FS,
which again has the NFFS include paths.

Signed-off-by: Sebastian Bøe <[email protected]>
@SebastianBoe
Copy link
Collaborator Author

in subsys/settings/src/CMakeLists.txt, is it necessary to keep following line:
zephyr_include_directories($ENV{ZEPHYR_BASE}/ext/fs/nffs/include)

It is not. Fixed.

@nashif
Copy link
Member

nashif commented Jul 25, 2018

recheck

@nashif nashif merged commit c68ab81 into zephyrproject-rtos:master Jul 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants