diff options
author | Brad King <brad.king@kitware.com> | 2018-07-13 12:54:30 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2018-07-13 12:54:47 (GMT) |
commit | 0d72c50d29e81789396cab9c515e90ba1e014150 (patch) | |
tree | 4b60a2e923a2a5bb8db68913aaf574031c4caed9 /Modules/Compiler | |
parent | 718d2f8f1619e6c3a2ae3bd8796ac8dbb27f36c6 (diff) | |
parent | 735e69f4458850cc335710af36d1382b891cbb5e (diff) | |
download | CMake-0d72c50d29e81789396cab9c515e90ba1e014150.zip CMake-0d72c50d29e81789396cab9c515e90ba1e014150.tar.gz CMake-0d72c50d29e81789396cab9c515e90ba1e014150.tar.bz2 |
Merge topic 'intel-std-fix'
735e69f445 Intel: Fix incorrectly documented extension flags
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2206
Diffstat (limited to 'Modules/Compiler')
-rw-r--r-- | Modules/Compiler/Intel-C.cmake | 3 | ||||
-rw-r--r-- | Modules/Compiler/Intel-CXX.cmake | 15 |
2 files changed, 10 insertions, 8 deletions
diff --git a/Modules/Compiler/Intel-C.cmake b/Modules/Compiler/Intel-C.cmake index 3e0439fa..4e4af29 100644 --- a/Modules/Compiler/Intel-C.cmake +++ b/Modules/Compiler/Intel-C.cmake @@ -25,8 +25,7 @@ else() if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 15.0.0) set(CMAKE_C11_STANDARD_COMPILE_OPTION "-std=c11") - # todo: there is no gnu11 value supported; figure out what to do - set(CMAKE_C11_EXTENSION_COMPILE_OPTION "-std=c11") + set(CMAKE_C11_EXTENSION_COMPILE_OPTION "-std=gnu11") endif() if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 12.0) 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) |