-
Notifications
You must be signed in to change notification settings - Fork 468
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
How to get cmake-tools work with toolchain installation (like MSYS2) without putting the whole toolchain on PATH
?
#2447
Comments
PATH
?
Just to make sure we're talking about the same thing... When you say "toolchain" are you talking about CMake Toolchains, or are you referring to the compiler? We don't have any sort of CMake toolchain detection. These always require creating a "Kit" to establish (or use the If you add |
When I said "toolchain" I mean the
Will try that soon.
I have no idea how this works, but kit creation is something I don't know and having just the path entered and cmak-tools finds "everything" seems more desireable, thats why I like the using |
Is I use this toolchain: https://github.com/mstorsjo/llvm-mingw This works well for building. But the dependencies for executing my application are in the toolchain/x86_64-w64-mingw32 directory. (In this case libc++.dll and libunwind.dll, which contain the mingw64 crt runtime. These are equivalent to msys-2.0.dll that you need to execute msys 2 built programs) So when I switch compilers I still have to exit VSCode and make it set the correct path to my runtime DLLs, which is pretty annoying. (Or I copy them over to CWD and risk using the wrong versions after switching compilers. Or I link statically, which I can't for other reasons.) What I am looking for is a a |
Looking at the code, it should be merged into PATH for configure/build/debug/launch/ctest. (i.e. PATH = %PATH%;%CMT_MINGW_PATH%). I believe build/launch started getting it in 1.10. If you're not seeing that, please let us know.
If this is happening, it sounds like a bug. The environment should be tied to the active Kit and I'm not currently aware of a case where the environment leaks across Kits. |
I was referring to my current config, where I do not use CMT_MINGW_PATH |
I can't. Where do I add/set this? I do not use kits in a way I am aware of. |
I think the best would be, if a user could define the terminal, in which cmake should be called. Also, it would be good, to make the cmake executable configurable in the cmake kits. Like:
with
|
I second @Febbe's idea of being able to specify in which shell CMake is run. MSYS2 offers various MSYSTEMs where the environment is more or less completely configured for you, so why can't we just use that? |
MSYS sets the `MSYSTEM` and `MSYSTEM_PREFIX` environment variables, which are used by CMake to configure MSYS builds. In addition, the non-MSYS environment may or may not contain the MSYS paths in its PATH. However, many of the binaries provided by the MSYS shell are necessary in order to properly configure many projects. In addition, these binaries should always take precedence over the rest of the system as this is how MSYS configures them. Fixes microsoft#2447
I made a PR to add |
MSYS sets the `MSYSTEM` and `MSYSTEM_PREFIX` environment variables, which are used by CMake to configure MSYS builds. In addition, the non-MSYS environment may or may not contain the MSYS paths in its PATH. However, many of the binaries provided by the MSYS shell are necessary in order to properly configure many projects. In addition, these binaries should always take precedence over the rest of the system as this is how MSYS configures them. Fixes microsoft#2447
MSYS sets the `MSYSTEM` and `MSYSTEM_PREFIX` environment variables, which are used by CMake to configure MSYS builds. In addition, the non-MSYS environment may or may not contain the MSYS paths in its PATH. However, many of the binaries provided by the MSYS shell are necessary in order to properly configure many projects. In addition, these binaries should always take precedence over the rest of the system as this is how MSYS configures them. Fixes microsoft#2447
@Steelskin Thank you for the PR! We are admittedly slightly behind on reviewing PR's, we hope to get to this soon. Thank you for your patience. |
MSYS sets the `MSYSTEM` and `MSYSTEM_PREFIX` environment variables, which are used by CMake to configure MSYS builds. In addition, the non-MSYS environment may or may not contain the MSYS paths in its PATH. However, many of the binaries provided by the MSYS shell are necessary in order to properly configure many projects. In addition, these binaries should always take precedence over the rest of the system as this is how MSYS configures them. Fixes microsoft#2447
Brief Issue Summary
I cannot get cmake-tools to work with a toolchain installation (like MSYS2) without putting the whole toolchain on the
PATH
.The only way to get cmake-tools work with the MSYS2 installation in the standard installation folder
C:\msys64\mingw64\bin
is to add it to thePATH
variable (of the user) outside vscode.That is fine as long as there are no multiple toolchains in different versions used. vscode would detect them and lets one select the right one, but other tools are different.
Maybe this is something to talk about because this might be the wrong view on things. Perhaps I should expect other tools to handle such a situation correctly and stop using tools that don't. But sometimes you may want a specific toolchain to be on the path for a terminal to just call cmake and then it might be the wrong cmake version.
There seem to be many other ways to make the cmake tools kit search detect kits. I am unable to get one of them working. They are:
cmake-kits.json
(This is something I would rather not use since there is a detecting mechanism that can define the settings better than I can do manually)Before one wants to go into details on each of the other possibilities and why they don't work for me, can we please discuss in general:
PATH
variable?PATH
: Why is that not a problem with other tools using thePATH
variable?CMake Tools Diagnostics
Logs as needed, this is more a question currently
Debug Log
Logs as needed, this is more a question currently
The text was updated successfully, but these errors were encountered: