-
Notifications
You must be signed in to change notification settings - Fork 464
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
Unspecified doesn't let CMake guess what compilers and environment to use #3405
Comments
@gcampbell-msft is there any more info needed to repro? Just tried again, and this # CMakeLists.txt
cmake_minimum_required(VERSION 3.27)
project(cmake-tools-mre) gave me [main] Configuring project: cmake-tools-mre
[proc] Executing command: "C:\Program Files\CMake\bin\cmake.EXE" --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -SC:/Users/gerard/Desktop/cmake-tools-mre -Bc:/Users/gerard/Desktop/cmake-tools-mre/build -G Ninja
[cmake] Not searching for unused variables given on the command line.
[cmake] -- The C compiler identification is unknown
[cmake] -- The CXX compiler identification is unknown
[cmake] CMake Error at CMakeLists.txt:2 (project):
[cmake] No CMAKE_C_COMPILER could be found.
[cmake]
[cmake] Tell CMake where to find the compiler by setting either the environment
[cmake] variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
[cmake] the compiler, or to the compiler name if it is in the PATH.
[cmake]
[cmake]
[cmake] CMake Error at CMakeLists.txt:2 (project):
[cmake] No CMAKE_CXX_COMPILER could be found.
[cmake]
[cmake] Tell CMake where to find the compiler by setting either the environment
[cmake] variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
[cmake] to the compiler, or to the compiler name if it is in the PATH.
[cmake]
[cmake]
[cmake] -- Configuring incomplete, errors occurred!
[proc] The command: "C:\Program Files\CMake\bin\cmake.EXE" --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -SC:/Users/gerard/Desktop/cmake-tools-mre -Bc:/Users/gerard/Desktop/cmake-tools-mre/build -G Ninja exited with code: 1 whereas running "C:\Program Files\CMake\bin\cmake.EXE" --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -SC:/Users/gerard/Desktop/cmake-tools-mre -Bc:/Users/gerard/Desktop/cmake-tools-mre/build in the same folder gave me a successful "C:\Program Files\CMake\bin\cmake.EXE" --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -SC:/Users/gerard/Desktop/cmake-tools-mre -Bc:/Users/gerard/Desktop/cmake-tools-mre/build
Not searching for unused variables given on the command line.
-- Building for: Visual Studio 17 2022
-- Selecting Windows SDK version 10.0.22621.0 to target Windows 10.0.19045.
-- The C compiler identification is MSVC 19.39.33523.0
-- The CXX compiler identification is MSVC 19.39.33523.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Professional/VC/Tools/MSVC/14.39.33519/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Professional/VC/Tools/MSVC/14.39.33519/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done (4.8s)
-- Generating done (0.0s)
-- Build files have been written to: C:/Users/gerard/Desktop/cmake-tools-mre/build CMake Tools Diagnostics{
"os": "win32",
"vscodeVersion": "1.88.1",
"cmtVersion": "1.17.17",
"configurations": [
{
"folder": "c:\\Users\\gerard\\Desktop\\cmake-tools-mre",
"cmakeVersion": "3.29.2",
"configured": true,
"generator": "Ninja",
"usesPresets": false,
"compilers": {}
}
],
"cpptoolsIntegration": {
"isReady": false,
"hasCodeModel": false,
"activeBuildType": "",
"buildTypesSeen": [],
"requests": [],
"responses": [],
"partialMatches": [],
"targetCount": 0,
"executablesCount": 0,
"librariesCount": 0,
"targets": []
},
"settings": [
{
"communicationMode": "automatic",
"useCMakePresets": "auto",
"configureOnOpen": null
}
]
} |
@gerard-ryan-immersaview I still can't reproduce the problem after following your tips, am I going about it the wrong way? Are you able to give some advice? |
And you configured the kit to be unspecified? I noticed that you use the CMake version that comes with Visual Studio and not the direct one too. |
@gcampbell-msft @gerard-ryan-immersaview Following the steps given by the user, this issue we can reproduce on top of the latest VSCode and you can get some information below: ENV: Repro steps recording: |
@gerard-ryan-immersaview Does this issue still reproduce if you clear the setting |
Yes |
@gerard-ryan-immersaview Thank you very much for your reply, we have added this issue to the backlog and will follow up with our developers to deal with this issue and will be the first to add a comment if there is any progress! |
Hey @v-frankwang this issue should now be fixed in the latest pre-release :) |
@snehara99 Thank you very much for your reply, I verified the issue on latest pre-release: v1.19.20 (pre-release) and it was fixed. ENV: |
Brief Issue Summary
When the selected kit is
[Unspecified] Unspecified (Let CMake guess what compilers and environment to use)
,-G Ninja
is added to the CMake command andNo CMAKE_C_COMPILER could be found.
CMake Tools Diagnostics
Debug Log
Additional Information
If I truly let CMake decide by running it on the CLI it finds the Compiler and environment I'd expect it to use.
The text was updated successfully, but these errors were encountered: