From 25dc212b086624d1aad846edf090c60521b054b0 Mon Sep 17 00:00:00 2001 From: Orange Date: Thu, 23 Oct 2025 00:53:38 +0300 Subject: [PATCH 01/26] added contained type alias --- include/omath/linear_algebra/mat.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/include/omath/linear_algebra/mat.hpp b/include/omath/linear_algebra/mat.hpp index a272118..75c4848 100644 --- a/include/omath/linear_algebra/mat.hpp +++ b/include/omath/linear_algebra/mat.hpp @@ -39,6 +39,7 @@ namespace omath class Mat final { public: + using ContainedType = Type; constexpr Mat() noexcept { clear(); From 55041384c5ba48a1c5b23bc3243e1a4aab047850 Mon Sep 17 00:00:00 2001 From: Orange Date: Thu, 23 Oct 2025 06:35:22 +0300 Subject: [PATCH 02/26] added vcpkg manifest file --- CMakeLists.txt | 9 +++++ include/omath/linear_algebra/vector2.hpp | 2 +- include/omath/linear_algebra/vector4.hpp | 2 +- .../general/unit_test_imgui_intergration.cpp | 39 +++++++++++++++++++ vcpkg.json | 31 +++++++++++++++ 5 files changed, 81 insertions(+), 2 deletions(-) create mode 100644 tests/general/unit_test_imgui_intergration.cpp create mode 100644 vcpkg.json diff --git a/CMakeLists.txt b/CMakeLists.txt index 8338ee9..3d61db9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,6 +23,15 @@ 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) + foreach (omath_feature IN LISTS VCPKG_MANIFEST_FEATURES) + if (omath_feature STREQUAL "imgui") + set(OMATH_IMGUI_INTEGRATION ON) + elseif (omath_feature STREQUAL "avx2") + set(OMATH_USE_AVX2 ${COMPILER_SUPPORTS_AVX2}) + 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) diff --git a/include/omath/linear_algebra/vector2.hpp b/include/omath/linear_algebra/vector2.hpp index 2994144..7f16173 100644 --- a/include/omath/linear_algebra/vector2.hpp +++ b/include/omath/linear_algebra/vector2.hpp @@ -221,7 +221,7 @@ namespace omath } #ifdef OMATH_IMGUI_INTEGRATION [[nodiscard]] - ImVec2 to_im_vec2() const noexcept + constexpr ImVec2 to_im_vec2() const noexcept { return {static_cast(this->x), static_cast(this->y)}; } diff --git a/include/omath/linear_algebra/vector4.hpp b/include/omath/linear_algebra/vector4.hpp index 25d6a6d..48b0278 100644 --- a/include/omath/linear_algebra/vector4.hpp +++ b/include/omath/linear_algebra/vector4.hpp @@ -184,7 +184,7 @@ namespace omath #ifdef OMATH_IMGUI_INTEGRATION [[nodiscard]] - ImVec4 to_im_vec4() const noexcept + constexpr ImVec4 to_im_vec4() const noexcept { return { static_cast(this->x), diff --git a/tests/general/unit_test_imgui_intergration.cpp b/tests/general/unit_test_imgui_intergration.cpp new file mode 100644 index 0000000..0e6ddea --- /dev/null +++ b/tests/general/unit_test_imgui_intergration.cpp @@ -0,0 +1,39 @@ +// +// Created by Vlad on 10/23/2025. +// +#ifdef OMATH_IMGUI_INTEGRATION +#include +#include + +#define IMGUI_DEFINE_MATH_OPERATORS +#include + + + +using namespace omath; + +TEST(unit_test_imgui_intergration, Vector2ToImVec2) +{ + constexpr Vector2 omath_vector_2d = {1.f, 2.f}; + constexpr ImVec2 imgui_vector_2d = {1, 2.f}; + + constexpr auto converted = omath_vector_2d.to_im_vec2(); + EXPECT_NEAR(converted.x, imgui_vector_2d.x, 1.e-5f); + EXPECT_NEAR(converted.y, imgui_vector_2d.y, 1.e-5f); +} + +TEST(unit_test_imgui_intergration, Vector4ToImVec4) +{ + constexpr Vector4 omath_vector_2d = {1.f, 2.f, 3.f, 4.f}; + constexpr ImVec4 imgui_vector_4d = {1, 2.f, 3.f, 4.f}; + + constexpr auto converted = omath_vector_2d.to_im_vec4(); + + EXPECT_NEAR(converted.x, imgui_vector_4d.x, 1.e-5f); + EXPECT_NEAR(converted.y, imgui_vector_4d.y, 1.e-5f); + EXPECT_NEAR(converted.z, imgui_vector_4d.z, 1.e-5f); + EXPECT_NEAR(converted.w, imgui_vector_4d.w, 1.e-5f); +} + + +#endif diff --git a/vcpkg.json b/vcpkg.json new file mode 100644 index 0000000..0a8c9c1 --- /dev/null +++ b/vcpkg.json @@ -0,0 +1,31 @@ +{ + "name": "omath", + "version": "3.10.1", + "description": "General purpose math library", + "homepage": "https://github.com/orange-cpp/omath", + "license": "Zlib", + "supports": "windows | linux", + "dependencies": [ + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + + ], + "features": { + "avx2": { + "description": "Omath will use AVX2 to boost performance", + "supports": "!arm" + }, + "imgui": { + "description": "Omath will define method to convert omath types to imgui types", + "dependencies": [ + "imgui" + ] + } + } +} \ No newline at end of file From 65ba237c6efea45e0c7bd766ceb365436ad4508c Mon Sep 17 00:00:00 2001 From: Orange Date: Thu, 23 Oct 2025 06:43:09 +0300 Subject: [PATCH 03/26] added additional check --- CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3d61db9..26df32f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,12 +23,14 @@ 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) +if (CMAKE_TOOLCHAIN_FILE AND VCPKG_MANIFEST_FEATURES) foreach (omath_feature IN LISTS VCPKG_MANIFEST_FEATURES) if (omath_feature STREQUAL "imgui") set(OMATH_IMGUI_INTEGRATION ON) elseif (omath_feature STREQUAL "avx2") set(OMATH_USE_AVX2 ${COMPILER_SUPPORTS_AVX2}) + else() + message(WARNING "[${PROJECT_NAME}]: UNKNOWN VCPKG LIBRARY FEATURE CALLED \"${omath_feature}\" ") endif () endforeach () endif () From 61abf6e893197ec369eef756b1ab18e5d10bae9a Mon Sep 17 00:00:00 2001 From: Orange Date: Mon, 27 Oct 2025 06:42:43 +0300 Subject: [PATCH 04/26] 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. --- CMakeLists.txt | 7 ++++++- vcpkg.json | 13 ++++++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 26df32f..d68071c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/vcpkg.json b/vcpkg.json index 0a8c9c1..1fd4afc 100644 --- a/vcpkg.json +++ b/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" + ] } } } \ No newline at end of file From 22c01a83b9de36428e75a43a70be4e6477a54a07 Mon Sep 17 00:00:00 2001 From: Orange Date: Mon, 27 Oct 2025 07:53:53 +0300 Subject: [PATCH 05/26] 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. --- CMakeLists.txt | 9 ++++++++- CMakePresets.json | 6 +++++- vcpkg.json | 15 ++++++++------- 3 files changed, 21 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d68071c..d57f26e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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") diff --git a/CMakePresets.json b/CMakePresets.json index a37b0c3..5f13630 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -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", diff --git a/vcpkg.json b/vcpkg.json index 1fd4afc..519781d 100644 --- a/vcpkg.json +++ b/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" - ] } } -} \ No newline at end of file +} From f2cbdd73a990a05c61a1152125ec3254e7e87378 Mon Sep 17 00:00:00 2001 From: Orange Date: Mon, 27 Oct 2025 08:00:53 +0300 Subject: [PATCH 06/26] Adds Vcpkg setup to CI workflows Adds vcpkg setup for Arch Linux and Windows CI jobs. This ensures consistent dependency management and builds via Vcpkg for both platforms and enables OMath to build via vcpkg. Clones the vcpkg repository and bootstraps it during the job execution. --- .github/workflows/cmake-multi-platform.yml | 24 +++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index 13aee86..aefcbfa 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -19,6 +19,9 @@ jobs: name: Arch Linux (Clang) runs-on: ubuntu-latest container: archlinux:latest + env: + VCPKG_ROOT: ${{ github.workspace }}/vcpkg + OMATH_BUILD_VIA_VCPKG: ON steps: - name: Install basic tool-chain with pacman @@ -33,6 +36,12 @@ jobs: with: submodules: recursive + - name: Set up vcpkg + shell: bash + run: | + git clone --depth 1 https://github.com/microsoft/vcpkg "$VCPKG_ROOT" + "$VCPKG_ROOT/bootstrap-vcpkg.sh" -disableMetrics + - name: Configure (cmake --preset) shell: bash run: cmake --preset linux-release -DOMATH_BUILD_TESTS=ON -DOMATH_BUILD_BENCHMARK=OFF @@ -47,12 +56,15 @@ jobs: -############################################################################## -# 2) Windows – MSVC / Ninja -############################################################################## + ############################################################################## + # 2) Windows – MSVC / Ninja + ############################################################################## windows-build-and-test: name: Windows (MSVC) runs-on: windows-latest + env: + VCPKG_ROOT: ${{ github.workspace }}\vcpkg + OMATH_BUILD_VIA_VCPKG: ON steps: - name: Checkout repository (with sub-modules) @@ -66,6 +78,12 @@ jobs: - name: Set up MSVC developer command-prompt uses: ilammy/msvc-dev-cmd@v1 + - name: Set up vcpkg + shell: pwsh + run: | + git clone --depth 1 https://github.com/microsoft/vcpkg $env:VCPKG_ROOT + & "$env:VCPKG_ROOT\bootstrap-vcpkg.bat" -disableMetrics + - name: Configure (cmake --preset) shell: bash run: cmake --preset windows-release -DOMATH_BUILD_TESTS=ON -DOMATH_BUILD_BENCHMARK=OFF From 52b320c642aa1ed96c16acfd7f64b232c2f21ead Mon Sep 17 00:00:00 2001 From: Orange Date: Mon, 27 Oct 2025 08:03:42 +0300 Subject: [PATCH 07/26] fix --- .github/workflows/cmake-multi-platform.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index aefcbfa..089421e 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -40,8 +40,6 @@ jobs: shell: bash run: | git clone --depth 1 https://github.com/microsoft/vcpkg "$VCPKG_ROOT" - "$VCPKG_ROOT/bootstrap-vcpkg.sh" -disableMetrics - - name: Configure (cmake --preset) shell: bash run: cmake --preset linux-release -DOMATH_BUILD_TESTS=ON -DOMATH_BUILD_BENCHMARK=OFF @@ -82,7 +80,6 @@ jobs: shell: pwsh run: | git clone --depth 1 https://github.com/microsoft/vcpkg $env:VCPKG_ROOT - & "$env:VCPKG_ROOT\bootstrap-vcpkg.bat" -disableMetrics - name: Configure (cmake --preset) shell: bash From f218e8fff4d99c25253af83adedb0332c14128d0 Mon Sep 17 00:00:00 2001 From: Orange Date: Mon, 27 Oct 2025 08:07:25 +0300 Subject: [PATCH 08/26] Enables Vcpkg usage for CMake builds Configures CMake to utilize vcpkg for dependency management on both Linux and Windows platforms. This ensures consistent build environments across different operating systems and simplifies the integration of external libraries. --- .github/workflows/cmake-multi-platform.yml | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index 089421e..2fc5be9 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -21,8 +21,6 @@ jobs: container: archlinux:latest env: VCPKG_ROOT: ${{ github.workspace }}/vcpkg - OMATH_BUILD_VIA_VCPKG: ON - steps: - name: Install basic tool-chain with pacman shell: bash @@ -42,7 +40,7 @@ jobs: git clone --depth 1 https://github.com/microsoft/vcpkg "$VCPKG_ROOT" - name: Configure (cmake --preset) shell: bash - run: cmake --preset linux-release -DOMATH_BUILD_TESTS=ON -DOMATH_BUILD_BENCHMARK=OFF + run: cmake --preset linux-release -DOMATH_BUILD_TESTS=ON -DOMATH_BUILD_BENCHMARK=OFF -DOMATH_BUILD_VIA_VCPKG=ON - name: Build shell: bash @@ -61,7 +59,6 @@ jobs: name: Windows (MSVC) runs-on: windows-latest env: - VCPKG_ROOT: ${{ github.workspace }}\vcpkg OMATH_BUILD_VIA_VCPKG: ON steps: @@ -76,14 +73,9 @@ jobs: - name: Set up MSVC developer command-prompt uses: ilammy/msvc-dev-cmd@v1 - - name: Set up vcpkg - shell: pwsh - run: | - git clone --depth 1 https://github.com/microsoft/vcpkg $env:VCPKG_ROOT - - name: Configure (cmake --preset) shell: bash - run: cmake --preset windows-release -DOMATH_BUILD_TESTS=ON -DOMATH_BUILD_BENCHMARK=OFF + run: cmake --preset windows-release -DOMATH_BUILD_TESTS=ON -DOMATH_BUILD_BENCHMARK=OFF -DOMATH_BUILD_VIA_VCPKG=ON - name: Build shell: bash From 3e2a40d5e8aa93cf5e46fe1c7c9a07c08cf20535 Mon Sep 17 00:00:00 2001 From: Orange Date: Mon, 27 Oct 2025 08:11:13 +0300 Subject: [PATCH 09/26] Configures CMake for Vcpkg integration Sets up CMake presets to utilize the Vcpkg toolchain. Specifies the Vcpkg root directory and manifest features. Defines the installation directory for Vcpkg packages. Forces the usage of Ninja as the make program. --- CMakePresets.json | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CMakePresets.json b/CMakePresets.json index 5f13630..5aa27b1 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -43,7 +43,11 @@ "binaryDir": "${sourceDir}/cmake-build/build/${presetName}", "installDir": "${sourceDir}/cmake-build/install/${presetName}", "cacheVariables": { - "CMAKE_CXX_COMPILER": "clang++" + "CMAKE_CXX_COMPILER": "clang++", + "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", From 62010ae7bed68f7212775551f8835cd52df5c1b5 Mon Sep 17 00:00:00 2001 From: Orange Date: Mon, 27 Oct 2025 08:34:05 +0300 Subject: [PATCH 10/26] Update build system and enable VCPKG Migrates to CMake presets and enables VCPKG to manage dependencies. Removes explicit submodule configuration. Updates benchmark and googletest to be integrated or linked properly. The goal is to ease the build process and reduce complexity related to linking and dependency management. --- .github/workflows/cmake-multi-platform.yml | 4 ++-- .gitmodules | 6 ------ CMakeLists.txt | 9 +++------ CMakePresets.json | 2 -- benchmark/CMakeLists.txt | 8 ++++++-- extlibs/CMakeLists.txt | 9 --------- extlibs/benchmark | 1 - extlibs/googletest | 1 - tests/CMakeLists.txt | 8 +++++++- 9 files changed, 18 insertions(+), 30 deletions(-) delete mode 100644 extlibs/CMakeLists.txt delete mode 160000 extlibs/benchmark delete mode 160000 extlibs/googletest diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index 2fc5be9..40b7f0e 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -40,7 +40,7 @@ jobs: git clone --depth 1 https://github.com/microsoft/vcpkg "$VCPKG_ROOT" - name: Configure (cmake --preset) shell: bash - run: cmake --preset linux-release -DOMATH_BUILD_TESTS=ON -DOMATH_BUILD_BENCHMARK=OFF -DOMATH_BUILD_VIA_VCPKG=ON + run: cmake --preset linux-release -DOMATH_BUILD_TESTS=ON -DOMATH_BUILD_BENCHMARK=OFF -DOMATH_BUILD_VIA_VCPKG=ON -DVCPKG_MANIFEST_FEATURES="imgui;avx2;tests" - name: Build shell: bash @@ -75,7 +75,7 @@ jobs: - name: Configure (cmake --preset) shell: bash - run: cmake --preset windows-release -DOMATH_BUILD_TESTS=ON -DOMATH_BUILD_BENCHMARK=OFF -DOMATH_BUILD_VIA_VCPKG=ON + run: cmake --preset windows-release -DOMATH_BUILD_TESTS=ON -DOMATH_BUILD_BENCHMARK=OFF -DOMATH_BUILD_VIA_VCPKG=ON -DVCPKG_MANIFEST_FEATURES="imgui;avx2;tests" - name: Build shell: bash diff --git a/.gitmodules b/.gitmodules index 87b94fb..e69de29 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +0,0 @@ -[submodule "extlibs/googletest"] - path = extlibs/googletest - url = https://github.com/google/googletest.git -[submodule "extlibs/benchmark"] - path = extlibs/benchmark - url = https://github.com/google/benchmark.git diff --git a/CMakeLists.txt b/CMakeLists.txt index d57f26e..e4b4427 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,9 +21,9 @@ option(OMATH_BUILD_EXAMPLES "Build example projects with you can learn & play" O option(OMATH_STATIC_MSVC_RUNTIME_LIBRARY "Force Omath to link static runtime" OFF) option(OMATH_SUPRESS_SAFETY_CHECKS "Supress some safety checks in release build to improve general performance" ON) 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) +option(OMATH_ENABLE_LEGACY "Will enable legacy classes that MUST be used ONLY for backward compatibility" ON) -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) +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" ON) 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' ") @@ -107,7 +107,7 @@ if (OMATH_SUPRESS_SAFETY_CHECKS) endif () if (OMATH_ENABLE_LEGACY) - target_compile_options(${PROJECT_NAME} PUBLIC OMATH_ENABLE_LEGACY) + target_compile_definitions(${PROJECT_NAME} PUBLIC OMATH_ENABLE_LEGACY) endif () set_target_properties(${PROJECT_NAME} PROPERTIES @@ -140,9 +140,6 @@ endif () target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_23) -add_subdirectory(extlibs) - - if (OMATH_BUILD_TESTS) add_subdirectory(tests) target_compile_definitions(${PROJECT_NAME} PUBLIC OMATH_BUILD_TESTS) diff --git a/CMakePresets.json b/CMakePresets.json index 5aa27b1..1608eed 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -10,7 +10,6 @@ "cacheVariables": { "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" }, @@ -45,7 +44,6 @@ "cacheVariables": { "CMAKE_CXX_COMPILER": "clang++", "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" }, diff --git a/benchmark/CMakeLists.txt b/benchmark/CMakeLists.txt index 124e35a..fe48e3a 100644 --- a/benchmark/CMakeLists.txt +++ b/benchmark/CMakeLists.txt @@ -11,5 +11,9 @@ set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 23 CXX_STANDARD_REQUIRED ON) - -target_link_libraries(${PROJECT_NAME} PRIVATE benchmark::benchmark omath) \ No newline at end of file +if (TARGET benchmark::benchmark) + target_link_libraries(${PROJECT_NAME} PRIVATE benchmark::benchmark omath) +else() + find_package(benchmark CONFIG REQUIRED) + target_link_libraries(${PROJECT_NAME} PRIVATE benchmark::benchmark omath) +endif () diff --git a/extlibs/CMakeLists.txt b/extlibs/CMakeLists.txt deleted file mode 100644 index 3ed280f..0000000 --- a/extlibs/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ - -if (OMATH_BUILD_TESTS) - add_subdirectory(googletest) -endif () - -if (OMATH_BUILD_BENCHMARK) - set(BENCHMARK_ENABLE_TESTING OFF) - add_subdirectory(benchmark) -endif () \ No newline at end of file diff --git a/extlibs/benchmark b/extlibs/benchmark deleted file mode 160000 index 2948b6a..0000000 --- a/extlibs/benchmark +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 2948b6a2e61ccabecc952c24794c6960d86c9ed6 diff --git a/extlibs/googletest b/extlibs/googletest deleted file mode 160000 index 52eb810..0000000 --- a/extlibs/googletest +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 52eb8108c5bdec04579160ae17225d66034bd723 diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 5d93257..0ab0c99 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -15,5 +15,11 @@ set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD_REQUIRED ON) -target_link_libraries(${PROJECT_NAME} PRIVATE gtest gtest_main omath::omath) + +if (NOT OMATH_BUILD_VIA_VCPKG) + target_link_libraries(${PROJECT_NAME} PRIVATE gtest gtest_main omath::omath) +else() + find_package(GTest CONFIG REQUIRED) + target_link_libraries(${PROJECT_NAME} PRIVATE GTest::gtest GTest::gtest_main omath::omath) +endif() gtest_discover_tests(${PROJECT_NAME}) \ No newline at end of file From 86dc35fb8d47c944befec291d3d2e047b41e5623 Mon Sep 17 00:00:00 2001 From: Orange Date: Mon, 27 Oct 2025 08:36:48 +0300 Subject: [PATCH 11/26] fix --- CMakePresets.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CMakePresets.json b/CMakePresets.json index 1608eed..fbc79e4 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -44,8 +44,7 @@ "cacheVariables": { "CMAKE_CXX_COMPILER": "clang++", "CMAKE_TOOLCHAIN_FILE": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake", - "VCPKG_INSTALLED_DIR": "${sourceDir}/cmake-build/vcpkg_installed", - "CMAKE_MAKE_PROGRAM": "Ninja" + "VCPKG_INSTALLED_DIR": "${sourceDir}/cmake-build/vcpkg_installed" }, "condition": { "type": "equals", From bc24ee0328ef261266fb604aa6252e04de361c3c Mon Sep 17 00:00:00 2001 From: Orange Date: Mon, 27 Oct 2025 08:37:55 +0300 Subject: [PATCH 12/26] fix --- CMakePresets.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakePresets.json b/CMakePresets.json index fbc79e4..1608eed 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -44,7 +44,8 @@ "cacheVariables": { "CMAKE_CXX_COMPILER": "clang++", "CMAKE_TOOLCHAIN_FILE": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake", - "VCPKG_INSTALLED_DIR": "${sourceDir}/cmake-build/vcpkg_installed" + "VCPKG_INSTALLED_DIR": "${sourceDir}/cmake-build/vcpkg_installed", + "CMAKE_MAKE_PROGRAM": "Ninja" }, "condition": { "type": "equals", From 4ae6549405e7973ef2253b25ce54544488c75ac2 Mon Sep 17 00:00:00 2001 From: Orange Date: Mon, 27 Oct 2025 08:41:22 +0300 Subject: [PATCH 13/26] fix --- CMakePresets.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakePresets.json b/CMakePresets.json index 1608eed..70f92c7 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -45,7 +45,7 @@ "CMAKE_CXX_COMPILER": "clang++", "CMAKE_TOOLCHAIN_FILE": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake", "VCPKG_INSTALLED_DIR": "${sourceDir}/cmake-build/vcpkg_installed", - "CMAKE_MAKE_PROGRAM": "Ninja" + "CMAKE_MAKE_PROGRAM": "ninja" }, "condition": { "type": "equals", From 683b32339631cd7b4fc0c9c5648a04480a026c62 Mon Sep 17 00:00:00 2001 From: Orange Date: Mon, 27 Oct 2025 08:51:58 +0300 Subject: [PATCH 14/26] fix --- .github/workflows/cmake-multi-platform.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index 40b7f0e..b704b9d 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -27,7 +27,7 @@ jobs: run: | pacman -Sy --noconfirm archlinux-keyring pacman -Syu --noconfirm --needed \ - git base-devel clang cmake ninja + git base-devel clang cmake ninja zip unzip fmt - name: Checkout repository (with sub-modules) uses: actions/checkout@v4 From 1eadf245539c1965b0d2d7eb533af328a6e16e11 Mon Sep 17 00:00:00 2001 From: Orange Date: Mon, 27 Oct 2025 08:56:37 +0300 Subject: [PATCH 15/26] Removes baseline from omath vcpkg.json Eliminates the `builtin-baseline` setting from the omath vcpkg.json file. This setting is no longer necessary. --- vcpkg.json | 1 - 1 file changed, 1 deletion(-) diff --git a/vcpkg.json b/vcpkg.json index 519781d..3358a09 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -4,7 +4,6 @@ "description": "General purpose math library", "homepage": "https://github.com/orange-cpp/omath", "license": "Zlib", - "builtin-baseline": "b1b19307e2d2ec1eefbdb7ea069de7d4bcd31f01", "supports": "windows | linux", "dependencies": [ { From 7c63336090735d5aebc1078effa15c7eae70ccb9 Mon Sep 17 00:00:00 2001 From: Orange Date: Mon, 27 Oct 2025 08:59:42 +0300 Subject: [PATCH 16/26] fix --- .github/workflows/cmake-multi-platform.yml | 2 +- vcpkg.json | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index b704b9d..01cca25 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -37,7 +37,7 @@ jobs: - name: Set up vcpkg shell: bash run: | - git clone --depth 1 https://github.com/microsoft/vcpkg "$VCPKG_ROOT" + git clone https://github.com/microsoft/vcpkg "$VCPKG_ROOT" - name: Configure (cmake --preset) shell: bash run: cmake --preset linux-release -DOMATH_BUILD_TESTS=ON -DOMATH_BUILD_BENCHMARK=OFF -DOMATH_BUILD_VIA_VCPKG=ON -DVCPKG_MANIFEST_FEATURES="imgui;avx2;tests" diff --git a/vcpkg.json b/vcpkg.json index 3358a09..519781d 100644 --- a/vcpkg.json +++ b/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": [ { From c54ec328641328fb1be9a6b62d9f90a7c04dd08c Mon Sep 17 00:00:00 2001 From: Orange Date: Mon, 27 Oct 2025 09:05:40 +0300 Subject: [PATCH 17/26] Links tests to gtest when available Conditionally links the test target to gtest when it is available, rather than requiring the OMATH_BUILD_VIA_VCPKG flag to be false. This allows for a more flexible test setup. --- tests/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 0ab0c99..67de285 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -16,7 +16,7 @@ set_target_properties(${PROJECT_NAME} PROPERTIES -if (NOT OMATH_BUILD_VIA_VCPKG) +if (TARGET gtest) target_link_libraries(${PROJECT_NAME} PRIVATE gtest gtest_main omath::omath) else() find_package(GTest CONFIG REQUIRED) From 310e4989ddc640e2bf994d70c3aaf80158811570 Mon Sep 17 00:00:00 2001 From: Orange Date: Mon, 27 Oct 2025 09:19:09 +0300 Subject: [PATCH 18/26] 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. --- CMakeLists.txt | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e4b4427..0389591 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,8 +11,8 @@ else () check_cxx_compiler_flag("-mavx2" COMPILER_SUPPORTS_AVX2) endif () -option(OMATH_BUILD_TESTS "Build unit tests" ${PROJECT_IS_TOP_LEVEL}) -option(OMATH_BUILD_BENCHMARK "Build benchmarks" ${PROJECT_IS_TOP_LEVEL}) +option(OMATH_BUILD_TESTS "Build unit tests" OFF) +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) 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) if (omath_feature STREQUAL "imgui") 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}) - elseif (omath_feature STREQUAL "tests") + else () + set(OMATH_USE_AVX2 OFF) + endif () + + if (omath_feature STREQUAL "tests") 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) else () - message(WARNING "[${PROJECT_NAME}]: UNKNOWN VCPKG LIBRARY FEATURE CALLED \"${omath_feature}\" ") + set(OMATH_BUILD_TESTS OFF) endif () + endforeach () endif () From 969ba6fd347594e9d9328fc313851c602cc24175 Mon Sep 17 00:00:00 2001 From: Orange Date: Mon, 27 Oct 2025 09:19:51 +0300 Subject: [PATCH 19/26] Disables Vcpkg build override Disables the automatic override of build options by Vcpkg. This prevents unintended consequences when using Vcpkg and allows for more control over the build process. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0389591..2d7f6e8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,7 +23,7 @@ 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" ON) -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" ON) +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' ") From eea6195ec231183f08a1f54645946d4b5e49de26 Mon Sep 17 00:00:00 2001 From: Orange Date: Mon, 27 Oct 2025 09:22:00 +0300 Subject: [PATCH 20/26] Fixes invalid NT header check in variant Ensures the NT header signature check uses a capture to avoid potential issues with variable scope. --- source/utility/pe_pattern_scan.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/utility/pe_pattern_scan.cpp b/source/utility/pe_pattern_scan.cpp index 8625959..931f241 100644 --- a/source/utility/pe_pattern_scan.cpp +++ b/source/utility/pe_pattern_scan.cpp @@ -233,7 +233,8 @@ namespace constexpr bool invalid_nt_header_file(const NtHeaderVariant& variant) { constexpr std::uint32_t nt_hdr_magic = 0x4550; - return std::visit([](const auto& header) -> bool { return header.signature != nt_hdr_magic; }, variant); + return std::visit([&nt_hdr_magic](const auto& header) -> bool { return header.signature != nt_hdr_magic; }, + variant); } struct ExtractedSection From 0a7f69aeb099c92d575e0c17ddb0ea3961d96575 Mon Sep 17 00:00:00 2001 From: Orange Date: Mon, 27 Oct 2025 09:55:49 +0300 Subject: [PATCH 21/26] 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. --- CMakeLists.txt | 24 +++++------------------- CMakePresets.json | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 19 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2d7f6e8..ef8a069 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 () diff --git a/CMakePresets.json b/CMakePresets.json index 70f92c7..654bfe1 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -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, From 5c37e39358b3a1f9e37f89137701cea603ffa5c8 Mon Sep 17 00:00:00 2001 From: Orange Date: Mon, 27 Oct 2025 09:57:12 +0300 Subject: [PATCH 22/26] Adds Darwin build presets with Vcpkg support Adds new CMake presets for Darwin platforms, including debug and release configurations with optional Vcpkg integration. This allows for easier builds on Darwin systems utilizing pre-built libraries from Vcpkg. --- CMakePresets.json | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/CMakePresets.json b/CMakePresets.json index 654bfe1..3aced04 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -129,6 +129,15 @@ "CMAKE_BUILD_TYPE": "Debug" } }, + { + "name": "darwin-debug-vcpkg", + "displayName": "Darwin Debug", + "inherits": "darwin-base", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Debug", + "OMATH_BUILD_VIA_VCPKG": "ON" + } + }, { "name": "darwin-release", "displayName": "Darwin Release", @@ -136,6 +145,15 @@ "cacheVariables": { "CMAKE_BUILD_TYPE": "Release" } + }, + { + "name": "darwin-release-vcpkg", + "displayName": "Darwin Release", + "inherits": "darwin-debug", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Release", + "OMATH_BUILD_VIA_VCPKG": "ON" + } } ] } \ No newline at end of file From dd5d2d55413a277a179b489bc38f9af4e5898242 Mon Sep 17 00:00:00 2001 From: Orange Date: Mon, 27 Oct 2025 10:57:57 +0300 Subject: [PATCH 23/26] Adds default and artifact registries Configures the default Vcpkg registry and adds an artifact registry for the microsoft catalog. This enables the tool to find and use pre-built packages from the Microsoft catalog. --- vcpkg-configuration.json | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 vcpkg-configuration.json diff --git a/vcpkg-configuration.json b/vcpkg-configuration.json new file mode 100644 index 0000000..f14bf6b --- /dev/null +++ b/vcpkg-configuration.json @@ -0,0 +1,14 @@ +{ + "default-registry": { + "kind": "git", + "baseline": "b1b19307e2d2ec1eefbdb7ea069de7d4bcd31f01", + "repository": "https://github.com/microsoft/vcpkg" + }, + "registries": [ + { + "kind": "artifact", + "location": "https://github.com/microsoft/vcpkg-ce-catalog/archive/refs/heads/main.zip", + "name": "microsoft" + } + ] +} From f4f385bc465e15ae9c09ea55a41d598592ff45b0 Mon Sep 17 00:00:00 2001 From: Orange Date: Mon, 27 Oct 2025 10:58:26 +0300 Subject: [PATCH 24/26] patch --- vcpkg.json | 1 - 1 file changed, 1 deletion(-) diff --git a/vcpkg.json b/vcpkg.json index 519781d..3358a09 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -4,7 +4,6 @@ "description": "General purpose math library", "homepage": "https://github.com/orange-cpp/omath", "license": "Zlib", - "builtin-baseline": "b1b19307e2d2ec1eefbdb7ea069de7d4bcd31f01", "supports": "windows | linux", "dependencies": [ { From 0e05e013fe989bb19622334e99888b7b62ead6f9 Mon Sep 17 00:00:00 2001 From: Orange Date: Mon, 27 Oct 2025 10:59:30 +0300 Subject: [PATCH 25/26] updated version --- CMakeLists.txt | 2 +- VERSION | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ef8a069..6fde8db 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.26) -project(omath VERSION 3.10.1 LANGUAGES CXX) +project(omath VERSION 3.11.0 LANGUAGES CXX) include(CMakePackageConfigHelpers) include(CheckCXXCompilerFlag) diff --git a/VERSION b/VERSION index 4764627..e0af123 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.9.2 \ No newline at end of file +3.11.0 \ No newline at end of file From 659072cf4c7dad2106e894e8395b4949cc055497 Mon Sep 17 00:00:00 2001 From: Orange Date: Mon, 27 Oct 2025 11:05:55 +0300 Subject: [PATCH 26/26] considered to switch to v4 --- CMakeLists.txt | 2 +- VERSION | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6fde8db..ed684ca 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.26) -project(omath VERSION 3.11.0 LANGUAGES CXX) +project(omath VERSION 4.0.0 LANGUAGES CXX) include(CMakePackageConfigHelpers) include(CheckCXXCompilerFlag) diff --git a/VERSION b/VERSION index e0af123..0c89fc9 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.11.0 \ No newline at end of file +4.0.0 \ No newline at end of file