如何使用 VS Code 中的 CMake 工具在配置任务中为 CMake 指定参数?

问题描述 投票:0回答:1

我想在 VS Code 中设置一个任务来使用 CMake 配置项目。

可悲的是,我不知道如何传递参数,例如

-DCMAKE_C_COMPILER:FILEPATH=gcc
在任务中使用 CMake。

IDE 报告不支持“args”。

当前片段:

"tasks": [
    {
        "type": "cmake",
        "label": "CMake: configure",
        "command": "configure",
        "problemMatcher": [],
        "detail": "CMake template configure task"
    },
],
visual-studio-code cmake
1个回答
0
投票

如果应遵守

cmake.configureArgs
设置,以及所选 配置预设中指定的参数(请参阅
preset
任务类型架构的
cmake
属性),例如
cacheVariables
中缓存变量的参数配置预设属性,或相应命令行参数的其他属性。

© www.soinside.com 2019 - 2024. All rights reserved.