mirror of
https://github.com/orange-cpp/omath.git
synced 2026-02-13 07:03:25 +00:00
Disables tests and benchmarks by default for VCPKG
Changes the default state of `OMATH_BUILD_TESTS` and `OMATH_BUILD_BENCHMARK` to OFF when built via VCPKG. Previously, these flags were inherited from the project's top level. This change ensures that these are explicitly enabled via VCPKG manifest features, providing better control over build configuration.
This commit is contained in:
@@ -11,8 +11,8 @@ else ()
|
|||||||
check_cxx_compiler_flag("-mavx2" COMPILER_SUPPORTS_AVX2)
|
check_cxx_compiler_flag("-mavx2" COMPILER_SUPPORTS_AVX2)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
option(OMATH_BUILD_TESTS "Build unit tests" ${PROJECT_IS_TOP_LEVEL})
|
option(OMATH_BUILD_TESTS "Build unit tests" OFF)
|
||||||
option(OMATH_BUILD_BENCHMARK "Build benchmarks" ${PROJECT_IS_TOP_LEVEL})
|
option(OMATH_BUILD_BENCHMARK "Build benchmarks" OFF)
|
||||||
option(OMATH_THREAT_WARNING_AS_ERROR "Set highest level of warnings and force compiler to treat them as errors" ON)
|
option(OMATH_THREAT_WARNING_AS_ERROR "Set highest level of warnings and force compiler to treat them as errors" ON)
|
||||||
option(OMATH_BUILD_AS_SHARED_LIBRARY "Build Omath as .so or .dll" OFF)
|
option(OMATH_BUILD_AS_SHARED_LIBRARY "Build Omath as .so or .dll" OFF)
|
||||||
option(OMATH_USE_AVX2 "Omath will use AVX2 to boost performance" ${COMPILER_SUPPORTS_AVX2})
|
option(OMATH_USE_AVX2 "Omath will use AVX2 to boost performance" ${COMPILER_SUPPORTS_AVX2})
|
||||||
@@ -33,15 +33,28 @@ if (OMATH_BUILD_VIA_VCPKG AND VCPKG_MANIFEST_FEATURES)
|
|||||||
foreach (omath_feature IN LISTS VCPKG_MANIFEST_FEATURES)
|
foreach (omath_feature IN LISTS VCPKG_MANIFEST_FEATURES)
|
||||||
if (omath_feature STREQUAL "imgui")
|
if (omath_feature STREQUAL "imgui")
|
||||||
set(OMATH_IMGUI_INTEGRATION ON)
|
set(OMATH_IMGUI_INTEGRATION ON)
|
||||||
elseif (omath_feature STREQUAL "avx2")
|
else ()
|
||||||
|
set(OMATH_IMGUI_INTEGRATION OFF)
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
if (omath_feature STREQUAL "avx2")
|
||||||
set(OMATH_USE_AVX2 ${COMPILER_SUPPORTS_AVX2})
|
set(OMATH_USE_AVX2 ${COMPILER_SUPPORTS_AVX2})
|
||||||
elseif (omath_feature STREQUAL "tests")
|
else ()
|
||||||
|
set(OMATH_USE_AVX2 OFF)
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
if (omath_feature STREQUAL "tests")
|
||||||
set(OMATH_BUILD_TESTS ON)
|
set(OMATH_BUILD_TESTS ON)
|
||||||
elseif (omath_feature STREQUAL "benchmark")
|
else ()
|
||||||
|
set(OMATH_BUILD_TESTS OFF)
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
if (omath_feature STREQUAL "benchmark")
|
||||||
set(OMATH_BUILD_BENCHMARK ON)
|
set(OMATH_BUILD_BENCHMARK ON)
|
||||||
else ()
|
else ()
|
||||||
message(WARNING "[${PROJECT_NAME}]: UNKNOWN VCPKG LIBRARY FEATURE CALLED \"${omath_feature}\" ")
|
set(OMATH_BUILD_TESTS OFF)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
endforeach ()
|
endforeach ()
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user