View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0015986CMakeCMakepublic2016-02-24 11:242016-06-10 14:21
ReporterGregor Jasny 
Assigned ToBrad King 
PriorityhighSeveritymajorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product VersionCMake 3.5 
Target VersionCMake 3.5Fixed in VersionCMake 3.5 
Summary0015986: Visual Studio 2015 does not work with v120 toolset
DescriptionHello,

today I tried to use Visual Studio 2015 to build with the VS2013 (v120) toolset.

Unfortunately I get the following error:

-- The C compiler identification is MSVC 18.0.40629.0
-- The CXX compiler identification is MSVC 18.0.40629.0
-- Check for working C compiler using: Visual Studio 14 2015
-- Check for working C compiler using: Visual Studio 14 2015 -- broken
CMake Error at C:/Program Files (x86)/CMake/share/cmake-3.5/Modules/CMakeTestCCompiler.cmake:61 (message):
  The C compiler "C:/Program Files (x86)/Microsoft Visual Studio
  12.0/VC/bin/cl.exe" is not able to compile a simple test program.

It properly works in the "same" toolchain pairing:
-G "Visual Studio 12 2013" -T v120
-G "Visual Studio 14 2015" -T v140

Thanks,
Gregor
Steps To ReproduceCMakeLists.txt containing just:
  project(VS2015Test C CXX)

Configure:
"c:\Program Files (x86)\CMake\bin\cmake.exe" -G "Visual Studio 14 2015" -T v120 ..

Additional InformationC:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets(639,9): error MSB4030: "Debug" is an invalid value for the "GenerateDebugInformation" parameter of the "Link" task. The "GenerateDebugInformation" parameter is of type "System.Boolean". [C:\Users\gregorj\devtrees\vs2015test\_build\CMakeFiles\CMakeTmp\cmTC_05d1a.vcxproj]
TagsNo tags attached.
Attached Fileslog file icon CMakeError.log [^] (3,141 bytes) 2016-02-24 11:24

 Relationships
related to 0015894closedBrad King Visual C++ 2015 Generator wrong output for debug information 

  Notes
(0040533)
Brad King (manager)
2016-02-24 11:35

Yes, the change linked in 0015894:0040163:

 VS: Fix VS 2015 .vcxproj file value for GenerateDebugInformation
 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f086c665 [^]

appears to be responsible for this. It seems that the proper choice depends on the toolset rather than the version of VS. Unfortunately this may mean we now have to memorize information about each toolset value.
(0040534)
Brad King (manager)
2016-02-24 12:36

Here is a hack to fix this particular use case:

 VS: Fix VS 2015 .vcxproj debug setting for older toolsets
 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=dc422d27 [^]

More work will be needed to fix this properly by making flag map selection be based on the toolset.
(0040535)
Brad King (manager)
2016-02-24 12:49

I've queued this for merge to 'release' for inclusion in 3.5. Meanwhile place check that the fix linked in 0015986:0040534 works. It should be included in the next nightly binary to appear:

 https://cmake.org/files/dev/?C=M;O=D [^]
(0040545)
Gregor Jasny (developer)
2016-02-25 03:34

Seems the nightly Windows build fails since February 22nd.
(0040547)
Gregor Jasny (developer)
2016-02-25 04:37

The fix seems to work properly:
C:\Users\gregorj\devtrees\vs2015test\_bp>c:\Users\gregorj\devtrees\cmake\_build\bin\Debug\cmake.exe 
-G "Visual Studio 14 2015" -T v120 ..
-- The C compiler identification is MSVC 18.0.40629.0
-- The CXX compiler identification is MSVC 18.0.40629.0
-- Check for working C compiler using: Visual Studio 14 2015
-- Check for working C compiler using: Visual Studio 14 2015 -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler using: Visual Studio 14 2015
-- Check for working CXX compiler using: Visual Studio 14 2015 -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- C compiler C:/Program Files (x86)/Microsoft Visual Studio 12.0/VC/bin/cl.exe
-- C++ compiler C:/Program Files (x86)/Microsoft Visual Studio 12.0/VC/bin/cl.exe
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/gregorj/devtrees/vs2015test/_bp


But I find the "Check for working C compiler using: Visual Studio 14 2015" line confusing. Maybe you could add the used toolset in brackets behind.
(0040548)
Brad King (manager)
2016-02-25 08:52

Re 0015986:0040547: Great, thanks for testing.

> But I find the "Check for working C compiler using: Visual Studio 14 2015" line confusing. Maybe you could add the used toolset in brackets behind.

That is historical behavior left from when we didn't detect the full path to the compiler on VS generators and VS only had one compiler per version. Updated:

 Improve compiler check message on non-Make generators
 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f3ac0651 [^]
(0040597)
Paulw (reporter)
2016-03-04 10:50

Same issue with the vs 2010 (v100) toolset. Can you please add it you your hack (I saw only v110 and v120 in your code). Also, note that Microsoft has the same problem so it may be worth talking to them. If I have a solution compiled in 2015 and I switch the toolset to 2010 using the VS GUI, it puts an invalid value in the linker DEBUG option, so build fails with exactly the same notification as when CMAKE tries to build with 2010. Maybe the final fix should reside in Visual Studio??
(0040635)
Brad King (manager)
2016-03-07 10:33

Re 0015986:0040597: Thanks. I extended the fix for v100:

 VS: Fix VS 2015 .vcxproj debug setting for v100 toolset
 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3f15665a [^]
(0040647)
Brad King (manager)
2016-03-08 08:42

Combined fix backported to 'release' branch:

 VS: Fix VS 2015 .vcxproj debug setting for older toolsets
 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3aa6fea6 [^]
(0041232)
Kitware Robot (administrator)
2016-06-10 14:21

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.

 Issue History
Date Modified Username Field Change
2016-02-24 11:24 Gregor Jasny New Issue
2016-02-24 11:24 Gregor Jasny File Added: CMakeError.log
2016-02-24 11:30 Gregor Jasny Relationship added related to 0015894
2016-02-24 11:35 Brad King Note Added: 0040533
2016-02-24 11:36 Brad King Target Version => CMake 3.5
2016-02-24 12:36 Brad King Note Added: 0040534
2016-02-24 12:49 Brad King Note Added: 0040535
2016-02-24 12:49 Brad King Assigned To => Brad King
2016-02-24 12:49 Brad King Status new => resolved
2016-02-24 12:49 Brad King Resolution open => fixed
2016-02-24 12:49 Brad King Fixed in Version => CMake 3.5
2016-02-25 03:34 Gregor Jasny Note Added: 0040545
2016-02-25 04:37 Gregor Jasny Note Added: 0040547
2016-02-25 08:52 Brad King Note Added: 0040548
2016-03-04 10:50 Paulw Note Added: 0040597
2016-03-07 10:33 Brad King Note Added: 0040635
2016-03-08 08:42 Brad King Note Added: 0040647
2016-06-10 14:21 Kitware Robot Note Added: 0041232
2016-06-10 14:21 Kitware Robot Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team