mirror of
https://github.com/orange-cpp/omath.git
synced 2026-02-13 07:03:25 +00:00
Adds vcpkg integration and updates build configuration
Configures CMakePresets.json to utilize vcpkg for dependency management. Adds support for building with vcpkg. Adds error message for missing VCPKG_ROOT environment variable. Adds explicit VCPKG_MANIFEST_FEATURES and VCPKG_INSTALLED_DIR to CMakePresets.json. Adds benchmark dependency to vcpkg.json.
This commit is contained in:
@@ -23,7 +23,13 @@ option(OMATH_SUPRESS_SAFETY_CHECKS "Supress some safety checks in release build
|
||||
option(OMATH_USE_UNITY_BUILD "Will enable unity build to speed up compilation" OFF)
|
||||
option(OMATH_ENABLE_LEGACY "Will enable legacy classes that MUST be used ONLY for backward compatibility" OFF)
|
||||
|
||||
if (CMAKE_TOOLCHAIN_FILE AND VCPKG_MANIFEST_FEATURES)
|
||||
option(OMATH_BUILD_VIA_VCPKG "Will enable building using vcpkg, vcpkg will override some options that were set in vcpkg.json file, and search for dependencies using vcpkg" OFF)
|
||||
|
||||
if (OMATH_BUILD_VIA_VCPKG AND NOT CMAKE_TOOLCHAIN_FILE)
|
||||
message(FATAL_ERROR "[${PROJECT_NAME}] CMAKE_TOOLCHAIN_FILE IS EMPTY! Please set env variable called 'VCPKG_ROOT' to vcpkg root folder here is an example: 'C:/vcpkg' or '/home/user/vcpkg' ")
|
||||
endif ()
|
||||
|
||||
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)
|
||||
@@ -56,6 +62,7 @@ if (${PROJECT_IS_TOP_LEVEL})
|
||||
message(STATUS "[${PROJECT_NAME}]: AVX2 feature status ${OMATH_USE_AVX2}")
|
||||
message(STATUS "[${PROJECT_NAME}]: ImGUI integration feature status ${OMATH_IMGUI_INTEGRATION}")
|
||||
message(STATUS "[${PROJECT_NAME}]: Legacy features support ${OMATH_ENABLE_LEGACY}")
|
||||
message(STATUS "[${PROJECT_NAME}]: Building using vcpkg ${OMATH_BUILD_VIA_VCPKG}")
|
||||
endif ()
|
||||
|
||||
file(GLOB_RECURSE OMATH_SOURCES CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/source/*.cpp")
|
||||
|
||||
@@ -8,7 +8,11 @@
|
||||
"binaryDir": "${sourceDir}/cmake-build/build/${presetName}",
|
||||
"installDir": "${sourceDir}/cmake-build/install/${presetName}",
|
||||
"cacheVariables": {
|
||||
"CMAKE_CXX_COMPILER": "cl.exe"
|
||||
"CMAKE_CXX_COMPILER": "cl.exe",
|
||||
"CMAKE_TOOLCHAIN_FILE": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake",
|
||||
"VCPKG_MANIFEST_FEATURES": "imgui;avx2;tests",
|
||||
"VCPKG_INSTALLED_DIR": "${sourceDir}/cmake-build/vcpkg_installed",
|
||||
"CMAKE_MAKE_PROGRAM": "Ninja"
|
||||
},
|
||||
"condition": {
|
||||
"type": "equals",
|
||||
|
||||
15
vcpkg.json
15
vcpkg.json
@@ -4,6 +4,7 @@
|
||||
"description": "General purpose math library",
|
||||
"homepage": "https://github.com/orange-cpp/omath",
|
||||
"license": "Zlib",
|
||||
"builtin-baseline": "b1b19307e2d2ec1eefbdb7ea069de7d4bcd31f01",
|
||||
"supports": "windows | linux",
|
||||
"dependencies": [
|
||||
{
|
||||
@@ -20,6 +21,12 @@
|
||||
"description": "Omath will use AVX2 to boost performance",
|
||||
"supports": "!arm"
|
||||
},
|
||||
"benchmark": {
|
||||
"description": "Build benchmarks",
|
||||
"dependencies": [
|
||||
"benchmark"
|
||||
]
|
||||
},
|
||||
"imgui": {
|
||||
"description": "Omath will define method to convert omath types to imgui types",
|
||||
"dependencies": [
|
||||
@@ -31,12 +38,6 @@
|
||||
"dependencies": [
|
||||
"gtest"
|
||||
]
|
||||
},
|
||||
"benchmark": {
|
||||
"description": "Build benchmarks",
|
||||
"dependencies": [
|
||||
"benchmark"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user