(vscode + cmake) Add option MBED_GENERATE_VSCODE_CONFIG (#142)

pull/15437/head
Ladislas de Toldi 2023-02-28 07:47:51 +01:00 committed by GitHub
parent 823e795968
commit 4124a9a67d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 4 deletions

View File

@ -3,6 +3,11 @@
# Script to automatically generate debug configurations for various IDEs.
# Options
# -------------------------------------------------------------
option(MBED_GENERATE_VSCODE_CONFIG "If TRUE, Mbed will generate launch.json and tasks.json files allowing you to flash and debug code from the IDE" TRUE)
# Detect IDEs
# -------------------------------------------------------------
@ -16,7 +21,7 @@ if("$ENV{CLION_IDE}" AND MBED_UPLOAD_SUPPORTS_DEBUG)
message(FATAL_ERROR "In order to generate CLion configuration files, Mbed CE needs to know the name of the current CLion build profile. This name is the string typed into the Name textbox under Settings > Build, Execution, Deployment > CMake. Pass this name with '-DMBED_CLION_PROFILE_NAME=<name>'.")
endif()
elseif(CMAKE_EXPORT_COMPILE_COMMANDS AND MBED_UPLOAD_SUPPORTS_DEBUG) # TODO: Is this actually a reliable way of detecting VS Code? Not sure if it will create false positives.
elseif(CMAKE_EXPORT_COMPILE_COMMANDS AND MBED_UPLOAD_SUPPORTS_DEBUG AND MBED_GENERATE_VSCODE_CONFIG) # TODO: Is this actually a reliable way of detecting VS Code? Not sure if it will create false positives.
message(STATUS "Mbed: Detected VS Code IDE, will generate VS Code debug configurations")
set(MBED_GENERATE_VS_CODE_DEBUG_CFGS TRUE)