forked from zephyrproject-rtos/zephyr
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmake: source dedicated linker library properties for native builds
Native builds uses system libraries per default. Instead of handling this in each linker_libraries.cmake files, then the check for native build is moved one level up and for native build a dedicated linker_libraries_native.cmake is sourced. This simplifies the linker_libraries.cmake files as they no longer need to check for native builds. Signed-off-by: Torsten Rasmussen <[email protected]>
- Loading branch information
Showing
4 changed files
with
36 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Copyright (c) 2024 Nordic Semiconductor | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
# When doing native builds, then we default to host libraries. | ||
# No reason for loading linker libraries properties in this case, however we do | ||
# define link order because that allows the build system to hook in alternative | ||
# C library implementations, such as minimal libc or picolibc. | ||
|
||
# Empty on purpose as we default to host libraries selected by the linker. | ||
set_linker_property(PROPERTY c_library "") | ||
set_linker_property(PROPERTY rt_library "") | ||
set_linker_property(PROPERTY c++_library "") | ||
|
||
# Although library properties are empty per default, then we still define link | ||
# order as this allows to update libraries in use elsewhere. | ||
if(CONFIG_CPP) | ||
set_property(TARGET linker PROPERTY link_order_library "c++") | ||
endif() | ||
|
||
set_property(TARGET linker APPEND PROPERTY link_order_library "c;rt") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters