Skip to content
Permalink
Browse files

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>
  • Loading branch information...
mped-oticon authored and aescolar committed Apr 26, 2019
1 parent a872911 commit 3db09aa610937bfe85f0823d32cd7c9474b12158
Showing with 14 additions and 3 deletions.
  1. +2 −3 CMakeLists.txt
  2. +1 −0 cmake/linker/ld/target.cmake
  3. +11 −0 cmake/linker/ld/target_cpp.cmake
@@ -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()

# ==========================================================================
@@ -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)
@@ -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()

0 comments on commit 3db09aa

Please sign in to comment.
You can’t perform that action at this time.