forked from ARMmbed/mbed-os
-
Notifications
You must be signed in to change notification settings - Fork 26
Split app.cmake into two parts to fix CMake deprecation warning #421
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
3b2cc49
Split app.cmake into two parts to fix CMake deprecation warning
multiplemonomials 15e7f87
Use old version if that's all we have
multiplemonomials 54242eb
Fix import, update more CMakeLists.txt files
multiplemonomials d1dfc31
augh
multiplemonomials 52f4eaa
Simplify unit tests CI job
multiplemonomials File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 |
|---|---|---|
| @@ -1,88 +1,10 @@ | ||
| # Copyright (c) 2020 ARM Limited. All rights reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| # Add our CMake list files to CMake default module path | ||
| list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) | ||
| 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().") | ||
|
|
||
| find_program(CCACHE "ccache") | ||
| if(CCACHE) | ||
| set(CMAKE_C_COMPILER_LAUNCHER ${CCACHE}) | ||
| set(CMAKE_CXX_COMPILER_LAUNCHER ${CCACHE}) | ||
| endif() | ||
|
|
||
| # Figure out path to Mbed source | ||
| get_filename_component(MBED_SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/../.. REALPATH) | ||
|
|
||
| # Find Python (needed to generate configurations) | ||
| include(mbed_python_interpreter) | ||
|
|
||
| include(mbed_generate_config_header) | ||
| include(mbed_target_functions) | ||
| include(mbed_create_distro) | ||
|
|
||
| # Load toolchain and mbed configuration, generating it if needed | ||
| include(mbed_generate_configuration) | ||
|
|
||
| # Load toolchain file | ||
| if(NOT CMAKE_TOOLCHAIN_FILE OR MBED_TOOLCHAIN_FILE_USED) | ||
| set(MBED_TOOLCHAIN_FILE_USED TRUE CACHE INTERNAL "") | ||
| # We want to bring CMP0123 we set in mbed_toolchain.cmake | ||
| # to the whole Mbed OS. | ||
| include(mbed_toolchain NO_POLICY_SCOPE) | ||
| endif() | ||
|
|
||
| # Specify available build profiles and add options for the selected build profile | ||
| include(mbed_profile) | ||
| include(${CMAKE_CURRENT_LIST_DIR}/mbed_toolchain_setup.cmake) | ||
|
|
||
| enable_language(C CXX ASM) | ||
|
|
||
| # set executable suffix (has to be done after enabling languages) | ||
| # Note: This is nice in general, but is also required because STM32Cube will only work on files with a .elf extension | ||
| set(CMAKE_EXECUTABLE_SUFFIX .elf) | ||
|
|
||
| # Find the GDB server, assuming it will be in the same path as the compiler. | ||
| get_filename_component(CMAKE_COMPILER_BIN_DIR ${CMAKE_C_COMPILER} DIRECTORY) | ||
| find_program(MBED_GDB | ||
| NAMES arm-none-eabi-gdb gdb-multiarch | ||
| HINTS ${CMAKE_COMPILER_BIN_DIR} | ||
| DOC "Path to the GDB client program to use when debugging.") | ||
|
|
||
| if(EXISTS "${MBED_GDB}") | ||
| set(MBED_GDB_FOUND TRUE) | ||
| else() | ||
| message(STATUS "Mbed: Could not find arm-none-eabi-gdb or gdb-mutiarch. Debugging will be unavailable. Set the MBED_GDB variable to specify its path.") | ||
| set(MBED_GDB_FOUND FALSE) | ||
| endif() | ||
|
|
||
| # Load upload method configuration defaults for this target. | ||
| # Loading the settings here makes sure they are set at global scope, and also makes sure that | ||
| # the user can override them by changing variable values after including app.cmake. | ||
| # | ||
| # default expected paths | ||
| set(EXPECTED_CUSTOM_UPLOAD_CFG_FILE_PATH ${CMAKE_SOURCE_DIR}/custom_targets/upload_method_cfg/${MBED_TARGET}.cmake) | ||
| set(EXPECTED_MBED_UPLOAD_CFG_FILE_PATH ${MBED_SOURCE_DIR}/targets/upload_method_cfg/${MBED_TARGET}.cmake) | ||
|
|
||
| # check if a custom upload config path is defined in top lvl cmake | ||
| if((DEFINED CUSTOM_UPLOAD_CFG_PATH)) | ||
| # Make path absolute, as required by EXISTS | ||
| get_filename_component(CUSTOM_UPLOAD_CFG_PATH "${CUSTOM_UPLOAD_CFG_PATH}" ABSOLUTE BASE_DIR ${CMAKE_SOURCE_DIR}) | ||
| if(EXISTS ${CUSTOM_UPLOAD_CFG_PATH}) | ||
| include(${CUSTOM_UPLOAD_CFG_PATH}) | ||
| message(STATUS "Mbed: Custom upload config included from ${CUSTOM_UPLOAD_CFG_PATH}") | ||
| else() | ||
| message(FATAL_ERROR "Mbed: Custom upload config is defined but files was not found here - ${CUSTOM_UPLOAD_CFG_PATH}") | ||
| endif() | ||
|
|
||
| # check if a custom upload config is present in custom_targets/YOUR_TARGET folder | ||
| elseif(EXISTS ${EXPECTED_CUSTOM_UPLOAD_CFG_FILE_PATH}) | ||
| include(${EXPECTED_CUSTOM_UPLOAD_CFG_FILE_PATH}) | ||
| message(STATUS "Mbed: Custom upload config included from ${EXPECTED_CUSTOM_UPLOAD_CFG_FILE_PATH}") | ||
|
|
||
| # check for build in upload config | ||
| elseif(EXISTS ${EXPECTED_MBED_UPLOAD_CFG_FILE_PATH}) | ||
| include(${EXPECTED_MBED_UPLOAD_CFG_FILE_PATH}) | ||
| message(STATUS "Mbed: Loading default upload method configuration from ${EXPECTED_MBED_UPLOAD_CFG_FILE_PATH}") | ||
| else() | ||
| message(STATUS "Mbed: Target does not have any upload method configuration. 'make flash-' commands will not be available unless configured by the upper-level project.") | ||
| set(UPLOAD_METHOD_DEFAULT "NONE") | ||
| endif() | ||
| include(${CMAKE_CURRENT_LIST_DIR}/mbed_project_setup.cmake) |
This file contains hidden or 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 hidden or 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,46 @@ | ||
| # Copyright (c) 2021 ARM Limited. All rights reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| # This script should be included after the top-level script calls project(). | ||
| # It sets up some global variables for project and upload method configuration. | ||
|
|
||
|
|
||
| # Enable languages used by Mbed, in case the top level script didn't enable them | ||
| enable_language(C CXX ASM) | ||
|
|
||
| # set executable suffix (has to be done after enabling languages) | ||
| # Note: This is nice in general, but is also required because STM32Cube will only work on files with a .elf extension | ||
| set(CMAKE_EXECUTABLE_SUFFIX .elf) | ||
|
|
||
| # Load upload method configuration defaults for this target. | ||
| # Loading the settings here makes sure they are set at global scope, and also makes sure that | ||
| # the user can override them by changing variable values after including app.cmake. | ||
| # | ||
| # default expected paths | ||
| set(EXPECTED_CUSTOM_UPLOAD_CFG_FILE_PATH ${CMAKE_SOURCE_DIR}/custom_targets/upload_method_cfg/${MBED_TARGET}.cmake) | ||
| set(EXPECTED_MBED_UPLOAD_CFG_FILE_PATH ${MBED_SOURCE_DIR}/targets/upload_method_cfg/${MBED_TARGET}.cmake) | ||
|
|
||
| # check if a custom upload config path is defined in top lvl cmake | ||
| if((DEFINED CUSTOM_UPLOAD_CFG_PATH)) | ||
| # Make path absolute, as required by EXISTS | ||
| get_filename_component(CUSTOM_UPLOAD_CFG_PATH "${CUSTOM_UPLOAD_CFG_PATH}" ABSOLUTE BASE_DIR ${CMAKE_SOURCE_DIR}) | ||
| if(EXISTS ${CUSTOM_UPLOAD_CFG_PATH}) | ||
| include(${CUSTOM_UPLOAD_CFG_PATH}) | ||
| message(STATUS "Mbed: Custom upload config included from ${CUSTOM_UPLOAD_CFG_PATH}") | ||
| else() | ||
| message(FATAL_ERROR "Mbed: Custom upload config is defined but files was not found here - ${CUSTOM_UPLOAD_CFG_PATH}") | ||
| endif() | ||
|
|
||
| # check if a custom upload config is present in custom_targets/YOUR_TARGET folder | ||
| elseif(EXISTS ${EXPECTED_CUSTOM_UPLOAD_CFG_FILE_PATH}) | ||
| include(${EXPECTED_CUSTOM_UPLOAD_CFG_FILE_PATH}) | ||
| message(STATUS "Mbed: Custom upload config included from ${EXPECTED_CUSTOM_UPLOAD_CFG_FILE_PATH}") | ||
|
|
||
| # check for build in upload config | ||
| elseif(EXISTS ${EXPECTED_MBED_UPLOAD_CFG_FILE_PATH}) | ||
| include(${EXPECTED_MBED_UPLOAD_CFG_FILE_PATH}) | ||
| message(STATUS "Mbed: Loading default upload method configuration from ${EXPECTED_MBED_UPLOAD_CFG_FILE_PATH}") | ||
| else() | ||
| message(STATUS "Mbed: Target does not have any upload method configuration. 'make flash-' commands will not be available unless configured by the upper-level project.") | ||
| set(UPLOAD_METHOD_DEFAULT "NONE") | ||
| endif() |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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,43 @@ | ||
| # Copyright (c) 2020 ARM Limited. All rights reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| # This CMake script shall be included first: | ||
| # - before project() (or enable_languages()) is called by the application | ||
| # - before any other Mbed CMake scripts are included and before the mbed-os subdir is added | ||
| # - before any upload method config variables are set | ||
| # Its goal is to configure CMake to execute the ARM compilers. | ||
| # The only thing that should be done before including this script is to set the MBED_APP_JSON_PATH and | ||
| # MBED_CUSTOM_TARGETS_JSON_PATH variables. | ||
|
|
||
| # Add our CMake list files to CMake default module path | ||
| list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) | ||
|
|
||
| find_program(CCACHE "ccache") | ||
| if(CCACHE) | ||
| set(CMAKE_C_COMPILER_LAUNCHER ${CCACHE}) | ||
| set(CMAKE_CXX_COMPILER_LAUNCHER ${CCACHE}) | ||
| endif() | ||
|
|
||
| # Figure out path to Mbed source | ||
| get_filename_component(MBED_SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/../.. REALPATH) | ||
|
|
||
| # Find Python (needed to generate configurations) | ||
| include(mbed_python_interpreter) | ||
|
|
||
| include(mbed_generate_config_header) | ||
| include(mbed_target_functions) | ||
| include(mbed_create_distro) | ||
|
|
||
| # Load toolchain and mbed configuration, generating it if needed | ||
| include(mbed_generate_configuration) | ||
|
|
||
| # Load toolchain file | ||
| if(NOT CMAKE_TOOLCHAIN_FILE OR MBED_TOOLCHAIN_FILE_USED) | ||
| set(MBED_TOOLCHAIN_FILE_USED TRUE CACHE INTERNAL "") | ||
| # We want to bring CMP0123 we set in mbed_toolchain.cmake | ||
| # to the whole Mbed OS. | ||
| include(mbed_toolchain NO_POLICY_SCOPE) | ||
| endif() | ||
|
|
||
| # Specify available build profiles and add options for the selected build profile | ||
| include(mbed_profile) |
This file contains hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.