cmake: Toolchain abstraction: introduce toolchain_ld_cpp

No functional change expected.

This is motivated by the wish to abstract Zephyr's usage of toolchains,
permitting non-intrusive porting to other (commercial) toolchains.

Signed-off-by: Mark Ruvald Pedersen <mped@oticon.com>
This commit is contained in:
Mark Ruvald Pedersen 2019-04-26 08:43:04 +02:00 committed by Alberto Escolar
commit 3db09aa610
3 changed files with 14 additions and 3 deletions

View file

@ -230,9 +230,8 @@ if(NOT CONFIG_NATIVE_APPLICATION)
endif()
if(CONFIG_LIB_CPLUSPLUS)
zephyr_ld_options(
-lstdc++
)
# @Intent: Set linker specific flags for C++
toolchain_ld_cpp()
endif()
# ==========================================================================

View file

@ -7,3 +7,4 @@ set_ifndef(LINKERFLAGPREFIX -Wl)
# Load toolchain_ld-family macros
include(${ZEPHYR_BASE}/cmake/linker/${LINKER}/target_base.cmake)
include(${ZEPHYR_BASE}/cmake/linker/${LINKER}/target_baremetal.cmake)
include(${ZEPHYR_BASE}/cmake/linker/${LINKER}/target_cpp.cmake)

View file

@ -0,0 +1,11 @@
# SPDX-License-Identifier: Apache-2.0
# See root CMakeLists.txt for description and expectations of these macros
macro(toolchain_ld_cpp)
zephyr_ld_options(
-lstdc++
)
endmacro()