generic.cmake 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. # SPDX-License-Identifier: Apache-2.0
  2. # Configures CMake for using ccac
  3. # MWDT compiler (CCAC) can't be used for preprocessing the DTS sources as it has
  4. # weird restrictions about file extensions. Synopsys Jira issue: P10019563-38578
  5. # Let's temporarily use GNU compiler instead.
  6. find_program(CMAKE_DTS_PREPROCESSOR arc-elf32-gcc)
  7. if (NOT CMAKE_DTS_PREPROCESSOR)
  8. find_program(CMAKE_DTS_PREPROCESSOR arc-linux-gcc)
  9. endif()
  10. if (NOT CMAKE_DTS_PREPROCESSOR)
  11. find_program(CMAKE_DTS_PREPROCESSOR gcc)
  12. endif()
  13. if(NOT CMAKE_DTS_PREPROCESSOR)
  14. message(FATAL_ERROR "Zephyr was unable to find any GNU compiler (ARC or host one) for DTS preprocessing")
  15. endif()
  16. find_program(CMAKE_C_COMPILER ${CROSS_COMPILE}ccac PATH ${TOOLCHAIN_HOME} NO_DEFAULT_PATH)
  17. find_program(CMAKE_LLVM_COV ${CROSS_COMPILE}llvm-cov PATH ${TOOLCHAIN_HOME} NO_DEFAULT_PATH)
  18. set(CMAKE_GCOV "${CMAKE_LLVM_COV} gcov")
  19. if(CMAKE_C_COMPILER STREQUAL CMAKE_C_COMPILER-NOTFOUND)
  20. message(FATAL_ERROR "Zephyr was unable to find the Metaware compiler")
  21. endif()
  22. execute_process(
  23. COMMAND ${CMAKE_C_COMPILER} --version
  24. RESULT_VARIABLE ret
  25. OUTPUT_QUIET
  26. ERROR_QUIET
  27. )
  28. if(ret)
  29. message(FATAL_ERROR "Executing the below command failed. Are permissions set correctly?
  30. '${CMAKE_C_COMPILER} --version'"
  31. )
  32. endif()