linux: added linux target

* add toolchain file
* add linux to preview targets
* add stub for dfu number in cmake
* excluded unity runner per default
* Added esp_attr.h and esp_partition.h linux stubs
* component.cmake check list for emptyness
* added switch for linux in unity cmake file
* Added Linux host example app
This commit is contained in:
Jakob Hasse
2020-08-10 12:29:05 +08:00
committed by Fu Hanxi
parent 901925ebc5
commit 52093fa4ef
13 changed files with 330 additions and 14 deletions
+19 -5
View File
@@ -1,6 +1,9 @@
set(srcs
"unity/src/unity.c"
"unity_port_esp32.c")
"unity/src/unity.c")
set(includes
"include"
"unity/src")
if(CONFIG_UNITY_ENABLE_BACKTRACE_ON_FAIL)
list(APPEND COMPONENT_PRIV_INCLUDEDIRS "include/priv")
@@ -12,13 +15,24 @@ endif()
if(CONFIG_UNITY_ENABLE_FIXTURE)
list(APPEND srcs "unity/extras/fixture/src/unity_fixture.c")
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")
endif()
idf_component_register(SRCS "${srcs}"
INCLUDE_DIRS "include" "unity/src" "unity/extras/fixture/src")
target_compile_definitions(${COMPONENT_LIB} PUBLIC
-DUNITY_INCLUDE_CONFIG_H
)
if(NOT ${IDF_TARGET} STREQUAL "linux")
target_compile_definitions(${COMPONENT_LIB} PUBLIC
-DUNITY_INCLUDE_CONFIG_H
)
endif()
target_compile_options(${COMPONENT_LIB} PRIVATE -Wno-unused-const-variable)