MantisBT - CMake | |||||||||||||||
View Issue Details | |||||||||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||||||||
0015897 | CMake | CMake | public | 2016-01-01 10:10 | 2016-06-10 14:21 | ||||||||||
Reporter | Paul "TBBle" Hampson | ||||||||||||||
Assigned To | Brad King | ||||||||||||||
Priority | normal | Severity | minor | Reproducibility | always | ||||||||||
Status | closed | Resolution | fixed | ||||||||||||
Platform | Mingw64/msys2 | OS | Windows | OS Version | 10 | ||||||||||
Product Version | CMake 3.4.1 | ||||||||||||||
Target Version | CMake 3.5 | Fixed in Version | CMake 3.5 | ||||||||||||
Summary | 0015897: Clang CXX feature detection disabled on WIN32 platforms | ||||||||||||||
Description | When using clang from mingw64 under msys, the supplied repro case fails with: CMake Error at CMakeLists.txt:12 (target_compile_features): target_compile_features no known features for CXX compiler "Clang" version 3.7.0. This is because when Clang C++ feature detection support was added in https://cmake.org/gitweb?p=cmake.git;a=commit;h=cda233194f9caab8867b2451f3d859080a233d45 [^] (specifically Modules/Compiler/Clang-CXX.cmake, although Modules/Compiler/Clang-C.cmake has the same conditions) the following was done: * The condition to bail out detecting a -std= flag for clang was expanded to also cover WIN32 (This breaks the CXX_STANDARD property) - line 9 * If not UNIX, no compiler features are recorded (This breaks target_compile_features) - line 52 It's not clear why these conditions were used, perhaps there's some interaction with clang-cl (Clang emulating MSVC)? If that was the case, then the first condition should be changed to test that, as done earlier in the file, rather than blocking all WIN32-based clang compilers. | ||||||||||||||
Steps To Reproduce | Given CMakeLists.txt: cmake_minimum_required(VERSION 3.4.1 FATAL_ERROR) project(test1 CXX) # Globally C++11 set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD_REQUIRED ON) file(WRITE test1.cpp "int main(int argc, char** argv) {auto x=argc; return x;}") add_executable(test1 test1.cpp) target_compile_features(test1 PRIVATE cxx_auto_type) Running the following in the MINGW64 environment of msys2 works: CXX=g++ cmake .. -G"MSYS Makefiles" && cmake --build . but the following fails to generate: CXX=clang++ cmake .. -G"MSYS Makefiles" && cmake --build . If the target_compile_features directive is removed, then both generate, but the latter will fail to build, noting that 'auto' is a C++11 feature. Test based on https://cmake.org/pipermail/cmake/2015-January/059593.html [^] | ||||||||||||||
Additional Information | I tested that removing the WIN32 and UNIX parts of the conditionals I mentioned got MSYS working, but I don't happen to have clang-cl installed to verify that it wasn't broken by doing this. | ||||||||||||||
Tags | No tags attached. | ||||||||||||||
Relationships |
| ||||||||||||||
Attached Files | |||||||||||||||
Issue History | |||||||||||||||
Date Modified | Username | Field | Change | ||||||||||||
2016-01-01 10:10 | Paul "TBBle" Hampson | New Issue | |||||||||||||
2016-01-07 15:05 | Brad King | Relationship added | related to 0015443 | ||||||||||||
2016-01-07 15:08 | Brad King | Note Added: 0040147 | |||||||||||||
2016-01-10 23:35 | Paul "TBBle" Hampson | Note Added: 0040174 | |||||||||||||
2016-01-11 10:19 | Brad King | Note Added: 0040182 | |||||||||||||
2016-01-11 10:20 | Brad King | Assigned To | => Brad King | ||||||||||||
2016-01-11 10:20 | Brad King | Status | new => resolved | ||||||||||||
2016-01-11 10:20 | Brad King | Resolution | open => fixed | ||||||||||||
2016-01-11 10:20 | Brad King | Fixed in Version | => CMake 3.5 | ||||||||||||
2016-01-11 10:20 | Brad King | Target Version | => CMake 3.5 | ||||||||||||
2016-01-29 13:27 | Brad King | Relationship added | related to 0015943 | ||||||||||||
2016-06-10 14:21 | Kitware Robot | Note Added: 0041272 | |||||||||||||
2016-06-10 14:21 | Kitware Robot | Status | resolved => closed |
Notes | |||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|