2016-02-29 108 views
1

我正在尝试使用cmakeclangVS14Clang 3.7来构建一个简单的hello-world程序。C++:使用Clang和VS14设置DebugInformationFormat

cmake ../src -G "Visual Studio 14 2015" -T "v140_clang_3_7" 

CMakeLists.txt如下所示:

cmake_minimum_required(VERSION 2.8.9) 
project (test) 
add_executable(test testfile.cpp) 

我得到DebugInformationFormat其值不正确的错误:

C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.Cpp.Clang 
.targets(206,5): error : Element <DebugInformationFormat> has an value of 
"ProgramDatabase". [...\build\CMakeFiles\CMakeTmp\cmTC_c45da.vcxproj] 

我做了一些研究,并试图覆盖缺省值我的CMakeLists.txt没有成功

set (CMAKE_CXX_FLAGS "-g2 -gdwarf-2") 

无论我试过到目前为止,没有工作了(当然我每天打扫一次新的CMake之前构建目录)

回答

1

我与CMake的,VS15,锵3.7构建项目同样的问题。

我刚刚为windows窗体获得了LLVM snapshotbuild http://llvm.org/builds/ 安装了最新版本的clang(在编写v3.9.0时)。

安装后属性 - >常规 - >平台工具 - > LLVM-vs2014(切换到LLVM-vs2014),然后构建。