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

Commit 0ae0146

Browse files
authored
fix: only use dll search path if ENGINE_PATH is not set (#1808)
* fix: only use dll search path if ENGINE_PATH is not set * chore: remove unused
1 parent 33be8d8 commit 0ae0146

File tree

1 file changed

+16
-14
lines changed

1 file changed

+16
-14
lines changed

engine/services/engine_service.cc

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -704,21 +704,23 @@ cpp::result<void, std::string> EngineService::LoadEngine(
704704

705705
#if defined(_WIN32) || defined(_WIN64)
706706
// register deps
707-
std::vector<std::filesystem::path> paths{};
708-
paths.push_back(std::move(cuda_path));
709-
paths.push_back(std::move(engine_dir_path));
710-
711-
CTL_DBG("Registering dylib for "
712-
<< ne << " with " << std::to_string(paths.size()) << " paths.");
713-
for (const auto& path : paths) {
714-
CTL_DBG("Registering path: " << path.string());
715-
}
707+
if (!(getenv("ENGINE_PATH"))) {
708+
std::vector<std::filesystem::path> paths{};
709+
paths.push_back(std::move(cuda_path));
710+
paths.push_back(std::move(engine_dir_path));
716711

717-
auto reg_result = dylib_path_manager_->RegisterPath(ne, paths);
718-
if (reg_result.has_error()) {
719-
CTL_DBG("Failed register lib paths for: " << ne);
720-
} else {
721-
CTL_DBG("Registered lib paths for: " << ne);
712+
CTL_DBG("Registering dylib for "
713+
<< ne << " with " << std::to_string(paths.size()) << " paths.");
714+
for (const auto& path : paths) {
715+
CTL_DBG("Registering path: " << path.string());
716+
}
717+
718+
auto reg_result = dylib_path_manager_->RegisterPath(ne, paths);
719+
if (reg_result.has_error()) {
720+
CTL_DBG("Failed register lib paths for: " << ne);
721+
} else {
722+
CTL_DBG("Registered lib paths for: " << ne);
723+
}
722724
}
723725
#endif
724726

0 commit comments

Comments
 (0)