From 2c7e443f521e59a6c9592cee529f194cb822a74a 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 a2721188..75c4848a 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 8adf5db40936e34edaf57d98b09afe34de609680 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 8338ee95..3d61db9c 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 2994144a..7f161736 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 25d6a6de..48b02785 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 00000000..0e6ddea1 --- /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 00000000..0a8c9c15 --- /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 69575c1cb3b0f9d3458f8017c9b0c840c7030696 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 3d61db9c..26df32f0 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 81aef681437cc1cb98f309b9d6f769ff3468dc87 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 26df32f0..d68071c1 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 0a8c9c15..1fd4afc8 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 878e3358c0dd8c1b8e6545f3e51f8e7717622dbe 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 d68071c1..d57f26e7 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 a37b0c3b..5f13630a 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 1fd4afc8..519781d1 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 171b4ca3da250e083e62ff26641cebe349de443d 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 13aee868..aefcbfa1 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 063f43e74c69939d3f6755454607e2c5ffe08872 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 aefcbfa1..089421e2 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 5e4fae9e4250e8e611c02b55aa8f2b0db779e0d8 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 089421e2..2fc5be97 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 ed7220dc9c51693c5b384a1d60e69ceddbf38b81 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 5f13630a..5aa27b19 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 5630c2708e80af6ed61d38bcdffd917f360e921b 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 2fc5be97..40b7f0ed 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 87b94fb7..e69de29b 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 d57f26e7..e4b4427d 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 5aa27b19..1608eed4 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 124e35a2..fe48e3a9 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 3ed280fe..00000000 --- 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 2948b6a2..00000000 --- a/extlibs/benchmark +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 2948b6a2e61ccabecc952c24794c6960d86c9ed6 diff --git a/extlibs/googletest b/extlibs/googletest deleted file mode 160000 index 52eb8108..00000000 --- a/extlibs/googletest +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 52eb8108c5bdec04579160ae17225d66034bd723 diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 5d932572..0ab0c990 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 490ccfe9834595bfe66c48bbb20f26e633051d40 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 1608eed4..fbc79e4d 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 69d0b7b82994464be9ef7d122ef7847e37b3daf6 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 fbc79e4d..1608eed4 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 ee40979a2dbdfe6045dccdce67c149725852a731 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 1608eed4..70f92c78 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 ae347c850978fa37e736d804862981af2c375726 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 40b7f0ed..b704b9d1 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 e38df8bd236d695bee4c7b649f0ed5d1656ff926 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 519781d1..3358a09a 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 f75afb8354fb234c84df50362ce82e27cb01de88 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 b704b9d1..01cca253 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 3358a09a..519781d1 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 5f22499b66dee43e3df24cda123b90e35ad99659 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 0ab0c990..67de285b 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 30568f36339b6d0263d574e4b9a69ec8c9c014a9 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 e4b4427d..03895917 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 9be7ca886dce93b63812cced3e81dd780c18132a 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 03895917..2d7f6e82 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 4d9e055bb30f8c027a99711c5fa6566817070f64 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 86259595..931f241b 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 62e7ccb0541d1c2eac47e6ef2bdaac136cd9ce44 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 2d7f6e82..ef8a069e 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 70f92c78..654bfe1f 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 d751eaf13215d60b34c4915c1fed66f645f3e7d4 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 654bfe1f..3aced04b 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 b3646ab708c6efb90497299b97dc9fc047d981bf 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 00000000..f14bf6ba --- /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 5c2d09b175ca3d0de63b8a53d953e251f2c1f982 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 519781d1..3358a09a 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 c8f77de4f251e0b48d3568405a27e147bee252e6 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 ef8a069e..6fde8dba 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 4764627f..e0af1238 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 6fbc010fa17ef73b9a782a6522100fdf2a38af22 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 6fde8dba..ed684ca1 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 e0af1238..0c89fc92 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