Merge a69cbb910c57f277c1c13d460b614e6e9762219f on remote branch
Change-Id: Ib471b3bf4dbde9ecabf20740e28d52c3358da5a6
diff --git a/.cargo_vcs_info.json b/.cargo_vcs_info.json
index f643705..a2ce8d7 100644
--- a/.cargo_vcs_info.json
+++ b/.cargo_vcs_info.json
@@ -1,5 +1,5 @@
{
"git": {
- "sha1": "b11a95758757bc1163cd06a32c94709d2cbae92d"
+ "sha1": "a0bcae1a9d7ab6ed8de010b0f5e2b2020c20d204"
}
}
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index eadb8fb..993f360 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -15,7 +15,7 @@
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
- clang: [["10.0", "clang_10_0"]]
+ clang: [["11.0", "clang_11_0"]]
rust: ["1.40.0"]
steps:
- name: Checkout Repository
diff --git a/Android.bp b/Android.bp
index bf3c356..675916a 100644
--- a/Android.bp
+++ b/Android.bp
@@ -1,5 +1,22 @@
// This file is generated by cargo2android.py --run --features=runtime,clang_10_0 --dependencies --copy-out.
+package {
+ default_applicable_licenses: ["external_rust_crates_clang-sys_license"],
+}
+
+// Added automatically by a large-scale-change
+// See: http://go/android-license-faq
+license {
+ name: "external_rust_crates_clang-sys_license",
+ visibility: [":__subpackages__"],
+ license_kinds: [
+ "SPDX-license-identifier-Apache-2.0",
+ ],
+ license_text: [
+ "LICENSE.txt",
+ ],
+}
+
genrule {
name: "copy_clang-sys_build_out",
srcs: ["out/*"],
@@ -44,5 +61,5 @@
// dependent_library ["feature_list"]
// cfg-if-1.0.0
// glob-0.3.0
-// libc-0.2.80
-// libloading-0.6.5
+// libc-0.2.86
+// libloading-0.6.7
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 8b67c3a..7ed57c5 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,12 @@
+## [1.1.0] - 2021-02-09
+
+### Changed
+- Added Visual Studio LLVM component directory to search paths on Windows
+([#121](https://github.com/KyleMayes/clang-sys/issues/121))
+
+### Added
+- Added support for `clang` 11.0.x
+
## [1.0.3] - 2020-11-19
### Fixed
diff --git a/Cargo.toml b/Cargo.toml
index 3f1b777..4af7f4d 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -12,7 +12,7 @@
[package]
name = "clang-sys"
-version = "1.0.3"
+version = "1.1.0"
authors = ["Kyle Mayes <kyle@mayeses.com>"]
build = "build.rs"
links = "clang"
@@ -31,13 +31,14 @@
default-features = false
[dependencies.libloading]
-version = "0.6"
+version = "0.7"
optional = true
[build-dependencies.glob]
version = "0.3"
[features]
clang_10_0 = ["clang_9_0"]
+clang_11_0 = ["clang_10_0"]
clang_3_5 = []
clang_3_6 = ["clang_3_5"]
clang_3_7 = ["clang_3_6"]
diff --git a/Cargo.toml.orig b/Cargo.toml.orig
index a6dcb14..0b68df7 100644
--- a/Cargo.toml.orig
+++ b/Cargo.toml.orig
@@ -3,7 +3,7 @@
name = "clang-sys"
authors = ["Kyle Mayes <kyle@mayeses.com>"]
-version = "1.0.3"
+version = "1.1.0"
readme = "README.md"
license = "Apache-2.0"
@@ -30,6 +30,7 @@
clang_8_0 = ["clang_7_0"]
clang_9_0 = ["clang_8_0"]
clang_10_0 = ["clang_9_0"]
+clang_11_0 = ["clang_10_0"]
runtime = ["libloading"]
static = []
diff --git a/METADATA b/METADATA
index 8e336ed..7f71132 100644
--- a/METADATA
+++ b/METADATA
@@ -7,13 +7,13 @@
}
url {
type: ARCHIVE
- value: "https://static.crates.io/crates/clang-sys/clang-sys-1.0.3.crate"
+ value: "https://static.crates.io/crates/clang-sys/clang-sys-1.1.0.crate"
}
- version: "1.0.3"
+ version: "1.1.0"
license_type: NOTICE
last_upgrade_date {
- year: 2020
- month: 11
- day: 19
+ year: 2021
+ month: 2
+ day: 9
}
}
diff --git a/README.md b/README.md
index 48eeb75..dbee0ea 100644
--- a/README.md
+++ b/README.md
@@ -45,6 +45,7 @@
* `clang_8_0` - requires `libclang` 8.0 or later
* `clang_9_0` - requires `libclang` 9.0 or later
* `clang_10_0` - requires `libclang` 10.0 or later
+* `clang_11_0` - requires `libclang` 11.0 or later
If you do not enable one of these features, the API provided by `libclang` 3.5 will be available by
default.
diff --git a/TEST_MAPPING b/TEST_MAPPING
index 7bc6ed2..58584f2 100644
--- a/TEST_MAPPING
+++ b/TEST_MAPPING
@@ -1,9 +1,8 @@
-// Generated by cargo2android.py for tests in Android.bp
+// Generated by update_crate_tests.py for tests that depend on this crate.
{
"presubmit": [
{
- "host": true,
- "name": "libsqlite3-sys_host_test_src_lib"
+ "name": "keystore2_test"
},
{
"name": "libsqlite3-sys_device_test_src_lib"
diff --git a/build/common.rs b/build/common.rs
index 434bd46..265a0cf 100644
--- a/build/common.rs
+++ b/build/common.rs
@@ -46,6 +46,9 @@
"C:\\LLVM\\lib",
"C:\\Program Files*\\LLVM\\lib",
"C:\\MSYS*\\MinGW*\\lib",
+ // LLVM + Clang can be installed as a component of Visual Studio.
+ // https://github.com/KyleMayes/clang-sys/issues/121
+ "C:\\Program Files*\\Microsoft Visual Studio\\*\\BuildTools\\VC\\Tools\\Llvm\\**\\bin",
];
thread_local! {
diff --git a/out/common.rs b/out/common.rs
index 434bd46..265a0cf 100644
--- a/out/common.rs
+++ b/out/common.rs
@@ -46,6 +46,9 @@
"C:\\LLVM\\lib",
"C:\\Program Files*\\LLVM\\lib",
"C:\\MSYS*\\MinGW*\\lib",
+ // LLVM + Clang can be installed as a component of Visual Studio.
+ // https://github.com/KyleMayes/clang-sys/issues/121
+ "C:\\Program Files*\\Microsoft Visual Studio\\*\\BuildTools\\VC\\Tools\\Llvm\\**\\bin",
];
thread_local! {
diff --git a/patches/libloading-0.7.diff b/patches/libloading-0.7.diff
new file mode 100644
index 0000000..49fdc4c
--- /dev/null
+++ b/patches/libloading-0.7.diff
@@ -0,0 +1,47 @@
+diff --git a/Cargo.toml b/Cargo.toml
+index 1da2ac4..4af7f4d 100644
+--- a/Cargo.toml
++++ b/Cargo.toml
+@@ -31,7 +31,7 @@ version = "0.2.39"
+ default-features = false
+
+ [dependencies.libloading]
+-version = "0.6"
++version = "0.7"
+ optional = true
+ [build-dependencies.glob]
+ version = "0.3"
+diff --git a/src/link.rs b/src/link.rs
+index 3230e4a..64a3528 100644
+--- a/src/link.rs
++++ b/src/link.rs
+@@ -195,17 +195,19 @@ macro_rules! link {
+ let (directory, filename) = build::dynamic::find(true)?;
+ let path = directory.join(filename);
+
+- let library = libloading::Library::new(&path).map_err(|e| {
+- format!(
+- "the `libclang` shared library at {} could not be opened: {}",
+- path.display(),
+- e,
+- )
+- });
++ unsafe {
++ let library = libloading::Library::new(&path).map_err(|e| {
++ format!(
++ "the `libclang` shared library at {} could not be opened: {}",
++ path.display(),
++ e,
++ )
++ });
+
+- let mut library = SharedLibrary::new(library?, path);
+- $(load::$name(&mut library);)+
+- Ok(library)
++ let mut library = SharedLibrary::new(library?, path);
++ $(load::$name(&mut library);)+
++ Ok(library)
++ }
+ }
+
+ /// Loads a `libclang` shared library for use in the current thread.
diff --git a/src/lib.rs b/src/lib.rs
index ea2ffc2..6497715 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -448,6 +448,10 @@
const CXCursor_OMPParallelMasterTaskLoopSimdDirective = 284,
/// Only produced by `libclang` 10.0 and later.
const CXCursor_OMPParallelMasterDirective = 285,
+ /// Only produced by `libclang` 11.0 and later.
+ const CXCursor_OMPDepobjDirective = 286,
+ /// Only produced by `libclang` 11.0 and later.
+ const CXCursor_OMPScanDirective = 287,
const CXCursor_TranslationUnit = 300,
const CXCursor_UnexposedAttr = 400,
const CXCursor_IBActionAttr = 401,
@@ -853,6 +857,8 @@
const CXType_UAccum = 37,
/// Only produced by `libclang` 7.0 and later.
const CXType_ULongAccum = 38,
+ /// Only produced by `libclang` 11.0 and later.
+ const CXType_BFloat16 = 39,
const CXType_Complex = 100,
const CXType_Pointer = 101,
const CXType_BlockPointer = 102,
@@ -989,6 +995,8 @@
const CXType_OCLIntelSubgroupAVCImeDualRefStreamin = 175,
/// Only produced by `libclang` 9.0 and later.
const CXType_ExtVector = 176,
+ /// Only produced by `libclang` 11.0 and later.
+ const CXType_Atomic = 177,
}
}
@@ -1894,14 +1902,17 @@
/// Only available on `libclang` 8.0 and later.
#[cfg(feature = "clang_8_0")]
pub fn clang_Type_getModifiedType(type_: CXType) -> CXType;
- pub fn clang_Type_getSizeOf(type_: CXType) -> c_longlong;
- pub fn clang_Type_getTemplateArgumentAsType(type_: CXType, index: c_uint) -> CXType;
- /// Only available on `libclang` 5.0 and later.
- #[cfg(feature = "clang_5_0")]
- pub fn clang_Type_isTransparentTagTypedef(type_: CXType) -> c_uint;
/// Only available on `libclang` 8.0 and later.
#[cfg(feature = "clang_8_0")]
pub fn clang_Type_getNullability(type_: CXType) -> CXTypeNullabilityKind;
+ pub fn clang_Type_getSizeOf(type_: CXType) -> c_longlong;
+ pub fn clang_Type_getTemplateArgumentAsType(type_: CXType, index: c_uint) -> CXType;
+ /// Only available on `libclang` 11.0 and later.
+ #[cfg(feature = "clang_11_0")]
+ pub fn clang_Type_getValueType(type_: CXType) -> CXType;
+ /// Only available on `libclang` 5.0 and later.
+ #[cfg(feature = "clang_5_0")]
+ pub fn clang_Type_isTransparentTagTypedef(type_: CXType) -> c_uint;
/// Only available on `libclang` 3.7 and later.
#[cfg(feature = "clang_3_7")]
pub fn clang_Type_visitFields(type_: CXType, visitor: CXFieldVisitor, data: CXClientData) -> CXVisitorResult;
diff --git a/src/link.rs b/src/link.rs
index 3230e4a..64a3528 100644
--- a/src/link.rs
+++ b/src/link.rs
@@ -195,17 +195,19 @@
let (directory, filename) = build::dynamic::find(true)?;
let path = directory.join(filename);
- let library = libloading::Library::new(&path).map_err(|e| {
- format!(
- "the `libclang` shared library at {} could not be opened: {}",
- path.display(),
- e,
- )
- });
+ unsafe {
+ let library = libloading::Library::new(&path).map_err(|e| {
+ format!(
+ "the `libclang` shared library at {} could not be opened: {}",
+ path.display(),
+ e,
+ )
+ });
- let mut library = SharedLibrary::new(library?, path);
- $(load::$name(&mut library);)+
- Ok(library)
+ let mut library = SharedLibrary::new(library?, path);
+ $(load::$name(&mut library);)+
+ Ok(library)
+ }
}
/// Loads a `libclang` shared library for use in the current thread.