Skip to content

Commit 54242eb

Browse files
Fix import, update more CMakeLists.txt files
1 parent 15e7f87 commit 54242eb

File tree

5 files changed

+15
-26
lines changed

5 files changed

+15
-26
lines changed

CMakeLists.txt

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,14 @@ if(MBED_IS_STANDALONE AND NOT MBED_IS_NATIVE_BUILD)
5656
set(MBED_CONFIG_PATH ${CMAKE_CURRENT_BINARY_DIR} CACHE STRING "")
5757

5858
# Initialize Mbed build system
59-
include(${CMAKE_CURRENT_LIST_DIR}/tools/cmake/app.cmake)
59+
include(${CMAKE_CURRENT_LIST_DIR}/tools/cmake/mbed_toolchain_setup.cmake)
60+
endif()
61+
62+
# Create project and find compilers (if not already found)
63+
project(mbed-os LANGUAGES C CXX ASM)
64+
65+
if(MBED_IS_STANDALONE AND NOT MBED_IS_NATIVE_BUILD)
66+
include(mbed_project_setup)
6067
endif()
6168

6269
if(MBED_IS_NATIVE_BUILD)
@@ -85,9 +92,6 @@ endif()
8592

8693
# Create core Mbed OS targets and set up build flags ----------------------------------------------------------------------------------
8794

88-
# Create project and find compilers (if not already found)
89-
project(mbed-os LANGUAGES C CXX ASM)
90-
9195
# Add all paths to the module files within Mbed OS
9296
list(APPEND CMAKE_MODULE_PATH
9397
${mbed-os_SOURCE_DIR}/platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_TFM/TARGET_TFM_LATEST/scripts
@@ -291,19 +295,3 @@ if(NOT MBED_IS_NATIVE_BUILD)
291295
mbed_extract_flags(${MBED_TARGET_CMAKE_NAME}-flags ${MBED_TARGET_CMAKE_NAME})
292296
target_link_libraries(mbed-core-flags INTERFACE ${MBED_TARGET_CMAKE_NAME}-flags)
293297
endif()
294-
295-
# Ninja requires to be forced for response files
296-
if ("${CMAKE_GENERATOR}" MATCHES "Ninja")
297-
# known issue ARMClang and Ninja with response files for windows
298-
# https://gitlab.kitware.com/cmake/cmake/-/issues/21093
299-
# This gets fixed in newer cmake version
300-
# https://gitlab.kitware.com/cmake/cmake/-/merge_requests/6484
301-
if((CMAKE_HOST_SYSTEM_NAME MATCHES "Windows") AND ((${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.22.0") OR (NOT CMAKE_CXX_COMPILER_ID MATCHES "ARMClang")))
302-
set(CMAKE_NINJA_FORCE_RESPONSE_FILE 1 CACHE INTERNAL "")
303-
endif()
304-
endif()
305-
306-
# If this is the top-level buildscript, run finalize tasks
307-
if(MBED_IS_STANDALONE AND (NOT MBED_IS_NATIVE_BUILD))
308-
mbed_finalize_build()
309-
endif()

tools/cmake/app.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Copyright (c) 2020 ARM Limited. All rights reserved.
22
# SPDX-License-Identifier: Apache-2.0
33

4-
message(WARNING "Mbed: Deprecated: Instead of including app.cmake, include mbed_toolchain_setup.cmake, then call project(), then include mbed_project_setup.cmake. Including app.cmake will unavoidably trigger a warning from CMake due to calling enable_language() before project().")
4+
message(WARNING "Mbed: Deprecated: Instead of including app.cmake, include mbed_toolchain_setup.cmake, then call project(), then include mbed_project_setup.cmake. For more info, see https://github.com/mbed-ce/mbed-os/pull/421")
55

66
include(${CMAKE_CURRENT_LIST_DIR}/mbed_toolchain_setup.cmake)
77

tools/cmake/tests/mbed_test_mode/CMakeLists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@ cmake_minimum_required(VERSION 3.19.0 FATAL_ERROR)
55

66
set(MBED_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../../.. CACHE INTERNAL "")
77

8-
include(${MBED_PATH}/tools/cmake/app.cmake)
8+
include(${MBED_PATH}/tools/cmake/mbed_toolchain_setup.cmake)
9+
project(mbed-test-mode-check)
10+
include(mbed_project_setup)
911

1012
add_test(NAME mbed-test-mode-check COMMAND mbed-test-mode-check)
1113
add_executable(mbed-test-mode-check)
12-
project(mbed-test-mode-check)
1314

1415
set(PROJECT_NAME ${CMAKE_PROJECT_NAME} CACHE INTERNAL "")
1516
include(CTest)

tools/cmake/tests/multiple_executables/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ cmake_minimum_required(VERSION 3.19.0)
55

66
set(MBED_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../../..")
77

8-
include("${MBED_PATH}/tools/cmake/app.cmake")
9-
8+
include(${MBED_PATH}/tools/cmake/mbed_toolchain_setup.cmake)
109
project(multiple_executables)
10+
include(mbed_project_setup)
1111

1212
add_subdirectory("${MBED_PATH}" "mbed-os-build")
1313

tools/python/memap/memap.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
from argparse import ArgumentParser
6262
from copy import deepcopy
6363
from collections import defaultdict
64-
from prettytable import PrettyTable, HRuleStyle
64+
from prettytable import PrettyTable
6565

6666
# prettytable moved this constant into an enum in the Python 3.9 release.
6767
if sys.version_info >= (3, 9):

0 commit comments

Comments
 (0)