project_include.cmake 1.6 KB

12345678910111213141516171819202122232425262728293031
  1. if(CONFIG_SPIRAM_CACHE_WORKAROUND AND NOT BOOTLOADER_BUILD)
  2. # We do this here as well as in CMakeLists.txt, because targets that
  3. # are not part of the ESP-IDF build system (for cases where a generic
  4. # non-IDF CMakeLists.txt file is imported into a component) don't depend
  5. # on the esp32 component so don't get the extra flag. This handles that case.
  6. idf_build_set_property(COMPILE_OPTIONS "-mfix-esp32-psram-cache-issue" APPEND)
  7. # note that we don't need to set link options as the library linked is independent of this
  8. if(CONFIG_SPIRAM_CACHE_WORKAROUND_STRATEGY_DUPLDST)
  9. idf_build_set_property(COMPILE_OPTIONS "-mfix-esp32-psram-cache-strategy=dupldst" APPEND)
  10. endif()
  11. if(CONFIG_SPIRAM_CACHE_WORKAROUND_STRATEGY_MEMW)
  12. idf_build_set_property(COMPILE_OPTIONS "-mfix-esp32-psram-cache-strategy=memw" APPEND)
  13. endif()
  14. if(CONFIG_SPIRAM_CACHE_WORKAROUND_STRATEGY_NOPS)
  15. idf_build_set_property(COMPILE_OPTIONS "-mfix-esp32-psram-cache-strategy=nops" APPEND)
  16. endif()
  17. endif()
  18. # Check toolchain is configured properly in cmake
  19. if(NOT ( ${CMAKE_SYSTEM_NAME} STREQUAL "Generic" AND ${CMAKE_C_COMPILER} MATCHES xtensa))
  20. message(FATAL_ERROR "Internal error, toolchain has not been set correctly by project "
  21. "(or an invalid CMakeCache.txt file has been generated somehow)")
  22. endif()
  23. #
  24. # Warn if the toolchain version doesn't match
  25. #
  26. # TODO: make these platform-specific for diff toolchains
  27. get_expected_ctng_version(expected_toolchain expected_gcc)
  28. gcc_version_check("${expected_gcc}")
  29. crosstool_version_check("${expected_toolchain}")