mirror of
https://github.com/orange-cpp/omath.git
synced 2026-02-13 15:03:27 +00:00
Compare commits
31 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 60e744978c | |||
| 495a2a80e4 | |||
| 6fbc010fa1 | |||
| c8f77de4f2 | |||
| 5c2d09b175 | |||
| b3646ab708 | |||
| d751eaf132 | |||
| 62e7ccb054 | |||
| 4d9e055bb3 | |||
| 9be7ca886d | |||
| 30568f3633 | |||
| 5f22499b66 | |||
| f75afb8354 | |||
| e38df8bd23 | |||
| ae347c8509 | |||
| ee40979a2d | |||
| 69d0b7b829 | |||
| 490ccfe983 | |||
| 5630c2708e | |||
| ed7220dc9c | |||
| 5e4fae9e42 | |||
| 063f43e74c | |||
| 171b4ca3da | |||
| 878e3358c0 | |||
| 81aef68143 | |||
| e2a37f2c81 | |||
| 69575c1cb3 | |||
| 8adf5db409 | |||
| 2c7e443f52 | |||
| 6ad4ef29e9 | |||
| 8feb805067 |
21
.github/workflows/cmake-multi-platform.yml
vendored
21
.github/workflows/cmake-multi-platform.yml
vendored
@@ -19,23 +19,28 @@ jobs:
|
|||||||
name: Arch Linux (Clang)
|
name: Arch Linux (Clang)
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container: archlinux:latest
|
container: archlinux:latest
|
||||||
|
env:
|
||||||
|
VCPKG_ROOT: ${{ github.workspace }}/vcpkg
|
||||||
steps:
|
steps:
|
||||||
- name: Install basic tool-chain with pacman
|
- name: Install basic tool-chain with pacman
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
pacman -Sy --noconfirm archlinux-keyring
|
pacman -Sy --noconfirm archlinux-keyring
|
||||||
pacman -Syu --noconfirm --needed \
|
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)
|
- name: Checkout repository (with sub-modules)
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
|
|
||||||
|
- name: Set up vcpkg
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
git clone https://github.com/microsoft/vcpkg "$VCPKG_ROOT"
|
||||||
- name: Configure (cmake --preset)
|
- name: Configure (cmake --preset)
|
||||||
shell: bash
|
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 -DVCPKG_MANIFEST_FEATURES="imgui;avx2;tests"
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
shell: bash
|
shell: bash
|
||||||
@@ -47,12 +52,14 @@ jobs:
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
# 2) Windows – MSVC / Ninja
|
# 2) Windows – MSVC / Ninja
|
||||||
##############################################################################
|
##############################################################################
|
||||||
windows-build-and-test:
|
windows-build-and-test:
|
||||||
name: Windows (MSVC)
|
name: Windows (MSVC)
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
|
env:
|
||||||
|
OMATH_BUILD_VIA_VCPKG: ON
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository (with sub-modules)
|
- name: Checkout repository (with sub-modules)
|
||||||
@@ -68,7 +75,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Configure (cmake --preset)
|
- name: Configure (cmake --preset)
|
||||||
shell: bash
|
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 -DVCPKG_MANIFEST_FEATURES="imgui;avx2;tests"
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|||||||
6
.gitmodules
vendored
6
.gitmodules
vendored
@@ -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
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
cmake_minimum_required(VERSION 3.26)
|
cmake_minimum_required(VERSION 3.26)
|
||||||
|
|
||||||
project(omath VERSION 3.9.2 LANGUAGES CXX)
|
project(omath VERSION 4.0.0 LANGUAGES CXX)
|
||||||
|
|
||||||
include(CMakePackageConfigHelpers)
|
include(CMakePackageConfigHelpers)
|
||||||
include(CheckCXXCompilerFlag)
|
include(CheckCXXCompilerFlag)
|
||||||
@@ -11,8 +11,8 @@ else ()
|
|||||||
check_cxx_compiler_flag("-mavx2" COMPILER_SUPPORTS_AVX2)
|
check_cxx_compiler_flag("-mavx2" COMPILER_SUPPORTS_AVX2)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
option(OMATH_BUILD_TESTS "Build unit tests" ${PROJECT_IS_TOP_LEVEL})
|
option(OMATH_BUILD_TESTS "Build unit tests" OFF)
|
||||||
option(OMATH_BUILD_BENCHMARK "Build benchmarks" ${PROJECT_IS_TOP_LEVEL})
|
option(OMATH_BUILD_BENCHMARK "Build benchmarks" OFF)
|
||||||
option(OMATH_THREAT_WARNING_AS_ERROR "Set highest level of warnings and force compiler to treat them as errors" ON)
|
option(OMATH_THREAT_WARNING_AS_ERROR "Set highest level of warnings and force compiler to treat them as errors" ON)
|
||||||
option(OMATH_BUILD_AS_SHARED_LIBRARY "Build Omath as .so or .dll" OFF)
|
option(OMATH_BUILD_AS_SHARED_LIBRARY "Build Omath as .so or .dll" OFF)
|
||||||
option(OMATH_USE_AVX2 "Omath will use AVX2 to boost performance" ${COMPILER_SUPPORTS_AVX2})
|
option(OMATH_USE_AVX2 "Omath will use AVX2 to boost performance" ${COMPILER_SUPPORTS_AVX2})
|
||||||
@@ -21,7 +21,28 @@ 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_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_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_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)
|
||||||
|
|
||||||
|
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)
|
||||||
|
elseif (omath_feature STREQUAL "avx2")
|
||||||
|
set(OMATH_USE_AVX2 ${COMPILER_SUPPORTS_AVX2})
|
||||||
|
elseif (omath_feature STREQUAL "tests")
|
||||||
|
set(OMATH_BUILD_TESTS ON)
|
||||||
|
elseif (omath_feature STREQUAL "benchmark")
|
||||||
|
set(OMATH_BUILD_BENCHMARK ON)
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
endforeach ()
|
||||||
|
endif ()
|
||||||
|
|
||||||
if (OMATH_USE_AVX2 AND NOT COMPILER_SUPPORTS_AVX2)
|
if (OMATH_USE_AVX2 AND NOT COMPILER_SUPPORTS_AVX2)
|
||||||
message(WARNING "OMATH_USE_AVX2 requested, but compiler/target does not support AVX2. Disabling.")
|
message(WARNING "OMATH_USE_AVX2 requested, but compiler/target does not support AVX2. Disabling.")
|
||||||
@@ -40,6 +61,7 @@ if (${PROJECT_IS_TOP_LEVEL})
|
|||||||
message(STATUS "[${PROJECT_NAME}]: AVX2 feature status ${OMATH_USE_AVX2}")
|
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}]: ImGUI integration feature status ${OMATH_IMGUI_INTEGRATION}")
|
||||||
message(STATUS "[${PROJECT_NAME}]: Legacy features support ${OMATH_ENABLE_LEGACY}")
|
message(STATUS "[${PROJECT_NAME}]: Legacy features support ${OMATH_ENABLE_LEGACY}")
|
||||||
|
message(STATUS "[${PROJECT_NAME}]: Building using vcpkg ${OMATH_BUILD_VIA_VCPKG}")
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
file(GLOB_RECURSE OMATH_SOURCES CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/source/*.cpp")
|
file(GLOB_RECURSE OMATH_SOURCES CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/source/*.cpp")
|
||||||
@@ -84,7 +106,7 @@ if (OMATH_SUPRESS_SAFETY_CHECKS)
|
|||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
if (OMATH_ENABLE_LEGACY)
|
if (OMATH_ENABLE_LEGACY)
|
||||||
target_compile_options(${PROJECT_NAME} PUBLIC OMATH_ENABLE_LEGACY)
|
target_compile_definitions(${PROJECT_NAME} PUBLIC OMATH_ENABLE_LEGACY)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
set_target_properties(${PROJECT_NAME} PROPERTIES
|
set_target_properties(${PROJECT_NAME} PROPERTIES
|
||||||
@@ -117,9 +139,6 @@ endif ()
|
|||||||
|
|
||||||
target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_23)
|
target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_23)
|
||||||
|
|
||||||
add_subdirectory(extlibs)
|
|
||||||
|
|
||||||
|
|
||||||
if (OMATH_BUILD_TESTS)
|
if (OMATH_BUILD_TESTS)
|
||||||
add_subdirectory(tests)
|
add_subdirectory(tests)
|
||||||
target_compile_definitions(${PROJECT_NAME} PUBLIC OMATH_BUILD_TESTS)
|
target_compile_definitions(${PROJECT_NAME} PUBLIC OMATH_BUILD_TESTS)
|
||||||
|
|||||||
@@ -8,7 +8,10 @@
|
|||||||
"binaryDir": "${sourceDir}/cmake-build/build/${presetName}",
|
"binaryDir": "${sourceDir}/cmake-build/build/${presetName}",
|
||||||
"installDir": "${sourceDir}/cmake-build/install/${presetName}",
|
"installDir": "${sourceDir}/cmake-build/install/${presetName}",
|
||||||
"cacheVariables": {
|
"cacheVariables": {
|
||||||
"CMAKE_CXX_COMPILER": "cl.exe"
|
"CMAKE_CXX_COMPILER": "cl.exe",
|
||||||
|
"CMAKE_TOOLCHAIN_FILE": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake",
|
||||||
|
"VCPKG_INSTALLED_DIR": "${sourceDir}/cmake-build/vcpkg_installed",
|
||||||
|
"CMAKE_MAKE_PROGRAM": "Ninja"
|
||||||
},
|
},
|
||||||
"condition": {
|
"condition": {
|
||||||
"type": "equals",
|
"type": "equals",
|
||||||
@@ -24,6 +27,25 @@
|
|||||||
"CMAKE_BUILD_TYPE": "Debug"
|
"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",
|
"name": "windows-release",
|
||||||
"displayName": "Release",
|
"displayName": "Release",
|
||||||
@@ -39,7 +61,10 @@
|
|||||||
"binaryDir": "${sourceDir}/cmake-build/build/${presetName}",
|
"binaryDir": "${sourceDir}/cmake-build/build/${presetName}",
|
||||||
"installDir": "${sourceDir}/cmake-build/install/${presetName}",
|
"installDir": "${sourceDir}/cmake-build/install/${presetName}",
|
||||||
"cacheVariables": {
|
"cacheVariables": {
|
||||||
"CMAKE_CXX_COMPILER": "clang++"
|
"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"
|
||||||
},
|
},
|
||||||
"condition": {
|
"condition": {
|
||||||
"type": "equals",
|
"type": "equals",
|
||||||
@@ -55,6 +80,15 @@
|
|||||||
"CMAKE_BUILD_TYPE": "Debug"
|
"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",
|
"name": "linux-release",
|
||||||
"displayName": "Linux Release",
|
"displayName": "Linux Release",
|
||||||
@@ -63,6 +97,15 @@
|
|||||||
"CMAKE_BUILD_TYPE": "Release"
|
"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",
|
"name": "darwin-base",
|
||||||
"hidden": true,
|
"hidden": true,
|
||||||
@@ -86,6 +129,15 @@
|
|||||||
"CMAKE_BUILD_TYPE": "Debug"
|
"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",
|
"name": "darwin-release",
|
||||||
"displayName": "Darwin Release",
|
"displayName": "Darwin Release",
|
||||||
@@ -93,6 +145,15 @@
|
|||||||
"cacheVariables": {
|
"cacheVariables": {
|
||||||
"CMAKE_BUILD_TYPE": "Release"
|
"CMAKE_BUILD_TYPE": "Release"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "darwin-release-vcpkg",
|
||||||
|
"displayName": "Darwin Release",
|
||||||
|
"inherits": "darwin-debug",
|
||||||
|
"cacheVariables": {
|
||||||
|
"CMAKE_BUILD_TYPE": "Release",
|
||||||
|
"OMATH_BUILD_VIA_VCPKG": "ON"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
38
LICENSE
38
LICENSE
@@ -1,7 +1,7 @@
|
|||||||
Copyright (C) 2024-2025 Orange++ <orange_github@proton.me>
|
Copyright (C) 2024-2025 Orange++ <orange_github@proton.me>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
arising from the use of this software.
|
arising from the use of this software.
|
||||||
|
|
||||||
Permission is granted to anyone to use this software for any purpose,
|
Permission is granted to anyone to use this software for any purpose,
|
||||||
@@ -16,14 +16,44 @@ freely, subject to the following restrictions:
|
|||||||
misrepresented as being the original software.
|
misrepresented as being the original software.
|
||||||
3. This notice may not be removed or altered from any source distribution.
|
3. This notice may not be removed or altered from any source distribution.
|
||||||
4. If you are an employee, contractor, volunteer, representative,
|
4. If you are an employee, contractor, volunteer, representative,
|
||||||
or have any other affiliation (past, present, or future)
|
or have any other affiliation (past or present)
|
||||||
with any of the following entities:
|
with any of the following entities:
|
||||||
|
* "Advertising Placement Services" LLC
|
||||||
|
* "NEW SOLUTIONS VERTICALS" LLC
|
||||||
|
* "Autoexpert" LLC
|
||||||
|
* "Creditit" LLC
|
||||||
|
* "Yandex.Taxi" LLC
|
||||||
|
* "Yandex.Eda" LLC
|
||||||
|
* "Yandex.Lavka" LLC
|
||||||
|
* "Yandex.Telecom" LLC
|
||||||
|
* "Yandex.Cloud" LLC
|
||||||
|
* "Micromobility" LLC
|
||||||
|
* "MM-Tech" LLC
|
||||||
|
* "Carsharing" LLC
|
||||||
|
* "Yandex.Drive" LLC
|
||||||
|
* "EDADIL PROMO" LLC
|
||||||
|
* "Kinopoisk" LLC
|
||||||
|
* "Yandex.Music" LLC
|
||||||
|
* "Refueling (Yandex.Zapravki)" LLC
|
||||||
|
* "Yandex.Pay" LLC
|
||||||
|
* "Financial and Payment Technologies" LLC
|
||||||
|
* "Yandex.Delivery" LLC
|
||||||
|
* "Delivery Club" LLC
|
||||||
|
* "Yandex.Check" LLC
|
||||||
|
* "SMB-Service" LLC
|
||||||
|
* "ADV-TECH" LLC
|
||||||
|
* "Yandex Fantech" LLC
|
||||||
|
* "Yandex Smena" LLC
|
||||||
|
* "Market.Operations" LLC
|
||||||
|
* "Yandex.Market" LLC
|
||||||
|
* "ID Tech" LLC
|
||||||
|
* "Yandex.Crowd" LLC
|
||||||
* "Yandex" LLC
|
* "Yandex" LLC
|
||||||
* "Rutube" LLC
|
* "Rutube" LLC
|
||||||
* "Kaspersky" LLC
|
* "Kaspersky" LLC
|
||||||
Or if you represent or are associated with any legal, organizational, or
|
Or if you represent or are associated with any legal, organizational, or
|
||||||
professional entity providing services to or on behalf of the aforementioned entities:
|
professional entity providing services to or on behalf of the aforementioned entities:
|
||||||
You are expressly forbidden from accessing, using, modifying, distributing, or
|
You are expressly forbidden from accessing, using, modifying, distributing, or
|
||||||
interacting with the Software and its source code in any form. You must immediately
|
interacting with the Software and its source code in any form. You must immediately
|
||||||
delete or destroy any physical or digital copies of the Software and/or
|
delete or destroy any physical or digital copies of the Software and/or
|
||||||
its source code, including any derivative works, tools, or information obtained from the Software.
|
its source code, including any derivative works, tools, or information obtained from the Software.
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ It provides the latest features, is highly customizable, has all for cheat devel
|
|||||||
- **Collision Detection**: Production ready code to handle collision detection by using simple interfaces.
|
- **Collision Detection**: Production ready code to handle collision detection by using simple interfaces.
|
||||||
- **No Additional Dependencies**: No additional dependencies need to use OMath except unit test execution
|
- **No Additional Dependencies**: No additional dependencies need to use OMath except unit test execution
|
||||||
- **Ready for meta-programming**: Omath use templates for common types like Vectors, Matrixes etc, to handle all types!
|
- **Ready for meta-programming**: Omath use templates for common types like Vectors, Matrixes etc, to handle all types!
|
||||||
- **Engine support**: Supports coordinate systems of Source, Unity, Unreal, Frostbite, IWEngine and canonical OpenGL.
|
- **Engine support**: Supports coordinate systems of **Source, Unity, Unreal, Frostbite, IWEngine and canonical OpenGL**.
|
||||||
- **Cross platform**: Supports Windows, MacOS and Linux.
|
- **Cross platform**: Supports Windows, MacOS and Linux.
|
||||||
- **Algorithms**: Has ability to scan for byte pattern with wildcards in PE files/modules, binary slices, works even with Wine apps.
|
- **Algorithms**: Has ability to scan for byte pattern with wildcards in PE files/modules, binary slices, works even with Wine apps.
|
||||||
<div align = center>
|
<div align = center>
|
||||||
|
|||||||
@@ -11,5 +11,9 @@ set_target_properties(${PROJECT_NAME} PROPERTIES
|
|||||||
CXX_STANDARD 23
|
CXX_STANDARD 23
|
||||||
CXX_STANDARD_REQUIRED ON)
|
CXX_STANDARD_REQUIRED ON)
|
||||||
|
|
||||||
|
if (TARGET benchmark::benchmark)
|
||||||
target_link_libraries(${PROJECT_NAME} PRIVATE benchmark::benchmark omath)
|
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 ()
|
||||||
|
|||||||
@@ -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 ()
|
|
||||||
Submodule extlibs/benchmark deleted from 2948b6a2e6
Submodule extlibs/googletest deleted from 52eb8108c5
@@ -39,6 +39,7 @@ namespace omath
|
|||||||
class Mat final
|
class Mat final
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
using ContainedType = Type;
|
||||||
constexpr Mat() noexcept
|
constexpr Mat() noexcept
|
||||||
{
|
{
|
||||||
clear();
|
clear();
|
||||||
|
|||||||
@@ -221,7 +221,7 @@ namespace omath
|
|||||||
}
|
}
|
||||||
#ifdef OMATH_IMGUI_INTEGRATION
|
#ifdef OMATH_IMGUI_INTEGRATION
|
||||||
[[nodiscard]]
|
[[nodiscard]]
|
||||||
ImVec2 to_im_vec2() const noexcept
|
constexpr ImVec2 to_im_vec2() const noexcept
|
||||||
{
|
{
|
||||||
return {static_cast<float>(this->x), static_cast<float>(this->y)};
|
return {static_cast<float>(this->x), static_cast<float>(this->y)};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -184,7 +184,7 @@ namespace omath
|
|||||||
|
|
||||||
#ifdef OMATH_IMGUI_INTEGRATION
|
#ifdef OMATH_IMGUI_INTEGRATION
|
||||||
[[nodiscard]]
|
[[nodiscard]]
|
||||||
ImVec4 to_im_vec4() const noexcept
|
constexpr ImVec4 to_im_vec4() const noexcept
|
||||||
{
|
{
|
||||||
return {
|
return {
|
||||||
static_cast<float>(this->x),
|
static_cast<float>(this->x),
|
||||||
|
|||||||
@@ -233,7 +233,8 @@ namespace
|
|||||||
constexpr bool invalid_nt_header_file(const NtHeaderVariant& variant)
|
constexpr bool invalid_nt_header_file(const NtHeaderVariant& variant)
|
||||||
{
|
{
|
||||||
constexpr std::uint32_t nt_hdr_magic = 0x4550;
|
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
|
struct ExtractedSection
|
||||||
|
|||||||
@@ -15,5 +15,11 @@ set_target_properties(${PROJECT_NAME} PROPERTIES
|
|||||||
CXX_STANDARD_REQUIRED ON)
|
CXX_STANDARD_REQUIRED ON)
|
||||||
|
|
||||||
|
|
||||||
target_link_libraries(${PROJECT_NAME} PRIVATE gtest gtest_main omath::omath)
|
|
||||||
|
if (TARGET gtest)
|
||||||
|
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})
|
gtest_discover_tests(${PROJECT_NAME})
|
||||||
39
tests/general/unit_test_imgui_intergration.cpp
Normal file
39
tests/general/unit_test_imgui_intergration.cpp
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
//
|
||||||
|
// Created by Vlad on 10/23/2025.
|
||||||
|
//
|
||||||
|
#ifdef OMATH_IMGUI_INTEGRATION
|
||||||
|
#include <omath/omath.hpp>
|
||||||
|
#include <gtest/gtest.h>
|
||||||
|
|
||||||
|
#define IMGUI_DEFINE_MATH_OPERATORS
|
||||||
|
#include <imgui.h>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
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
|
||||||
14
vcpkg-configuration.json
Normal file
14
vcpkg-configuration.json
Normal file
@@ -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"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
42
vcpkg.json
Normal file
42
vcpkg.json
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
{
|
||||||
|
"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"
|
||||||
|
},
|
||||||
|
"benchmark": {
|
||||||
|
"description": "Build benchmarks",
|
||||||
|
"dependencies": [
|
||||||
|
"benchmark"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"imgui": {
|
||||||
|
"description": "Omath will define method to convert omath types to imgui types",
|
||||||
|
"dependencies": [
|
||||||
|
"imgui"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"tests": {
|
||||||
|
"description": "Build unit-tests using GTest",
|
||||||
|
"dependencies": [
|
||||||
|
"gtest"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user