Warning when importing shared library on cross-compiled platform that does not support shared libraries
We have a cross-compiled project, where we have a certain shared library which is built for host, and then imported in the cross-compiled project via add_library(... SHARED IMPORTED). The target platform does not support shared libraries, so we get a warning when configuring this project
CMake Warning (dev) at xyz/CMakeLists.txt:22 (add_library):
ADD_LIBRARY called with SHARED option but the target platform does not
support dynamic linking. Building a STATIC library instead. This may lead
to problems.
In our view, this warning is not meaningful for imported libraries, since they are not modified by the project. In our case, we are not using the imported library for the target platform, but for the host platform, and we would like to get rid of this warning.