Including VFS functionality in a program

In this example, the Client program includes the VFS program functionality for working with the files and network stack (see the figure below).

VFS component libraries in a program.

VFS component libraries in a program

The client.c implementation file is compiled and linked to the vfs::local, vfs::lib_fs, vfs::lib_net, and dnet_drivers::drivers libraries:

CMakeLists.txt

project (client)

include (platform/nk)

# Set compile flags

project_header_default ("STANDARD_GNU_17:YES" "STRICT_WARNINGS:NO")

# Generates the Client.edl.h file

nk_build_edl_files (client_edl_files NK_MODULE "client" EDL "${CMAKE_SOURCE_DIR}/resources/edl/Client.edl")

add_executable (Client "src/client.c")

add_dependencies (Client client_edl_files)

# Linking with VFS libraries

target_link_libraries (Client vfs::local vfs::lib_fs vfs::lib_net dnet_drivers::drivers)

Page top