CMakeLanguageInformation.cmake 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. #=============================================================================
  2. # Copyright 2015 Kitware, Inc.
  3. #
  4. # Distributed under the OSI-approved BSD License (the "License");
  5. # see accompanying file Copyright.txt for details.
  6. #
  7. # This software is distributed WITHOUT ANY WARRANTY; without even the
  8. # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  9. # See the License for more information.
  10. #=============================================================================
  11. # (To distribute this file outside of CMake, substitute the full
  12. # License text for the above reference.)
  13. # This file contains common code blocks used by all the language information
  14. # files
  15. # load any compiler-wrapper specific information
  16. macro(__cmake_include_compiler_wrapper lang)
  17. set(_INCLUDED_WRAPPER_FILE 0)
  18. if (CMAKE_${lang}_COMPILER_ID)
  19. include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_${lang}_COMPILER_WRAPPER}-${CMAKE_${lang}_COMPILER_ID}-${lang} OPTIONAL RESULT_VARIABLE _INCLUDED_WRAPPER_FILE)
  20. endif()
  21. if (NOT _INCLUDED_WRAPPER_FILE)
  22. include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_${lang}_COMPILER_WRAPPER}-${lang} OPTIONAL RESULT_VARIABLE _INCLUDED_WRAPPER_FILE)
  23. endif ()
  24. # No platform - wrapper - lang information so maybe there's just wrapper - lang information
  25. if(NOT _INCLUDED_WRAPPER_FILE)
  26. if (CMAKE_${lang}_COMPILER_ID)
  27. include(Compiler/${CMAKE_${lang}_COMPILER_WRAPPER}-${CMAKE_${lang}_COMPILER_ID}-${lang} OPTIONAL RESULT_VARIABLE _INCLUDED_WRAPPER_FILE)
  28. endif()
  29. if (NOT _INCLUDED_WRAPPER_FILE)
  30. include(Compiler/${CMAKE_${lang}_COMPILER_WRAPPER}-${lang} OPTIONAL RESULT_VARIABLE _INCLUDED_WRAPPER_FILE)
  31. endif ()
  32. endif ()
  33. endmacro ()