Skip to content

Commit

Permalink
Chore: Removing support for ESP32
Browse files Browse the repository at this point in the history
  • Loading branch information
Grabt234 committed May 13, 2024
1 parent 44d88fb commit 4088933
Showing 1 changed file with 49 additions and 65 deletions.
114 changes: 49 additions & 65 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit 4088933

Please sign in to comment.