Intel.cmake 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. # Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. # file Copyright.txt or https://cmake.org/licensing for details.
  3. # This module is shared by multiple languages; use include blocker.
  4. if(__COMPILER_INTEL)
  5. return()
  6. endif()
  7. set(__COMPILER_INTEL 1)
  8. include(Compiler/CMakeCommonCompilerMacros)
  9. if(CMAKE_HOST_WIN32)
  10. # MSVC-like
  11. macro(__compiler_intel lang)
  12. endmacro()
  13. else()
  14. # GNU-like
  15. macro(__compiler_intel lang)
  16. set(CMAKE_${lang}_VERBOSE_FLAG "-v")
  17. string(APPEND CMAKE_${lang}_FLAGS_INIT " ")
  18. string(APPEND CMAKE_${lang}_FLAGS_DEBUG_INIT " -g")
  19. string(APPEND CMAKE_${lang}_FLAGS_MINSIZEREL_INIT " -Os")
  20. string(APPEND CMAKE_${lang}_FLAGS_RELEASE_INIT " -O3")
  21. string(APPEND CMAKE_${lang}_FLAGS_RELWITHDEBINFO_INIT " -O2 -g")
  22. set(CMAKE_${lang}_COMPILER_PREDEFINES_COMMAND "${CMAKE_${lang}_COMPILER}")
  23. if(CMAKE_${lang}_COMPILER_ARG1)
  24. separate_arguments(_COMPILER_ARGS NATIVE_COMMAND "${CMAKE_${lang}_COMPILER_ARG1}")
  25. list(APPEND CMAKE_${lang}_COMPILER_PREDEFINES_COMMAND ${_COMPILER_ARGS})
  26. unset(_COMPILER_ARGS)
  27. endif()
  28. list(APPEND CMAKE_${lang}_COMPILER_PREDEFINES_COMMAND "-QdM" "-P" "-Za" "${CMAKE_ROOT}/Modules/CMakeCXXCompilerABI.cpp")
  29. # Precompile Headers
  30. set(CMAKE_PCH_EXTENSION .pchi)
  31. set(CMAKE_LINK_PCH ON)
  32. set(CMAKE_PCH_EPILOGUE "#pragma hdrstop")
  33. set(CMAKE_${lang}_COMPILE_OPTIONS_USE_PCH -Winvalid-pch -Wno-pch-messages -pch-use <PCH_FILE> -include <PCH_HEADER>)
  34. set(CMAKE_${lang}_COMPILE_OPTIONS_CREATE_PCH -Winvalid-pch -Wno-pch-messages -pch-create <PCH_FILE> -include <PCH_HEADER>)
  35. endmacro()
  36. endif()