-
Notifications
You must be signed in to change notification settings - Fork 432
Open
Labels
A-cmakeArea: Cmake compilerArea: Cmake compiler
Description
In toolchain.cmake, we have already set the following flags for cross-compilation :
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
However, these settings have led to a series of issues, as discussed in: #1291 , #1270 , #1180 . In particular, problems can arise when an absolute path is provided to functions like find_library. With the current settings, find_library does not search the actual absolute path as expected, but instead looks under ${CMAKE_FIND_ROOT_PATH}/${MBEDTLS_FOLDER_LIBRARY}, which causes failures to locate the required libraries—even if the correct path is given.
Given the issues above, I would like to discuss what is the most appropriate way to configure these CMAKE_FIND_ROOT_PATH_MODE_* flags for cross-compilation scenarios.
Metadata
Metadata
Assignees
Labels
A-cmakeArea: Cmake compilerArea: Cmake compiler