2016-02-29 106 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),然後構建。