diff --git a/.github/workflows/VectorisationTests.yml b/.github/workflows/VectorisationTests.yml index 293481a..f1251bf 100644 --- a/.github/workflows/VectorisationTests.yml +++ b/.github/workflows/VectorisationTests.yml @@ -20,7 +20,7 @@ jobs: run: cmake --version - name: Configure with CMake - run: cmake -B build -DCMAKE_BUILD_TYPE=Release + run: cmake -B build -DCMAKE_BUILD_TYPE=Release -DENABLE_TESTS=ON - name: Build run: cmake --build build --config Release diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 2f24b84..0000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "Catch2"] - path = Catch2 - url = https://github.com/catchorg/Catch2.git diff --git a/CMakeLists.txt b/CMakeLists.txt index 882dcab..8489651 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,19 +1,37 @@ cmake_minimum_required (VERSION 3.25) + project (WRAPPER DESCRIPTION "Vectorisation Wrapper with Unit tested" LANGUAGES CXX) +option(ENABLE_TESTS "Build unit tests" OFF) + set (CMAKE_CXX_STANDARD 23) -add_subdirectory (Catch2) if (APPLE) - set (ACCELERATE_SOURCES VectorisationWrappers/Accelerate/AccelerateWrapper.cpp - VectorisationWrappers/Accelerate/Tests/AccelerateArithmeticUnitTests.cpp - VectorisationWrappers/Accelerate/Tests/AccelerateUtilitiesUnitTests.cpp - VectorisationWrappers/Accelerate/Tests/AccelerateRangeUnitTests.cpp - VectorisationWrappers/Accelerate/Tests/AccelerateTrigonometryUnitTests.cpp) + add_library (VECTORISATION_WRAPPER STATIC VectorisationWrappers/Accelerate/AccelerateWrapper.cpp) + target_include_directories (VECTORISATION_WRAPPER PUBLIC ${PROJECT_SOURCE_DIR}/VectorisationWrappers/Accelerate/) + + if (ENABLE_TESTS) + + include(FetchContent) + FetchContent_Declare( + Catch2 + GIT_REPOSITORY https://github.com/catchorg/Catch2.git + GIT_TAG v3.5.2) + + FetchContent_MakeAvailable(Catch2) + + set (ACCELERATE_SOURCES + VectorisationWrappers/Accelerate/AccelerateWrapper.cpp + VectorisationWrappers/Accelerate/Tests/AccelerateArithmeticUnitTests.cpp + VectorisationWrappers/Accelerate/Tests/AccelerateUtilitiesUnitTests.cpp + VectorisationWrappers/Accelerate/Tests/AccelerateRangeUnitTests.cpp + VectorisationWrappers/Accelerate/Tests/AccelerateTrigonometryUnitTests.cpp) + + add_executable(accelerate_DSP ${ACCELERATE_SOURCES}) - add_executable(accelerate_DSP ${ACCELERATE_SOURCES}) + target_link_libraries (accelerate_DSP PRIVATE Catch2::Catch2WithMain "$") + endif () - target_link_libraries (accelerate_DSP PRIVATE Catch2::Catch2WithMain "$") elseif (MSVC) message ("No Wrapper") endif() \ No newline at end of file diff --git a/Catch2 b/Catch2 deleted file mode 160000 index 416b075..0000000 --- a/Catch2 +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 416b0752112e0e5f9a8568e3e18baace15de37a7