Skip to content

Commit ee48691

Browse files
committed
fix
1 parent bfada22 commit ee48691

File tree

8 files changed

+21
-16
lines changed

8 files changed

+21
-16
lines changed

CMakeLists.txt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.31)
1+
cmake_minimum_required(VERSION 4.1)
22

33
project(omath VERSION 3.5.0 LANGUAGES CXX)
44

@@ -95,9 +95,10 @@ if (OMATH_STATIC_MSVC_RUNTIME_LIBRARY)
9595
)
9696
endif ()
9797

98-
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
99-
target_compile_options(${PROJECT_NAME} PRIVATE -mavx2 -mfma)
100-
endif ()
98+
target_compile_options(omath PUBLIC
99+
$<$<CXX_COMPILER_ID:Clang>:-mavx2 -mfma>
100+
$<$<CXX_COMPILER_ID:GNU>:-mavx2 -mfma>
101+
)
101102

102103
target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_23)
103104

CMakePresets.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@
4040
"binaryDir": "${sourceDir}/cmake-build/build/${presetName}",
4141
"installDir": "${sourceDir}/cmake-build/install/${presetName}",
4242
"cacheVariables": {
43-
"CMAKE_C_COMPILER": "clang",
44-
"CMAKE_CXX_COMPILER": "clang++"
43+
"CMAKE_C_COMPILER": "gcc",
44+
"CMAKE_CXX_COMPILER": "g++"
4545
},
4646
"condition": {
4747
"type": "equals",

modules/linear_algebra/mat.ixx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ module;
1111
#include <stdexcept>
1212
#include <utility>
1313
#include <format>
14+
#include <cmath>
1415

1516
export module omath.mat;
1617

modules/linear_algebra/vector3.ixx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ export namespace omath
286286
};
287287
} // namespace omath
288288

289-
export template<> struct std::hash<omath::Vector3<float>>
289+
export template<Ц> struct std::hash<omath::Vector3<float>>
290290
{
291291
std::size_t operator()(const omath::Vector3<float>& vec) const noexcept
292292
{

modules/pathfinding/a_star.ixx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export namespace omath::pathfinding
4545

4646
while (!open_list.empty())
4747
{
48-
auto current_it = get_perfect_node(open_list, end_vertex);
48+
const auto current_it = get_perfect_node(open_list, end_vertex);
4949

5050
const auto current = current_it->first;
5151
const auto current_node = current_it->second;
@@ -98,9 +98,9 @@ export namespace omath::pathfinding
9898
std::ranges::reverse(path);
9999
return path;
100100
}
101-
101+
using MapType = std::unordered_map<Vector3<float>, PathNode>;
102102
[[nodiscard]]
103-
static auto get_perfect_node(const std::unordered_map<Vector3<float>, PathNode>& open_list,
103+
static MapType::const_iterator get_perfect_node(const std::unordered_map<Vector3<float>, PathNode>& open_list,
104104
const Vector3<float>& end_vertex) noexcept
105105
{
106106
return std::ranges::min_element(open_list,

modules/pathfinding/navigation_mesh.ixx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,15 @@
22
// Created by Vlad on 9/3/2025.
33
//
44
module;
5-
#include <vector>
6-
#include <unordered_map>
5+
#include <algorithm>
6+
#include <cstdint>
77
#include <expected>
8-
#include <string>
8+
#include <ranges>
99
#include <stdexcept>
10+
#include <string>
11+
#include <unordered_map>
12+
#include <vector>
13+
1014
export module omath.pathfinding.navigation_mesh;
1115
export import omath.vector3;
1216

@@ -67,7 +71,7 @@ export namespace omath::pathfinding
6771
return raw;
6872
}
6973

70-
void deserialize(const std::vector<uint8_t>& raw) noexcept
74+
void deserialize(const std::vector<std::uint8_t>& raw) noexcept
7175
{
7276
auto load_from_vector = [](const std::vector<uint8_t>& vec, size_t& offset, auto& value)
7377
{

modules/projection/camera.ixx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export module omath.camera;
1212
export import omath.vector3;
1313
export import omath.angle;
1414
export import omath.error_codes;
15+
export import omath.mat;
1516

1617
export namespace omath::projection
1718
{

tests/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ set_target_properties(unit_tests PROPERTIES
1111
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/out/${CMAKE_BUILD_TYPE}"
1212
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/out/${CMAKE_BUILD_TYPE}"
1313
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/out/${CMAKE_BUILD_TYPE}"
14-
UNITY_BUILD ON
15-
UNITY_BUILD_BATCH_SIZE 20
1614
CXX_STANDARD 23
1715
CXX_STANDARD_REQUIRED ON)
1816

0 commit comments

Comments
 (0)