Skip to content

Create a common version and target check logics #56

@trombik

Description

@trombik

In CMakeLists.txt, a logic like below is often needed.

# check if the IDF_VERSION has esp_driver_* components
set(HAS_ESP_DRIVERS TRUE)
if(${IDF_VERSION_MAJOR} STREQUAL 5 AND ${IDF_VERSION_MINOR} LESS 3)
    set(HAS_ESP_DRIVERS FALSE)
endif()

Such logic is common in many drivers. Other use case: HAS_PCNT, which signals a chip supports PCNT.

Solution: Create a file to define common logics.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions