Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

protobuf-src: don't let CMake install to lib64 #15

Merged
merged 2 commits into from
May 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions protobuf-native/src/compiler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,11 @@ pub(crate) mod ffi {
type DiskSourceTree;
fn NewDiskSourceTree() -> *mut DiskSourceTree;
unsafe fn DeleteDiskSourceTree(tree: *mut DiskSourceTree);
fn MapPath(self: Pin<&mut DiskSourceTree>, virtual_path: string_view, disk_path: string_view);
fn MapPath(
self: Pin<&mut DiskSourceTree>,
virtual_path: string_view,
disk_path: string_view,
);
}
}

Expand Down Expand Up @@ -444,7 +448,8 @@ impl DiskSourceTree {
pub fn map_path(self: Pin<&mut Self>, virtual_path: &Path, disk_path: &Path) {
let virtual_path = ProtobufPath::from(virtual_path);
let disk_path = ProtobufPath::from(disk_path);
self.as_ffi_mut().MapPath(virtual_path.into(), disk_path.into())
self.as_ffi_mut()
.MapPath(virtual_path.into(), disk_path.into())
}

unsafe_ffi_conversions!(ffi::DiskSourceTree);
Expand Down
2 changes: 1 addition & 1 deletion protobuf-native/src/internal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ pub struct StringView {

impl<S> From<S> for StringView
where
S: AsRef<[u8]>
S: AsRef<[u8]>,
{
fn from(s: S) -> StringView {
StringView {
Expand Down
5 changes: 5 additions & 0 deletions protobuf-src/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ fn main() -> Result<(), Box<dyn Error>> {
.define("protobuf_BUILD_TESTS", "OFF")
.define("protobuf_DEBUG_POSTFIX", "")
.define("CMAKE_CXX_STANDARD", "14")
// CMAKE_INSTALL_LIBDIR is inferred as "lib64" on some platforms, but we
// want a stable location that we can add to the linker search path.
// Since we're not actually installing to /usr or /usr/local, there's no
// harm to always using "lib" here.
.define("CMAKE_INSTALL_LIBDIR", "lib")
.build();

println!("cargo:rustc-env=INSTALL_DIR={}", install_dir.display());
Expand Down
Loading