@@ -51,22 +51,23 @@ the `runtime` Cargo feature.
51
51
These libraries can be either be installed as a part of Clang or downloaded
52
52
[ here] ( http://llvm.org/releases/download.html ) .
53
53
54
- ** Note:** This crate supports finding versioned instances of ` libclang.so ` (e.g.,
55
- ` libclang.so.3.9 ` or ` libclang-3.9.so ` ). In the case where there are multiple instances to choose
56
- from, this crate will prefer an unversioned instance first, then the version with the shortest and
57
- highest version. For example, the following instances of ` libclang.so ` are listed in descending
58
- order of preference:
59
-
60
- 1 . ` libclang.so `
61
- 2 . ` libclang.so.4 `
62
- 3 . ` libclang.so.4.0 `
63
- 4 . ` libclang.so.3 `
64
- 5 . ` libclang.so.3.9 `
65
-
66
54
** Note:** The downloads for LLVM and Clang 3.8 and later do not include the ` libclang.a ` static
67
55
library. This means you cannot link to any of these versions of ` libclang ` statically unless you
68
56
build it from source.
69
57
58
+ ### Versioned Dependencies
59
+
60
+ This crate supports finding versioned instances of ` libclang.so ` (e.g.,` libclang-3.9.so ` ).
61
+ In the case where there are multiple instances to choose from, this crate will prefer instances with
62
+ higher versions. For example, the following instances of ` libclang.so ` are listed in descending
63
+ order of preference:
64
+
65
+ 1 . ` libclang-4.0.so `
66
+ 2 . ` libclang-4.so `
67
+ 3 . ` libclang-3.9.so `
68
+ 4 . ` libclang-3.so `
69
+ 5 . ` libclang.so `
70
+
70
71
## Environment Variables
71
72
72
73
The following environment variables, if set, are used by this crate to find the required libraries
@@ -83,11 +84,12 @@ and executables:
83
84
84
85
### Dynamic
85
86
86
- First, the ` libclang ` shared library will be searched for in the directory provided by the
87
- ` LIBCLANG_PATH ` environment variable if it was set. If this fails, the directory returned by
88
- ` llvm-config --libdir ` will be searched. Failing that, the directories in the ` LD_LIBRARY_PATH `
89
- environment variable will be searched. If none of these approaches is successful, a list of likely
90
- directories will be searched (e.g., ` /usr/local/lib ` on Linux).
87
+ ` libclang ` shared libraries will be searched for in the following directories:
88
+
89
+ * the directory provided by the ` LIBCLANG_PATH ` environment variable
90
+ * the directory returned by ` llvm-config --libdir `
91
+ * the directories provided by ` LD_LIBRARY_PATH ` environment variable
92
+ * a list of likely directories for the target platform (e.g., ` /usr/local/lib ` on Linux)
91
93
92
94
On Linux, running an executable that has been dynamically linked to ` libclang ` may require you to
93
95
add a path to ` libclang.so ` to the ` LD_LIBRARY_PATH ` environment variable. The same is true on OS
@@ -101,8 +103,8 @@ On Windows, running an executable that has been dynamically linked to `libclang`
101
103
102
104
The availability of ` llvm-config ` is not optional for static linking. Ensure that an instance of
103
105
this executable can be found on your system's path or set the ` LLVM_CONFIG_PATH ` environment
104
- variable. The required LLVM and Clang static libraries will be searched for in the same way as the
105
- shared library is searched for, except the ` LIBCLANG_STATIC_PATH ` environment variable is used in
106
+ variable. The required LLVM and Clang static libraries will be searched for in the same way as
107
+ shared libraries are searched for, except the ` LIBCLANG_STATIC_PATH ` environment variable is used in
106
108
place of the ` LIBCLANG_PATH ` environment variable.
107
109
108
110
### Runtime
0 commit comments