-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
cmake: default to linking 'app' with the interface library 'FS' #8533
Conversation
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 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codecov Report
@@ 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
Continue to review full report at Codecov.
|
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) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
in subsys/settings/src/CMakeLists.txt, is it necessary to keep following line: |
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]>
It is not. Fixed. |
recheck |
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.