mirror of
https://github.com/orange-cpp/omath.git
synced 2026-02-12 22:53:27 +00:00
Update CMake configuration for Vcpkg integration and feature enablement.
Enables features and sets build configurations via Vcpkg manifest. Adds new presets for Windows and Linux debug/release builds using Vcpkg. Conditionally enables features (imgui, avx2, tests, benchmark) based on Vcpkg manifest features.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
cmake_minimum_required(VERSION 3.26)
|
||||
|
||||
project(omath VERSION 3.9.2 LANGUAGES CXX)
|
||||
project(omath VERSION 3.10.1 LANGUAGES CXX)
|
||||
|
||||
include(CMakePackageConfigHelpers)
|
||||
include(CheckCXXCompilerFlag)
|
||||
@@ -11,7 +11,7 @@ else ()
|
||||
check_cxx_compiler_flag("-mavx2" COMPILER_SUPPORTS_AVX2)
|
||||
endif ()
|
||||
|
||||
option(OMATH_BUILD_TESTS "Build unit tests" OFF)
|
||||
option(OMATH_BUILD_TESTS "Build unit tests" ${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_BUILD_AS_SHARED_LIBRARY "Build Omath as .so or .dll" OFF)
|
||||
@@ -33,26 +33,12 @@ if (OMATH_BUILD_VIA_VCPKG AND VCPKG_MANIFEST_FEATURES)
|
||||
foreach (omath_feature IN LISTS VCPKG_MANIFEST_FEATURES)
|
||||
if (omath_feature STREQUAL "imgui")
|
||||
set(OMATH_IMGUI_INTEGRATION ON)
|
||||
else ()
|
||||
set(OMATH_IMGUI_INTEGRATION OFF)
|
||||
endif ()
|
||||
|
||||
if (omath_feature STREQUAL "avx2")
|
||||
elseif (omath_feature STREQUAL "avx2")
|
||||
set(OMATH_USE_AVX2 ${COMPILER_SUPPORTS_AVX2})
|
||||
else ()
|
||||
set(OMATH_USE_AVX2 OFF)
|
||||
endif ()
|
||||
|
||||
if (omath_feature STREQUAL "tests")
|
||||
elseif (omath_feature STREQUAL "tests")
|
||||
set(OMATH_BUILD_TESTS ON)
|
||||
else ()
|
||||
set(OMATH_BUILD_TESTS OFF)
|
||||
endif ()
|
||||
|
||||
if (omath_feature STREQUAL "benchmark")
|
||||
elseif (omath_feature STREQUAL "benchmark")
|
||||
set(OMATH_BUILD_BENCHMARK ON)
|
||||
else ()
|
||||
set(OMATH_BUILD_TESTS OFF)
|
||||
endif ()
|
||||
|
||||
endforeach ()
|
||||
|
||||
@@ -27,6 +27,25 @@
|
||||
"CMAKE_BUILD_TYPE": "Debug"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "windows-debug-vcpkg",
|
||||
"displayName": "Debug",
|
||||
"inherits": "windows-base",
|
||||
"cacheVariables": {
|
||||
"CMAKE_BUILD_TYPE": "Debug",
|
||||
"OMATH_BUILD_VIA_VCPKG": "ON",
|
||||
"VCPKG_MANIFEST_FEATURES": "tests;imgui;avx2"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "windows-release-vcpkg",
|
||||
"displayName": "Release",
|
||||
"inherits": "windows-base",
|
||||
"cacheVariables": {
|
||||
"CMAKE_BUILD_TYPE": "Release",
|
||||
"OMATH_BUILD_VIA_VCPKG": "ON"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "windows-release",
|
||||
"displayName": "Release",
|
||||
@@ -61,6 +80,15 @@
|
||||
"CMAKE_BUILD_TYPE": "Debug"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "linux-debug-vcpkg",
|
||||
"displayName": "Linux Debug",
|
||||
"inherits": "linux-base",
|
||||
"cacheVariables": {
|
||||
"CMAKE_BUILD_TYPE": "Debug",
|
||||
"OMATH_BUILD_VIA_VCPKG": "ON"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "linux-release",
|
||||
"displayName": "Linux Release",
|
||||
@@ -69,6 +97,15 @@
|
||||
"CMAKE_BUILD_TYPE": "Release"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "linux-release-vcpkg",
|
||||
"displayName": "Linux Release",
|
||||
"inherits": "linux-debug",
|
||||
"cacheVariables": {
|
||||
"CMAKE_BUILD_TYPE": "Release",
|
||||
"OMATH_BUILD_VIA_VCPKG": "ON"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "darwin-base",
|
||||
"hidden": true,
|
||||
|
||||
Reference in New Issue
Block a user