Skip to content
Commit 76aa21b3 authored by Lingkai Dong's avatar Lingkai Dong
Browse files

cmake: Fix linking error when project_options is unavailable



When the SDK is used in another project, `project_options` is not
fetched or added by the SDK and results in the following error when
linking executables:

    Fatal error: L3900U: Unrecognized option '-lproject_options'

This is a linker error rather than a CMake error, because when no CMake
target exists for a named library, CMake assumes this library to be in
the linker's search path and adds a link flag.

To fix this, link `project_options` and `project_warnings` only when the
SDK is the top-level project. This fix is needed for libraries only, and
examples and tests are not affected because they are not built when the
SDK is used inside another project.

Signed-off-by: Lingkai Dong's avatarLingkai Dong <lingkai.dong@arm.com>
parent c0957470
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment