microsoft / vscode-cmake-tools

CMake integration in Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=vector-of-bool.cmake-tools
MIT License
1.48k stars 455 forks source link

`cmake.parallelJobs` ignored in workspace's `.vscode/settings.json` #3206

Closed diablodale closed 1 year ago

diablodale commented 1 year ago

Brief Issue Summary

When cmake.parallelJobs is set the the user's main settings.json and is also set in workspace's .vscode/settings.json, then the workspace value is ignored and only the main user's setting is used. (I thought this worked in the past but noticed it does not today).

user's settings.json

"cmake.parallelJobs": 14,

workspace .vscode/settings.json

"cmake.parallelJobs": 1,

Result

a cmake build in vscode of...

[proc] Executing command: "C:\Program Files\CMake\bin\cmake.exe" --build c:/njs/depthai-core/build --config Debug --target all -j 14 --
[build] [14/50   2% :: 0.140] cmd.exe /C "cmd.exe /C "...

Workaround

Don't use the workspace settings file for this cmt setting. Instead, set the desired parallelJobs in the main user settings.json

CMake Tools Diagnostics

{
  "os": "win32",
  "vscodeVersion": "1.79.0",
  "cmtVersion": "1.14.33",
  "configurations": [
    {
      "folder": "c:\\njs\\depthai-core",
      "cmakeVersion": "3.26.4",
      "configured": true,
      "generator": "Ninja",
      "usesPresets": false,
      "compilers": {
        "C": "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe",
        "CXX": "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe"
      }
    }
  ],
  "cpptoolsIntegration": {
    "isReady": true,
    "hasCodeModel": true,
    "activeBuildType": "Debug",
    "buildTypesSeen": [
      "Debug"
    ],
    "requests": [],
    "responses": [],
    "partialMatches": [],
    "targetCount": 144,
    "executablesCount": 112,
    "librariesCount": 4,
    "targets": []
  },
  "settings": [
    {
      "communicationMode": "automatic",
      "useCMakePresets": "auto",
      "configureOnOpen": false
    }
  ]
}

Debug Log

No response

Additional Information

No response

benmcmorran commented 1 year ago

Thanks for the report! We'll try to reproduce this issue and let you know if we have any additional questions.

diablodale commented 1 year ago

👍

BlackWaters commented 8 months ago

I am unsure whether this issue has been completely resolved. I can reproduce this issue by setting different parallel jobs in remote and workspace.

If I set cmake.parallelJobs to 12 in remote settings and set 16 in workspace, then cmake build will get:

[proc] Executing command: /usr/bin/cmake --build /repo/build --config Debug --target all -j 12 --