microsoft / vscode-cmake-tools

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

Detect toolchain gcc version to --version from -v #3039

Open kay54068 opened 1 year ago

kay54068 commented 1 year ago

Brief Issue Summary

This is a very nice extension, but I am unable to run other GCC toolchains because I cannot detect the GCC version.

Can add detect toolchain gcc version to --version from -v ? for example: aarch64-linux-gcc -v is not work , change the full args --version can work,

CMake Tools Diagnostics

No response

Debug Log

[variant] Loaded new set of variants
[kit] Successfully loaded 2 kits from /home/psx/.local/share/CMakeTools/cmake-tools-kits.json
[proc] Executing command: /usr/bin/cmake --version
[proc] Executing command: /opt/lnxshare/aarch64-buildroot-linux-gnu_sdk-buildroot/bin/aarch64-linux-gcc -v
[proc] The command: /opt/lnxshare/aarch64-buildroot-linux-gnu_sdk-buildroot/bin/aarch64-linux-gcc -v exited with code: 1
[proc] The command: ninja --version failed with error: Error: spawn ninja ENOENT
[proc] The command: ninja-build --version failed with error: Error: spawn ninja-build ENOENT
[proc] Executing command: /usr/bin/cmake -S/home/psx/workspace/panelapp/buildapp/cmake_build -B/home/psx/workspace/panelapp/buildapp/cmake_build/build -G "Unix Makefiles"
[proc] The command: /usr/bin/cmake -S/home/psx/workspace/panelapp/buildapp/cmake_build -B/home/psx/workspace/panelapp/buildapp/cmake_build/build -G "Unix Makefiles" exited with code: 1
[main] Configuring project: cmake_build 
[proc] Executing command: /usr/bin/cmake --no-warn-unused-cli -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -DCMAKE_BUILD_TYPE:STRING=Debug -DCMAKE_C_COMPILER:FILEPATH=/opt/lnxshare/aarch64-buildroot-linux-gnu_sdk-buildroot/bin/aarch64-linux-gcc -DCMAKE_CXX_COMPILER:FILEPATH=/opt/lnxshare/aarch64-buildroot-linux-gnu_sdk-buildroot/bin/aarch64-linux-g++ -S/home/psx/workspace/panelapp/buildapp/cmake_build -B/home/psx/workspace/panelapp/buildapp/cmake_build/build -G "Unix Makefiles"
[cmake] Not searching for unused variables given on the command line.
[cmake] -- ROOT_PATH : "/home/psx/workspace/panelapp/buildapp/cmake_build"
[cmake] -- APP_SRC_DIR : "/home/psx/workspace/panelapp/buildapp/cmake_build/src"
[cmake] -- DOC_DIR : "/home/psx/workspace/panelapp/buildapp/cmake_build/docs"
[cmake] -- SOURCE_PARENT_PATH : ""
[cmake] -- Configuring incomplete, errors occurred!
[cmake] See also "/home/psx/workspace/panelapp/buildapp/cmake_build/build/CMakeFiles/CMakeOutput.log".
[cmake] See also "/home/psx/workspace/panelapp/buildapp/cmake_build/build/CMakeFiles/CMakeError.log".
[cmake] CMake Error at CMakeLists.txt:30 (find_package):
[cmake]   By not providing "FindSDL2.cmake" in CMAKE_MODULE_PATH this project has
[cmake]   asked CMake to find a package configuration file provided by "SDL2", but
[cmake]   CMake did not find one.
[cmake] 
[cmake]   Could not find a package configuration file provided by "SDL2" with any of
[cmake]   the following names:
[cmake] 
[cmake]     SDL2Config.cmake
[cmake]     sdl2-config.cmake
[cmake] 
[cmake]   Add the installation prefix of "SDL2" to CMAKE_PREFIX_PATH or set
[cmake]   "SDL2_DIR" to a directory containing one of the above files.  If "SDL2"
[cmake]   provides a separate development package or SDK, be sure it has been
[cmake]   installed.
[cmake] 
[cmake] 
[proc] The command: /usr/bin/cmake --no-warn-unused-cli -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -DCMAKE_BUILD_TYPE:STRING=Debug -DCMAKE_C_COMPILER:FILEPATH=/opt/lnxshare/aarch64-buildroot-linux-gnu_sdk-buildroot/bin/aarch64-linux-gcc -DCMAKE_CXX_COMPILER:FILEPATH=/opt/lnxshare/aarch64-buildroot-linux-gnu_sdk-buildroot/bin/aarch64-linux-g++ -S/home/psx/workspace/panelapp/buildapp/cmake_build -B/home/psx/workspace/panelapp/buildapp/cmake_build/build -G "Unix Makefiles" exited with code: 1
[proc] The command: aarch64-linux-gcc -v failed with error: Error: spawn aarch64-linux-gcc ENOENT
[proc] The command: aarch64-linux-g++ -v failed with error: Error: spawn aarch64-linux-g++ ENOENT

Additional Information

No response

benmcmorran commented 1 year ago

Thanks for the report. To help us reproduce this issue, can you describe where you installed the aarch64-linux-gcc compiler from and provide the output of aarch64-linux-gcc -v and aarch64-linux-gcc --version on the command line (outside of VS Code)?

kay54068 commented 1 year ago

Hi @benmcmorran,

Thank you reply, I use the aarch64 bootlin toolchains. this a download link:

https://toolchains.bootlin.com/downloads/releases/toolchains/aarch64/tarballs/aarch64--glibc--bleeding-edge-2022.08-1.tar.bz2

is not support -v arg . >,<

benmcmorran commented 1 year ago

Thanks, we'll continue to investigate this issue.

herring-swe commented 10 months ago

check if it supports: -dumpfullversion -dumpversion (used in conjunction in this order) I found this to be most reliable of getting the version from GNU compilers since -v/--version may be of different formats.