Intel-CXX.cmake 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. include(Compiler/Intel)
  2. __compiler_intel(CXX)
  3. string(APPEND CMAKE_CXX_FLAGS_MINSIZEREL_INIT " -DNDEBUG")
  4. string(APPEND CMAKE_CXX_FLAGS_RELEASE_INIT " -DNDEBUG")
  5. string(APPEND CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT " -DNDEBUG")
  6. set(CMAKE_DEPFILE_FLAGS_CXX "-MD -MT <OBJECT> -MF <DEPFILE>")
  7. if("x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC")
  8. set(CMAKE_CXX_CLANG_TIDY_DRIVER_MODE "cl")
  9. if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 18.0.0)
  10. set(CMAKE_CXX17_STANDARD_COMPILE_OPTION "-Qstd=c++17")
  11. set(CMAKE_CXX17_EXTENSION_COMPILE_OPTION "-Qstd=c++17")
  12. endif()
  13. if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 16.0)
  14. set(CMAKE_CXX14_STANDARD_COMPILE_OPTION "-Qstd=c++14")
  15. set(CMAKE_CXX14_EXTENSION_COMPILE_OPTION "-Qstd=c++14")
  16. endif()
  17. if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 13.0)
  18. set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "-Qstd=c++11")
  19. set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "-Qstd=c++11")
  20. elseif (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 12.1)
  21. set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "-Qstd=c++0x")
  22. set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "-Qstd=c++0x")
  23. endif()
  24. if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 12.1)
  25. set(CMAKE_CXX98_STANDARD_COMPILE_OPTION "")
  26. set(CMAKE_CXX98_EXTENSION_COMPILE_OPTION "")
  27. set(CMAKE_CXX98_STANDARD__HAS_FULL_SUPPORT ON)
  28. endif()
  29. else()
  30. if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 18.0.0)
  31. set(CMAKE_CXX17_STANDARD_COMPILE_OPTION "-std=c++17")
  32. set(CMAKE_CXX17_EXTENSION_COMPILE_OPTION "-std=gnu++17")
  33. endif()
  34. if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 17.0)
  35. set(CMAKE_CXX14_STANDARD__HAS_FULL_SUPPORT ON)
  36. endif()
  37. if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 15.0.2)
  38. set(CMAKE_CXX14_STANDARD_COMPILE_OPTION "-std=c++14")
  39. elseif (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 15.0.0)
  40. set(CMAKE_CXX14_STANDARD_COMPILE_OPTION "-std=c++1y")
  41. endif()
  42. # Intel 15.0.2 accepts c++14 instead of c++1y, but not gnu++14
  43. # instead of gnu++1y. Intel 17.0.0 accepts gnu++14 too.
  44. if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 17.0)
  45. set(CMAKE_CXX14_EXTENSION_COMPILE_OPTION "-std=gnu++14")
  46. elseif (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 15.0.0)
  47. set(CMAKE_CXX14_EXTENSION_COMPILE_OPTION "-std=gnu++1y")
  48. endif()
  49. if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 15.0)
  50. set(CMAKE_CXX11_STANDARD__HAS_FULL_SUPPORT ON)
  51. endif()
  52. if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 13.0)
  53. set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "-std=c++11")
  54. set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "-std=gnu++11")
  55. elseif (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 12.1)
  56. set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "-std=c++0x")
  57. set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "-std=gnu++0x")
  58. endif()
  59. if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 12.1)
  60. set(CMAKE_CXX98_STANDARD_COMPILE_OPTION "-std=c++98")
  61. set(CMAKE_CXX98_EXTENSION_COMPILE_OPTION "-std=gnu++98")
  62. set(CMAKE_CXX98_STANDARD__HAS_FULL_SUPPORT ON)
  63. endif()
  64. endif()
  65. __compiler_check_default_language_standard(CXX 12.1 98)
  66. set(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE "<CMAKE_CXX_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
  67. set(CMAKE_CXX_CREATE_ASSEMBLY_SOURCE "<CMAKE_CXX_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>")