Intel-CXX.cmake 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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. if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 18.0.0)
  9. set(CMAKE_CXX17_STANDARD_COMPILE_OPTION "-Qstd=c++17")
  10. set(CMAKE_CXX17_EXTENSION_COMPILE_OPTION "-Qstd=c++17")
  11. endif()
  12. if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 16.0)
  13. set(CMAKE_CXX14_STANDARD_COMPILE_OPTION "-Qstd=c++14")
  14. set(CMAKE_CXX14_EXTENSION_COMPILE_OPTION "-Qstd=c++14")
  15. endif()
  16. if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 13.0)
  17. set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "-Qstd=c++11")
  18. set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "-Qstd=c++11")
  19. elseif (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 12.1)
  20. set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "-Qstd=c++0x")
  21. set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "-Qstd=c++0x")
  22. endif()
  23. if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 12.1)
  24. set(CMAKE_CXX98_STANDARD_COMPILE_OPTION "")
  25. set(CMAKE_CXX98_EXTENSION_COMPILE_OPTION "")
  26. set(CMAKE_CXX98_STANDARD__HAS_FULL_SUPPORT ON)
  27. endif()
  28. else()
  29. if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 18.0.0)
  30. set(CMAKE_CXX17_STANDARD_COMPILE_OPTION "-std=c++17")
  31. set(CMAKE_CXX17_EXTENSION_COMPILE_OPTION "-std=gnu++17")
  32. endif()
  33. if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 17.0)
  34. set(CMAKE_CXX14_STANDARD__HAS_FULL_SUPPORT ON)
  35. endif()
  36. if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 15.0.2)
  37. set(CMAKE_CXX14_STANDARD_COMPILE_OPTION "-std=c++14")
  38. elseif (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 15.0.0)
  39. set(CMAKE_CXX14_STANDARD_COMPILE_OPTION "-std=c++1y")
  40. endif()
  41. # Intel 15.0.2 accepts c++14 instead of c++1y, but not gnu++14
  42. # instead of gnu++1y. Intel 17.0.0 accepts gnu++14 too.
  43. if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 17.0)
  44. set(CMAKE_CXX14_EXTENSION_COMPILE_OPTION "-std=gnu++14")
  45. elseif (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 15.0.0)
  46. set(CMAKE_CXX14_EXTENSION_COMPILE_OPTION "-std=gnu++1y")
  47. endif()
  48. if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 15.0)
  49. set(CMAKE_CXX11_STANDARD__HAS_FULL_SUPPORT ON)
  50. endif()
  51. if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 13.0)
  52. set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "-std=c++11")
  53. set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "-std=gnu++11")
  54. elseif (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 12.1)
  55. set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "-std=c++0x")
  56. set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "-std=gnu++0x")
  57. endif()
  58. if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 12.1)
  59. set(CMAKE_CXX98_STANDARD_COMPILE_OPTION "-std=c++98")
  60. set(CMAKE_CXX98_EXTENSION_COMPILE_OPTION "-std=gnu++98")
  61. set(CMAKE_CXX98_STANDARD__HAS_FULL_SUPPORT ON)
  62. endif()
  63. endif()
  64. __compiler_check_default_language_standard(CXX 12.1 98)
  65. set(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE "<CMAKE_CXX_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
  66. set(CMAKE_CXX_CREATE_ASSEMBLY_SOURCE "<CMAKE_CXX_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>")