MantisBT - CMake | |||||||||||||||
View Issue Details | |||||||||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||||||||
0015443 | CMake | CMake | public | 2015-03-13 04:42 | 2016-05-02 08:30 | ||||||||||
Reporter | David Demelier | ||||||||||||||
Assigned To | Brad King | ||||||||||||||
Priority | high | Severity | major | Reproducibility | always | ||||||||||
Status | closed | Resolution | fixed | ||||||||||||
Platform | OS | Windows | OS Version | 7 | |||||||||||
Product Version | CMake 3.2.1 | ||||||||||||||
Target Version | CMake 3.3 | Fixed in Version | CMake 3.3 | ||||||||||||
Summary | 0015443: Unable to use target_compile_features with MinGW-w64 | ||||||||||||||
Description | The following CMakeLists.txt generates an error on MinGW-w64: cmake_minimum_required(VERSION 3.2) project(test) add_executable(main main.cpp) target_compile_features( main PRIVATE cxx_constexpr ) This is the error: CMake Error at CMakeLists.txt:6 (target_compile_features): target_compile_features no known features for CXX compiler "GNU" version 4.9.2. | ||||||||||||||
Steps To Reproduce | 1. Try to use target_compile_features with MinGW-w64 | ||||||||||||||
Additional Information | It seems that Modules/Compiler/GNU-CXX.cmake has useless UNIX conditionals: Changing lines 47 and 50 to the following fix the problem: set(_result 0) if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8) _get_gcc_features(${CMAKE_CXX14_STANDARD_COMPILE_OPTION} CMAKE_CXX14_COMPILE_FEATURES) endif() if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.4) if (_result EQUAL 0) _get_gcc_features(${CMAKE_CXX11_STANDARD_COMPILE_OPTION} CMAKE_CXX11_COMPILE_FEATURES) endif() if (_result EQUAL 0) _get_gcc_features(${CMAKE_CXX98_STANDARD_COMPILE_OPTION} CMAKE_CXX98_COMPILE_FEATURES) endif() endif() Please note that MinGW-w64 fully supports C++11 and C++14. | ||||||||||||||
Tags | No tags attached. | ||||||||||||||
Relationships |
| ||||||||||||||
Attached Files | |||||||||||||||
Issue History | |||||||||||||||
Date Modified | Username | Field | Change | ||||||||||||
2015-03-13 04:42 | David Demelier | New Issue | |||||||||||||
2015-03-13 08:24 | Brad King | Target Version | => CMake 3.3 | ||||||||||||
2015-03-17 14:37 | Brad King | Note Added: 0038233 | |||||||||||||
2015-03-17 14:37 | Brad King | Assigned To | => Brad King | ||||||||||||
2015-03-17 14:37 | Brad King | Status | new => resolved | ||||||||||||
2015-03-17 14:37 | Brad King | Resolution | open => fixed | ||||||||||||
2015-03-17 14:37 | Brad King | Fixed in Version | => CMake 3.3 | ||||||||||||
2015-09-09 09:28 | Brad King | Relationship added | has duplicate 0015727 | ||||||||||||
2015-09-09 09:29 | Brad King | Relationship replaced | related to 0015727 | ||||||||||||
2016-01-07 15:05 | Brad King | Relationship added | related to 0015897 | ||||||||||||
2016-05-02 08:30 | Robert Maynard | Note Added: 0040994 | |||||||||||||
2016-05-02 08:30 | Robert Maynard | Status | resolved => closed |
Notes | |||||
|
|||||
|
|
||||
|
|||||
|
|