2020-11-10 07:40:01 +00:00
|
|
|
set(srcs
|
2020-08-10 04:29:05 +00:00
|
|
|
"unity/src/unity.c")
|
|
|
|
|
|
|
|
set(includes
|
|
|
|
"include"
|
|
|
|
"unity/src")
|
2018-10-25 04:52:32 +00:00
|
|
|
|
2018-11-29 09:06:21 +00:00
|
|
|
if(CONFIG_UNITY_ENABLE_BACKTRACE_ON_FAIL)
|
|
|
|
list(APPEND COMPONENT_PRIV_INCLUDEDIRS "include/priv")
|
|
|
|
endif()
|
|
|
|
|
2018-10-25 04:52:32 +00:00
|
|
|
if(CONFIG_UNITY_ENABLE_IDF_TEST_RUNNER)
|
2019-04-28 07:38:23 +00:00
|
|
|
list(APPEND srcs "unity_runner.c")
|
2018-10-25 04:52:32 +00:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if(CONFIG_UNITY_ENABLE_FIXTURE)
|
2019-04-28 07:38:23 +00:00
|
|
|
list(APPEND srcs "unity/extras/fixture/src/unity_fixture.c")
|
2020-08-10 04:29:05 +00:00
|
|
|
list(APPEND includes "unity/extras/fixture/src")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(${IDF_TARGET} STREQUAL "linux")
|
|
|
|
message(STATUS "adding linux stuff...")
|
|
|
|
idf_component_get_property(spi_flash_dir spi_flash COMPONENT_DIR)
|
|
|
|
list(APPEND includes "${spi_flash_dir}/sim/stubs/esp_common")
|
|
|
|
else()
|
|
|
|
list(APPEND srcs "unity_port_esp32.c")
|
2018-10-25 04:52:32 +00:00
|
|
|
endif()
|
|
|
|
|
2019-04-28 07:38:23 +00:00
|
|
|
idf_component_register(SRCS "${srcs}"
|
2020-09-01 09:06:22 +00:00
|
|
|
INCLUDE_DIRS ${includes})
|
2018-10-25 04:52:32 +00:00
|
|
|
|
2020-08-10 04:29:05 +00:00
|
|
|
if(NOT ${IDF_TARGET} STREQUAL "linux")
|
|
|
|
target_compile_definitions(${COMPONENT_LIB} PUBLIC
|
|
|
|
-DUNITY_INCLUDE_CONFIG_H
|
|
|
|
)
|
|
|
|
endif()
|
2018-10-25 04:52:32 +00:00
|
|
|
|
2019-11-05 11:20:26 +00:00
|
|
|
target_compile_options(${COMPONENT_LIB} PRIVATE -Wno-unused-const-variable)
|