Skip to content
This repository was archived by the owner on Jul 4, 2025. It is now read-only.

Commit 201a6a0

Browse files
committed
chore: suppress more warnings on Windows
1 parent b31878d commit 201a6a0

File tree

5 files changed

+9
-33
lines changed

5 files changed

+9
-33
lines changed

engine/CMakeLists.txt

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,7 @@ project(cortex-server C CXX)
44

55
include(CheckIncludeFileCXX)
66

7-
check_include_file_cxx(any HAS_ANY)
8-
check_include_file_cxx(string_view HAS_STRING_VIEW)
9-
check_include_file_cxx(coroutine HAS_COROUTINE)
10-
if(HAS_ANY
11-
AND HAS_STRING_VIEW
12-
AND HAS_COROUTINE)
13-
set(CMAKE_CXX_STANDARD 20)
14-
elseif(HAS_ANY AND HAS_STRING_VIEW)
15-
set(CMAKE_CXX_STANDARD 17)
16-
else()
17-
set(CMAKE_CXX_STANDARD 14)
18-
endif()
19-
7+
set(CMAKE_CXX_STANDARD 17)
208
set(CMAKE_CXX_STANDARD_REQUIRED ON)
219
set(CMAKE_CXX_EXTENSIONS OFF)
2210
set(OPENSSL_USE_STATIC_LIBS TRUE)

engine/cli/CMakeLists.txt

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,7 @@ project(cortex C CXX)
22

33
include(CheckIncludeFileCXX)
44

5-
check_include_file_cxx(any HAS_ANY)
6-
check_include_file_cxx(string_view HAS_STRING_VIEW)
7-
check_include_file_cxx(coroutine HAS_COROUTINE)
8-
if(HAS_ANY
9-
AND HAS_STRING_VIEW
10-
AND HAS_COROUTINE)
11-
set(CMAKE_CXX_STANDARD 20)
12-
elseif(HAS_ANY AND HAS_STRING_VIEW)
13-
set(CMAKE_CXX_STANDARD 17)
14-
else()
15-
set(CMAKE_CXX_STANDARD 14)
16-
endif()
17-
5+
set(CMAKE_CXX_STANDARD 17)
186
set(CMAKE_CXX_STANDARD_REQUIRED ON)
197
set(CMAKE_CXX_EXTENSIONS OFF)
208
set(OPENSSL_USE_STATIC_LIBS TRUE)

engine/database/engines.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ std::optional<EngineEntry> Engines::UpsertEngine(
6060
} else {
6161
return std::nullopt;
6262
}
63-
} catch (const std::exception& e) {
63+
} catch (const std::exception&) {
6464
return std::nullopt;
6565
}
6666
}
@@ -87,7 +87,7 @@ std::optional<std::vector<EngineEntry>> Engines::GetEngines() const {
8787
}
8888

8989
return engines;
90-
} catch (const std::exception& e) {
90+
} catch (const std::exception&) {
9191
return std::nullopt;
9292
}
9393
}
@@ -115,7 +115,7 @@ std::optional<EngineEntry> Engines::GetEngineById(int id) const {
115115
} else {
116116
return std::nullopt;
117117
}
118-
} catch (const std::exception& e) {
118+
} catch (const std::exception&) {
119119
return std::nullopt;
120120
}
121121
}
@@ -155,7 +155,7 @@ std::optional<EngineEntry> Engines::GetEngineByNameAndVariant(
155155
} else {
156156
return std::nullopt;
157157
}
158-
} catch (const std::exception& e) {
158+
} catch (const std::exception&) {
159159
return std::nullopt;
160160
}
161161
}

engine/utils/dylib_path_manager.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include "dylib_path_manager.h"
22
#include "utils/logging_utils.h"
3+
#include "utils/widechar_conv.h"
34

45
namespace cortex {
56

@@ -12,8 +13,7 @@ cpp::result<void, std::string> DylibPathManager::RegisterPath(
1213
return cpp::fail("Path does not exist: " + path.string());
1314
}
1415

15-
std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>> converter;
16-
std::wstring wide_path = converter.from_bytes(path.string());
16+
auto wide_path = cortex::wc::Utf8ToWstring(path.string());
1717

1818
auto cookie = AddDllDirectory(wide_path.c_str());
1919
if (cookie == nullptr) {

engine/utils/huggingface_utils.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ inline cpp::result<std::string, std::string> GetModelAuthorCortexsoHub(
339339
return author.as<std::string>();
340340
}
341341
return "";
342-
} catch (const std::exception& e) {
342+
} catch (const std::exception&) {
343343
return "";
344344
}
345345
}

0 commit comments

Comments
 (0)