From 910ea583a23147f25157cfa7ee0c2147f3de1036 Mon Sep 17 00:00:00 2001 From: philippe44 Date: Thu, 18 May 2023 01:00:32 +0200 Subject: [PATCH] cmke .. again --- components/_override/CMakeLists.txt | 36 ++++++++++++++--------------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/components/_override/CMakeLists.txt b/components/_override/CMakeLists.txt index 2e38efe4..39946ad4 100644 --- a/components/_override/CMakeLists.txt +++ b/components/_override/CMakeLists.txt @@ -1,24 +1,22 @@ -set(lib_dir ${build_dir}/esp-idf) - if(IDF_TARGET STREQUAL esp32) + set(lib_dir ${build_dir}/esp-idf) set(driver esp32/i2s.c esp32/i2s_hal.c esp32/spi_bus_lock.c) -endif() + string(REPLACE ".c" ".c.obj" driver_obj "${driver}") -string(REPLACE ".c" ".c.obj" driver_obj "${driver}") + idf_component_register( SRCS ${driver} + REQUIRES driver + INCLUDE_DIRS ${IDF_PATH}/components/driver + PRIV_INCLUDE_DIRS ${IDF_PATH}/components/driver/include/driver + ) -idf_component_register( SRCS ${driver} - REQUIRES driver - INCLUDE_DIRS ${IDF_PATH}/components/driver - PRIV_INCLUDE_DIRS ${IDF_PATH}/components/driver/include/driver -) + # CMake is just a pile of crap + message(STATUS "!! overriding ${driver} !!") + message(STATUS "CAREFUL, LIBRARIES STRIPPING FROM DUPLICATED COMPONENTS DEPENDS ON THIS BEING REBUILD") -# CMake is just a pile of crap -message(STATUS "!! overriding ${driver} !!") -message(STATUS "CAREFUL, LIBRARIES STRIPPING FROM DUPLICATED COMPONENTS DEPENDS ON THIS BEING REBUILD") - -add_custom_command( - TARGET ${COMPONENT_LIB} - PRE_LINK - COMMAND xtensa-esp32-elf-ar -d ${lib_dir}/driver/libdriver.a ${driver_obj} - VERBATIM -) + add_custom_command( + TARGET ${COMPONENT_LIB} + PRE_LINK + COMMAND xtensa-esp32-elf-ar -d ${lib_dir}/driver/libdriver.a ${driver_obj} + VERBATIM + ) +endif()