diff options
author | Christian Pfeiffer <cpfeiffer@live.de> | 2018-07-11 13:59:10 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2018-07-12 13:35:50 (GMT) |
commit | 735e69f4458850cc335710af36d1382b891cbb5e (patch) | |
tree | a2ba3e451cc0e1244ea3d22a76a7d4cfa99b1c5d /Modules/Compiler/Intel-CXX.cmake | |
parent | f974000d93798af1e3bd183985ec6f5159664f76 (diff) | |
download | CMake-735e69f4458850cc335710af36d1382b891cbb5e.zip CMake-735e69f4458850cc335710af36d1382b891cbb5e.tar.gz CMake-735e69f4458850cc335710af36d1382b891cbb5e.tar.bz2 |
Intel: Fix incorrectly documented extension flags
Fixes: #18166
Diffstat (limited to 'Modules/Compiler/Intel-CXX.cmake')
-rw-r--r-- | Modules/Compiler/Intel-CXX.cmake | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/Modules/Compiler/Intel-CXX.cmake b/Modules/Compiler/Intel-CXX.cmake index d9c5749..c115b6a 100644 --- a/Modules/Compiler/Intel-CXX.cmake +++ b/Modules/Compiler/Intel-CXX.cmake @@ -36,18 +36,21 @@ else() if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 18.0.0) set(CMAKE_CXX17_STANDARD_COMPILE_OPTION "-std=c++17") - # todo: there is no gnu++17 value supported; figure out what to do - set(CMAKE_CXX17_EXTENSION_COMPILE_OPTION "-std=c++17") + set(CMAKE_CXX17_EXTENSION_COMPILE_OPTION "-std=gnu++17") endif() if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 15.0.2) set(CMAKE_CXX14_STANDARD_COMPILE_OPTION "-std=c++14") - # todo: there is no gnu++14 value supported; figure out what to do - set(CMAKE_CXX14_EXTENSION_COMPILE_OPTION "-std=c++14") elseif (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 15.0.0) set(CMAKE_CXX14_STANDARD_COMPILE_OPTION "-std=c++1y") - # todo: there is no gnu++14 value supported; figure out what to do - set(CMAKE_CXX14_EXTENSION_COMPILE_OPTION "-std=c++1y") + endif() + + # Intel 15.0.2 accepts c++14 instead of c++1y, but not gnu++14 + # instead of gnu++1y. Intel 17.0.0 accepts gnu++14 too. + if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 17.0) + set(CMAKE_CXX14_EXTENSION_COMPILE_OPTION "-std=gnu++14") + elseif (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 15.0.0) + set(CMAKE_CXX14_EXTENSION_COMPILE_OPTION "-std=gnu++1y") endif() if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 13.0) |