Arik-Playground / LlvmForVS2017

props & target files so you could use clang with vs2017 standard library
MIT License
16 stars 3 forks source link

The toolset is not detected #5

Open mmatrosov opened 6 years ago

mmatrosov commented 6 years ago

I copied files according to instructions, but toolset LLVM-vs2017 did not appear in the list of toolsets. If I set this toolset manually, MSBuild complaints that this toolset is not installed.

Visual Studio Community 2017 15.6.2

Arik-Playground commented 6 years ago

Well for me its working fine (and I also using 15.6.2), can you upload a screenshot of the toolset directory?

mmatrosov commented 6 years ago

Here you go:

C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Platforms>tree /F
Folder PATH listing for volume system
Volume serial number is C4BA-6BCF
C:.
├───ARM
│   │   Platform.Common.props
│   │   Platform.Default.props
│   │   Platform.props
│   │   Platform.targets
│   │
│   └───PlatformToolsets
│       ├───v141
│       │       Toolset.props
│       │       Toolset.targets
│       │
│       └───v141_clang_c2
│               Toolset.props
│               Toolset.targets
│
├───Win32
│   │   Platform.Common.props
│   │   Platform.Default.props
│   │   Platform.props
│   │   Platform.targets
│   │
│   ├───LLVM-vs2017
│   │       toolset.props
│   │       toolset.targets
│   │
│   └───PlatformToolsets
│       ├───v141
│       │       Toolset.props
│       │       Toolset.targets
│       │
│       └───v141_clang_c2
│               Toolset.props
│               Toolset.targets
│
└───x64
    │   Platform.Common.props
    │   Platform.Default.props
    │   Platform.props
    │   Platform.targets
    │
    ├───LLVM-vs2017
    │       toolset.props
    │       toolset.targets
    │
    └───PlatformToolsets
        ├───v141
        │       Toolset.props
        │       Toolset.targets
        │
        └───v141_clang_c2
                Toolset.props
                Toolset.targets

This is the error I get from MSBuild:

1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.Cpp.Redirect.14.props(47,3): error MSB4019: The imported project "C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.cpp.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.

And here is content of corresponding directory (I also copied your files there - with no luck):

C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140>tree /F
Folder PATH listing for volume system
Volume serial number is C4BA-6BCF
C:.
├───ImportBefore
│   └───Default
│           vcpkg.system.props
│
└───Platforms
    ├───Win32
    │   └───PlatformToolsets
    │       ├───LLVM-vs2014
    │       │       toolset.props
    │       │       toolset.targets
    │       │
    │       ├───LLVM-vs2014_xp
    │       │       toolset.props
    │       │       toolset.targets
    │       │
    │       └───LLVM-vs2017
    │               toolset.props
    │               toolset.targets
    │
    └───x64
        └───PlatformToolsets
            ├───LLVM-vs2014
            │       toolset.props
            │       toolset.targets
            │
            ├───LLVM-vs2014_xp
            │       toolset.props
            │       toolset.targets
            │
            └───LLVM-vs2017
                    toolset.props
                    toolset.targets
Arik-Playground commented 6 years ago

weird... it looks like the visual studio toolsets installed in a different place... I didn't know it could happen ;( is your LLVM-vs2014 toolset works? if so, can I see the content of one of the props files of this toolset?

mmatrosov commented 6 years ago

Unfortunately, LLVM-vs2014 fails with the same error :(

Arik-Playground commented 6 years ago

And normal visual studio c++ projects work without any problem?

mmatrosov commented 6 years ago

Exactly. And I can't say my installation is abnormal in any way.

Arik-Playground commented 6 years ago

Can you use procmon to see from where msbuild is getting the correct toolsets when using a normal VS project? you should filter to show access to a path that contains Toolset.props

mmatrosov commented 6 years ago

I've run procmon, recorded all files accessed by devenv.exe, removed everything except those that have .props extension and removed duplicates. Here is what I got:

C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.Cl.Common.props
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CodeAnalysis.Extensions.props
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CodeAnalysis.props
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.Cpp.Common.props
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.Cpp.CoreWin.props
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.Cpp.Default.props
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.Cpp.pginstrument.props
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.Cpp.pgoptimize.props
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.Cpp.pgupdate.props
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.Cpp.Platform.props
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.Cpp.props
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.Cpp.unicodesupport.props
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.Cpp.UnitTest.props
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.Cpp.WholeProgramOptimization.props
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.Cpp.WindowsSDK.props
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.Link.Common.props
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Platforms\x64\Platform.Common.props
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Platforms\x64\Platform.Default.props
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Platforms\x64\Platform.props
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Platforms\x64\PlatformToolsets\v141\Toolset.props
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\Microsoft.NetFramework.CurrentVersion.props
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\Microsoft.NetFramework.props
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Imports\Microsoft.Common.Props\ImportBefore\Microsoft.NuGet.ImportBefore.props
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Microsoft.Common.props
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Microsoft\NuGet\15.0\Microsoft.NuGet.props
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\v15.0\Custom.After.Microsoft.Common.props
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\v15.0\Custom.Before.Microsoft.Common.props
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\Microsoft.VCToolsVersion.default.props
C:\Program Files (x86)\Windows Kits\10\DesignTime\CommonConfiguration\Neutral\UAP\10.0.16299.0\UAP.arm.props
C:\Program Files (x86)\Windows Kits\10\DesignTime\CommonConfiguration\Neutral\UAP\10.0.16299.0\UAP.desktop.arm.props
C:\Program Files (x86)\Windows Kits\10\DesignTime\CommonConfiguration\Neutral\UAP\10.0.16299.0\UAP.props
C:\Program Files (x86)\Windows Kits\10\DesignTime\CommonConfiguration\Neutral\uCRT.props
C:\Users\Mikhail\AppData\Local\Microsoft\MSBuild\v4.0\Microsoft.Cpp.x64.user.props
C:\Users\Mikhail\AppData\Local\vcpkg\vcpkg.user.props
zufuliu commented 6 years ago

A install batch can found at https://github.com/zufuliu/llvm-utils