mirror of
https://github.com/orange-cpp/omath.git
synced 2026-02-12 22:53:27 +00:00
Adds support for tests and benchmarks via Vcpkg features
Enables building unit tests using GTest and benchmarks using Benchmark, through Vcpkg features. Adds `tests` and `benchmark` features to `vcpkg.json`, and adds corresponding CMake logic to control their build based on Vcpkg manifest features.
This commit is contained in:
@@ -29,11 +29,16 @@ if (CMAKE_TOOLCHAIN_FILE AND VCPKG_MANIFEST_FEATURES)
|
||||
set(OMATH_IMGUI_INTEGRATION ON)
|
||||
elseif (omath_feature STREQUAL "avx2")
|
||||
set(OMATH_USE_AVX2 ${COMPILER_SUPPORTS_AVX2})
|
||||
else()
|
||||
elseif (omath_feature STREQUAL "tests")
|
||||
set(OMATH_BUILD_TESTS ON)
|
||||
elseif (omath_feature STREQUAL "benchmark")
|
||||
set(OMATH_BUILD_BENCHMARK ON)
|
||||
else ()
|
||||
message(WARNING "[${PROJECT_NAME}]: UNKNOWN VCPKG LIBRARY FEATURE CALLED \"${omath_feature}\" ")
|
||||
endif ()
|
||||
endforeach ()
|
||||
endif ()
|
||||
|
||||
if (OMATH_USE_AVX2 AND NOT COMPILER_SUPPORTS_AVX2)
|
||||
message(WARNING "OMATH_USE_AVX2 requested, but compiler/target does not support AVX2. Disabling.")
|
||||
set(OMATH_USE_AVX2 OFF CACHE BOOL "Omath will use AVX2 to boost performance" FORCE)
|
||||
|
||||
Reference in New Issue
Block a user