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

refactor(client_core): ♻️ Port FFE to Rust and remove all C++ code #2523

Merged
merged 1 commit into from
Nov 21, 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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 0 additions & 3 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
* text=auto eol=lf

alvr/client_core/cpp/VrApi_* linguist-vendored
alvr/client_core/cpp/glm/** linguist-vendored
alvr/client_core/cpp/tinygltf/** linguist-vendored
alvr/server_openvr/cpp/alvr_server/include/** linguist-vendored
alvr/server_openvr/cpp/alvr_server/nvEncodeAPI.h linguist-vendored
alvr/server_openvr/cpp/platform/win32/NvCodecUtils.h linguist-vendored
Expand Down
48 changes: 1 addition & 47 deletions alvr/client_core/build.rs
Original file line number Diff line number Diff line change
@@ -1,59 +1,13 @@
use std::{env, path::PathBuf};

fn main() {
let platform_name = env::var("CARGO_CFG_TARGET_OS").unwrap();
let platform_name = std::env::var("CARGO_CFG_TARGET_OS").unwrap();

if platform_name == "android" {
let out_dir = PathBuf::from(env::var("OUT_DIR").unwrap());

let cpp_paths = walkdir::WalkDir::new("cpp")
.into_iter()
.filter_map(|maybe_entry| maybe_entry.ok())
.map(|entry| entry.into_path())
.collect::<Vec<_>>();

if cfg!(feature = "use-cpp") {
let source_files_paths = cpp_paths
.iter()
.filter(|&path| {
path.extension()
.filter(|ext| ext.to_string_lossy() == "cpp")
.is_some()
})
.cloned()
.collect::<Vec<_>>();

cc::Build::new()
.cpp(true)
.files(source_files_paths)
.include("cpp")
.include("cpp/gl_render_utils")
.flag("-std=c++17")
.flag("-fexceptions")
.flag("-frtti")
.cpp_link_stdlib("c++_static")
.compile("bindings");

bindgen::builder()
.clang_arg("-xc++")
.header("cpp/bindings.h")
.derive_default(true)
.generate()
.unwrap()
.write_to_file(out_dir.join("bindings.rs"))
.unwrap();
}

println!("cargo:rustc-link-lib=log");
println!("cargo:rustc-link-lib=EGL");
println!("cargo:rustc-link-lib=GLESv3");
println!("cargo:rustc-link-lib=android");

#[cfg(feature = "link-stdcpp-shared")]
println!("cargo:rustc-link-lib=c++_shared");

The-personified-devil marked this conversation as resolved.
Show resolved Hide resolved
for path in cpp_paths {
println!("cargo:rerun-if-changed={}", path.to_string_lossy());
}
}
}
123 changes: 0 additions & 123 deletions alvr/client_core/cpp/VrApi_Config.h

This file was deleted.

Loading
Loading