From 4088933f649fd9cb4297c8dd2d108b2c43b0ff2a Mon Sep 17 00:00:00 2001 From: Grant <71123738+Grabt234@users.noreply.github.com> Date: Mon, 13 May 2024 15:35:20 +0000 Subject: [PATCH] Chore: Removing support for ESP32 --- CMakeLists.txt | 114 +++++++++++++++++++++---------------------------- 1 file changed, 49 insertions(+), 65 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 53a90d6..5c4a5e8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,68 +8,52 @@ set(INCLUDE_DIR "include") set(SOURCE_TESTS_DIR "source_tests") set(INCLUDE_TESTS_DIR "include_tests") -if(DEFINED ENV{IDF_PATH}) # this is normally only set when running in an esp idf terminal - message(STATUS "Building for ESP32") - - idf_component_register( - SRCS - ${SOURCE_DIR}/BaseModule.cpp - ${SOURCE_DIR}/RouterModule.cpp - INCLUDE_DIRS - ${INCLUDE_DIR} - REQUIRES - Chunk_Types - ) - -else() - message(STATUS "Building for Unix") - - # Set C++ standard - set(CMAKE_CXX_STANDARD 20) - - # Main executable - file(GLOB SOURCES "${SOURCE_DIR}/*.cpp") - add_library(BaseModuleLib - ${SOURCES} - ) - - # Test executable - add_executable(BaseModuleTest - ${SOURCE_TESTS_DIR}/BaseModuleTest.cpp - ) - - add_subdirectory(components/Chunk_Types) - add_subdirectory(components/plog) - - # Include directories for main code and tests - target_include_directories(BaseModuleLib - PRIVATE ${INCLUDE_DIR} - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/components/Chunk_Types/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/components/plog/include - ) - - target_include_directories(BaseModuleTest - PRIVATE ${INCLUDE_DIR} - PRIVATE ${INCLUDE_TESTS_DIR} - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/components/doctest/doctest - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/components/Chunk_Types/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/components/plog/include - ) - - # Adding threads - target_link_libraries(BaseModuleLib PRIVATE pthread) - target_link_libraries(BaseModuleLib PRIVATE ${THREADS_LIBRARIES}) - - # Link with required libraries for the main executable - target_link_libraries(BaseModuleLib PRIVATE doctest::doctest) - - # Link with required libraries for the test executable - target_link_libraries(BaseModuleTest PRIVATE BaseModuleLib doctest::doctest) - - # Enable testing - enable_testing() - - # Add tests to CTest - add_test(NAME BaseModuleTest COMMAND BaseModuleTest) - -endif() +message(STATUS "Building for Unix") + +# Set C++ standard +set(CMAKE_CXX_STANDARD 20) + +# Main executable +file(GLOB SOURCES "${SOURCE_DIR}/*.cpp") +add_library(BaseModuleLib + ${SOURCES} +) + +# Test executable +add_executable(BaseModuleTest + ${SOURCE_TESTS_DIR}/BaseModuleTest.cpp +) + +add_subdirectory(components/Chunk_Types) +add_subdirectory(components/plog) + +# Include directories for main code and tests +target_include_directories(BaseModuleLib + PRIVATE ${INCLUDE_DIR} + PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/components/Chunk_Types/include + PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/components/plog/include +) + +target_include_directories(BaseModuleTest + PRIVATE ${INCLUDE_DIR} + PRIVATE ${INCLUDE_TESTS_DIR} + PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/components/doctest/doctest + PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/components/Chunk_Types/include + PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/components/plog/include +) + +# Adding threads +target_link_libraries(BaseModuleLib PRIVATE pthread) +target_link_libraries(BaseModuleLib PRIVATE ${THREADS_LIBRARIES}) + +# Link with required libraries for the main executable +target_link_libraries(BaseModuleLib PRIVATE doctest::doctest) + +# Link with required libraries for the test executable +target_link_libraries(BaseModuleTest PRIVATE BaseModuleLib doctest::doctest) + +# Enable testing +enable_testing() + +# Add tests to CTest +add_test(NAME BaseModuleTest COMMAND BaseModuleTest)