|
| 1 | +//! Provides a mechanism for locating the OpenVINO shared libraries installed on a system. |
| 2 | +
|
| 3 | +#![deny(missing_docs)] |
| 4 | +#![deny(clippy::all)] |
| 5 | +#![warn(clippy::pedantic)] |
| 6 | +#![warn(clippy::cargo)] |
| 7 | +#![allow(clippy::must_use_candidate)] |
| 8 | + |
1 | 9 | use cfg_if::cfg_if;
|
2 | 10 | use std::env;
|
3 | 11 | use std::path::PathBuf;
|
@@ -82,46 +90,46 @@ pub fn find(library_name: &str) -> Option<PathBuf> {
|
82 | 90 | None
|
83 | 91 | }
|
84 | 92 |
|
85 |
| -const ENV_OPENVINO_INSTALL_DIR: &'static str = "OPENVINO_INSTALL_DIR"; |
86 |
| -const ENV_OPENVINO_BUILD_DIR: &'static str = "OPENVINO_BUILD_DIR"; |
87 |
| -const ENV_INTEL_OPENVINO_DIR: &'static str = "INTEL_OPENVINO_DIR"; |
| 93 | +const ENV_OPENVINO_INSTALL_DIR: &str = "OPENVINO_INSTALL_DIR"; |
| 94 | +const ENV_OPENVINO_BUILD_DIR: &str = "OPENVINO_BUILD_DIR"; |
| 95 | +const ENV_INTEL_OPENVINO_DIR: &str = "INTEL_OPENVINO_DIR"; |
88 | 96 |
|
89 | 97 | cfg_if! {
|
90 | 98 | if #[cfg(any(target_os = "linux"))] {
|
91 |
| - const ENV_LIBRARY_PATH: &'static str = "LD_LIBRARY_PATH"; |
| 99 | + const ENV_LIBRARY_PATH: &str = "LD_LIBRARY_PATH"; |
92 | 100 | } else if #[cfg(target_os = "macos")] {
|
93 |
| - const ENV_LIBRARY_PATH: &'static str = "DYLD_LIBRARY_PATH"; |
| 101 | + const ENV_LIBRARY_PATH: &str = "DYLD_LIBRARY_PATH"; |
94 | 102 | } else if #[cfg(target_os = "windows")] {
|
95 |
| - const ENV_LIBRARY_PATH: &'static str = "PATH"; |
| 103 | + const ENV_LIBRARY_PATH: &str = "PATH"; |
96 | 104 | } else {
|
97 | 105 | // This may not work but seems like a sane default for target OS' not listed above.
|
98 |
| - const ENV_LIBRARY_PATH: &'static str = "LD_LIBRARY_PATH"; |
| 106 | + const ENV_LIBRARY_PATH: &str = "LD_LIBRARY_PATH"; |
99 | 107 | }
|
100 | 108 | }
|
101 | 109 |
|
102 | 110 | cfg_if! {
|
103 | 111 | if #[cfg(any(target_os = "linux", target_os = "macos"))] {
|
104 |
| - const DEFAULT_INSTALLATION_DIRECTORIES: &'static [&'static str] = |
| 112 | + const DEFAULT_INSTALLATION_DIRECTORIES: & [& str] = |
105 | 113 | &["/opt/intel/openvino_2021", "/opt/intel/openvino"];
|
106 | 114 | } else if #[cfg(target_os = "windows")] {
|
107 |
| - const DEFAULT_INSTALLATION_DIRECTORIES: &'static [&'static str] = &[ |
| 115 | + const DEFAULT_INSTALLATION_DIRECTORIES: & [& str] = &[ |
108 | 116 | "C:\\Program Files (x86)\\Intel\\openvino",
|
109 | 117 | "C:\\Program Files (x86)\\Intel\\openvino_2021",
|
110 | 118 | ];
|
111 | 119 | } else {
|
112 |
| - const DEFAULT_INSTALLATION_DIRECTORIES: &'static [&'static str] = &[]; |
| 120 | + const DEFAULT_INSTALLATION_DIRECTORIES: & [& str] = &[]; |
113 | 121 | }
|
114 | 122 | }
|
115 | 123 |
|
116 |
| -const KNOWN_INSTALLATION_SUBDIRECTORIES: &'static [&'static str] = &[ |
| 124 | +const KNOWN_INSTALLATION_SUBDIRECTORIES: &[&str] = &[ |
117 | 125 | "deployment_tools/ngraph/lib",
|
118 | 126 | "deployment_tools/inference_engine/lib/intel64",
|
119 | 127 | "deployment_tools/inference_engine/external/hddl/lib",
|
120 | 128 | "deployment_tools/inference_engine/external/gna/lib",
|
121 | 129 | "deployment_tools/inference_engine/external/tbb/lib",
|
122 | 130 | ];
|
123 | 131 |
|
124 |
| -const KNOWN_BUILD_SUBDIRECTORIES: &'static [&'static str] = &[ |
| 132 | +const KNOWN_BUILD_SUBDIRECTORIES: &[&str] = &[ |
125 | 133 | "bin/intel64/Debug/lib",
|
126 | 134 | "bin/intel64/Release/lib",
|
127 | 135 | "inference-engine/temp/tbb/lib",
|
|
0 commit comments