mirror of
https://github.com/orange-cpp/omath.git
synced 2026-02-13 07:03:25 +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)
|
||||
|
||||
13
vcpkg.json
13
vcpkg.json
@@ -14,7 +14,6 @@
|
||||
"name": "vcpkg-cmake-config",
|
||||
"host": true
|
||||
}
|
||||
|
||||
],
|
||||
"features": {
|
||||
"avx2": {
|
||||
@@ -26,6 +25,18 @@
|
||||
"dependencies": [
|
||||
"imgui"
|
||||
]
|
||||
},
|
||||
"tests": {
|
||||
"description": "Build unit-tests using GTest",
|
||||
"dependencies": [
|
||||
"gtest"
|
||||
]
|
||||
},
|
||||
"benchmark": {
|
||||
"description": "Build benchmarks",
|
||||
"dependencies": [
|
||||
"benchmark"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user