vscode-cmake-tools icon indicating copy to clipboard operation
vscode-cmake-tools copied to clipboard

Cmake-tools does not send Windows SDK version to cpptools

Open michelleangela opened this issue 5 years ago • 6 comments

Issue found from internal usage of extensions.

  1. Install the following Windows SDK from VS 16.7 preview. image

  2. In Cmake configuration, select "Windows SDK version 10.0.18362.0 to target Windows 10.0.19041”

In user's provided example of configurations recieved from cmake-tools to cpptools, Windows SDK version is missing.

   Custom configurations received:
  uri: file:///x%3A/jcab-ms/CMakeTest1/test1.cpp
  config: {
  "defines": [
    "WIN32",
    "_WINDOWS",
    "NDEBUG"
  ],
  "standard": "c++17",
  "includePath": [
    "~/cmaketest1/mylib/inc",
    "~/cmaketest1/mydll/inc"
  ],
  "intelliSenseMode": "msvc-x64",
  "compilerPath": "c:/program files (x86)/microsoft visual studio/2019/preview/vc/tools/msvc/14.27.29009/bin/hostx64/x64/cl.exe",
  "compilerArgs": [
    "/DWIN32",
    "/D_WINDOWS",
    "/GR",
    "/EHsc",
    "/Zi",
    "/O2",
    "/Ob1",
    "/DNDEBUG",
    "-MD"
  ]
}

  1. Cpptools extension then seem to get the SDK version based on what's installed, rather than from a specified version
sending compilation args for X:\JCAB-MS\CMAKETEST1\TEST1.CPP
  include: ~\CMAKETEST1\MYLIB\INC
  include: ~\CMAKETEST1\MYDLL\INC
  include: C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2019\PREVIEW\VC\TOOLS\MSVC\14.27.29009\INCLUDE
  include: C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2019\PREVIEW\VC\TOOLS\MSVC\14.27.29009\ATLMFC\INCLUDE
  include: C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.19041.0\UM
  include: C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.19041.0\SHARED
  define: WIN32
  define: _WINDOWS
  define: NDEBUG
  define: WIN32
  define: _WINDOWS
  define: NDEBUG
  stdver: ms_c++17
  intelliSenseMode: msvc-x64

michelleangela avatar Jul 22 '20 00:07 michelleangela

Yeap, unable to choose windows sdk version is a issue, @lygstate need fix this otherwise Ninja can not works with vs 2015

lygstate avatar Mar 16 '21 10:03 lygstate

Related to https://github.com/microsoft/vscode-cmake-tools/issues/125

lygstate avatar Apr 03 '21 13:04 lygstate

This issue is now marked as 'stale-old' due to there being no activity on it for the past 720 days. Unless the 'stale-old' label is removed or the issue is commented on, this will be remain open for at least 14 days and then it may be closed. If you would like to make this issue exempt from getting stale, please add the 'stale-exempt' label.

github-actions[bot] avatar Oct 19 '23 16:10 github-actions[bot]

As far as I know, this is still an issue.

i-C-o-d-e-r avatar Oct 21 '23 07:10 i-C-o-d-e-r

@Colengms Are we expected to pass the Windows SDK version to cpptools?

gcampbell-msft avatar Jun 25 '24 13:06 gcampbell-msft

Hi @gcampbell-msft . Sorry, I had missed this. We expect to receive all relevant configuration information from CMake Tools. If a #include path from a Windows SDK is needed to compile a file, we would expect that to be included in the include paths (or relevant compiler args, being a system include, see: https://github.com/microsoft/vscode-cmake-tools/issues/3240 ) of the configuration.

Colengms avatar Jul 30 '24 22:07 Colengms