Adding dynamic libraries to a KasperskyOS-based solution image
To add dynamic libraries to the KasperskyOS-based solution image, use PACK_DEPS_COPY_ONLY ON
, PACK_DEPS_LIBS_PATH
, and PACK_DEPS_COPY_TARGET
parameters in the CMake
commands build_kos_qemu_image()
and build_kos_hw_image()
.
Example:
The solution program-dependent dynamic libraries are added to a storage device image (for example, one with an ext4 file system) that will be included into the solution image.
Dynamic libraries that are loaded into memory by calling the dlopen()
function of the POSIX interface are not added to the solution image.
The build system does the following:
- Searches for dynamic libraries and copies these libraries to the directory whose path is specified in the
PACK_DEPS_LIBS_PATH
parameter of theCMake
commandsbuild_kos_qemu_image()
andbuild_kos_hw_image()
. (To ensure that the found dynamic libraries are included in the storage device image, this directory must reside in the file system that will be put into the storage device image.) - Creates a storage device image that includes the directory containing the dynamic libraries.
To create a storage device image, use the
CMake
commandadd_custom_command()
. The target specified in theDEPENDS
parameter of theCMake
commandadd_custom_command()
, indicates that a storage device image is created. The target specified in thePACK_DEPS_COPY_TARGET
parameter of theCMake
commandsbuild_kos_qemu_image()
andbuild_kos_hw_image()
, indicates that dynamic libraries are copied. To make sure that the storage device image is created only after the dynamic libraries are fully copied, use theCMake
commandadd_dependencies()
. - Adds the storage device image to the solution image.
To add the storage device image to the solution image, specify the full path to the storage device image in the
IMAGE_FILES
parameter of theCMake
commandsbuild_kos_qemu_image()
andbuild_kos_hw_image()
.