Skip to content

Commit 24f035e

Browse files
authored
Merge pull request #14204 from multiplemonomials/cmake-exe-suffix
Set executable suffix in CMake
2 parents 6dd44e7 + d9819a7 commit 24f035e

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ function(mbed_set_mbed_target_linker_script target)
140140
target_link_options(mbed-core
141141
INTERFACE
142142
"-T" "${CMAKE_BINARY_DIR}/${target}.link_script.ld"
143-
"-Wl,-Map=${CMAKE_BINARY_DIR}/${target}.map"
143+
"-Wl,-Map=${CMAKE_BINARY_DIR}/${target}${CMAKE_EXECUTABLE_SUFFIX}.map"
144144
)
145145
elseif(MBED_TOOLCHAIN STREQUAL "ARM")
146146
set(CMAKE_PRE_BUILD_COMMAND COMMAND "")

tools/cmake/app.cmake

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,7 @@ endif()
1919
include(${MBED_PATH}/tools/cmake/profile.cmake)
2020

2121
enable_language(C CXX ASM)
22+
23+
# set executable suffix (has to be done after enabling languages)
24+
# Note: This is nice to have, but is also required because STM32Cube will only work on files with a .elf extension
25+
set(CMAKE_EXECUTABLE_SUFFIX .elf)

0 commit comments

Comments
 (0)