-
Notifications
You must be signed in to change notification settings - Fork 429
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
Unable to detect clang shipped with visual studio 2019 #914
Comments
@elegracer Put |
@Zingam |
What does the Kit entry look like? (run the "CMake: Edit User-local CMake Kits" command) I modified one of the existing Clang for MSVC ones and was able to make it work -- though I did have trouble using anything other than x86.
|
@elegracer Sorry! My mistake: you need to set PATH to the location of the clang executable. https://docs.microsoft.com/en-us/cpp/build/clang-support-msbuild?view=vs-2019
|
@bobbrow Yes, exactly as yours, only x86 can be used, nothing else, but I just want to build it to x64 |
@bobbrow The more detailed trouble I faced was, I installed
Even if I modified the |
@elegracer I don't think that your last issue with OpenCV is related to the extension. I assume that you need to tell CMake where to look for packages. Do you use vcpkg? |
The VS2019 Clang yields:
This is apparently a 32bit LLVM/Clang. The 64bit LLVM distribution:
This is the 64-bit LLVM/Clang. I removed the LLVM distribution and installed the one included in VS2019. I added When I tried to configure the CMake project I got the following output:
Then I deleted the CMake build (cache) directory manually and the configuration and the build succeeded. |
I don't think that there is a real issue with the bundled Clang. Just in case I'm attaching the CMake projects for later reference: |
@bobbrow If we have multiple installation of a compiler and the extension finds them I guess all will get the same name (I need to check the source code if that is really the case). How would we really make the users to differentiate the kits and let them pick a specific installation they may wish? Unlike what VS2019 does in a similar situation, the QuckPick doesn't seem to support multi-line items. |
@Zingam |
@elegracer What I claim is that the bundled Clang is a 32bit executable. There are two installers here: I don't really know about the cross-compilation capabilities of Clang but you could read about it here: At a first glance I think a 32 bit compiler can target 64bit executables too but the extension seems to create kits based on the bit-ness of the compiler only. So for now you probably need to install the 64bit Clang if you want to compile 64bit targets. If you play with cmake-tool-kits.json and manage to figure out any working configurations, please let me know. I may look into fixing this too at some point after I finish all other things I'd like to work on with higher priority. |
@Zingam |
The PR for this is committed. Thanks @Zingam !
I believe the bundled clang kits already have differentiated names. Are there other name collisions we should be aware of? |
Closing since this is fixed in CMake Tools Beta2. Please reactivate if you encounter any other symptoms of this issue. |
Brief Issue Summary
I installed visual studio 2019, clang compiler with it, so I have these 2 directories
I also installed vcpkg, and installed only several packages with architecture
x64-windows
, e.g.opencv:x64-windows
.I tried to bulid my cmake project with clang-cl frontend and msvc backend, but the first step got stuck. Only these 6 kits were detected (Fresh output from vscode-cmake-tools 1.2.2, there weren't those preferredGenerator settings yesterday)
I could not find any clang related kits, so I could not build it as I wished.
Expected:
x64-windows
packages installed.Apparent Behavior:
No clang related kits with different target architectures (e.g. x86 x64 e.t.c) were detected,
CMake Tools Log
Clean
cmake-tool-kits.json
and runscan for kits
(truncated due to 65535 characters limit):Developer Tools Log
Basicly same as the cmake-tools log.
Platform and Versions
Other Notes/Information
Clean Windows 10 Business Edition 1909, no MinGW, GCC, Standalone Clang or any other independent compiler.
Git and CMake are installed from Visual Studio.
The text was updated successfully, but these errors were encountered: