Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
samples: external_lib: Include
--target
in exported build flags
Appropriately setting the `--target` flag is necessary when using clang and building for a target other than the default. Zephyr generally accomplishes this by setting the CMAKE_<LANG>_COMPILER_TARGET variables and allowing cmake to automatically provide the `--target` flag when building. For the external_lib sample, however, cmake can't add the flag and it was not otherwise exported. As such, clang typically threw errors when building this sample for any non-default targets due to mismatches between target-specific flags and the default target. To fix this, ensure we select the correct target by checking if CMAKE_C_COMPILER_TARGET has been defined and adding `--target=<triple>` to the list of flags that are exported if so. (cherry picked from commit 4ddd3eb) Original-Signed-off-by: Jonathon Penix <jpenix@quicinc.com> GitOrigin-RevId: 4ddd3eb Change-Id: Ibaa6e632c08b711d28a428c51fe6560b8885cf36 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/zephyr/+/5752461 Tested-by: ChromeOS Prod (Robot) <chromeos-ci-prod@chromeos-bot.iam.gserviceaccount.com> Reviewed-by: Fabio Baltieri <fabiobaltieri@google.com> Commit-Queue: Fabio Baltieri <fabiobaltieri@google.com> Tested-by: Fabio Baltieri <fabiobaltieri@google.com>
- Loading branch information