CMakeLists.txt 1014 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. set(srcs
  2. "unity/src/unity.c")
  3. set(includes
  4. "include"
  5. "unity/src")
  6. if(CONFIG_UNITY_ENABLE_BACKTRACE_ON_FAIL)
  7. list(APPEND COMPONENT_PRIV_INCLUDEDIRS "include/priv")
  8. endif()
  9. if(CONFIG_UNITY_ENABLE_IDF_TEST_RUNNER)
  10. list(APPEND srcs "unity_runner.c")
  11. endif()
  12. if(CONFIG_UNITY_ENABLE_FIXTURE)
  13. list(APPEND srcs "unity/extras/fixture/src/unity_fixture.c")
  14. list(APPEND includes "unity/extras/fixture/src")
  15. endif()
  16. if(${IDF_TARGET} STREQUAL "linux")
  17. message(STATUS "adding linux stuff...")
  18. idf_component_get_property(spi_flash_dir spi_flash COMPONENT_DIR)
  19. list(APPEND includes "${spi_flash_dir}/sim/stubs/esp_common")
  20. else()
  21. list(APPEND srcs "unity_port_esp32.c")
  22. endif()
  23. idf_component_register(SRCS "${srcs}"
  24. INCLUDE_DIRS ${includes})
  25. if(NOT ${IDF_TARGET} STREQUAL "linux")
  26. target_compile_definitions(${COMPONENT_LIB} PUBLIC
  27. -DUNITY_INCLUDE_CONFIG_H
  28. )
  29. endif()
  30. target_compile_options(${COMPONENT_LIB} PRIVATE -Wno-unused-const-variable)