Skip to content

Commit

Permalink
Polish.
Browse files Browse the repository at this point in the history
  • Loading branch information
SirVer committed Sep 15, 2023
1 parent 6d3dd69 commit d0734cf
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 102 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
*build
*build-cross
target
watcher.lua
workspace.yaml
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ option(FRAMEWORK_INSTALL "Install the library (shared data might be installed an
option(CMAKE_RUN_CLANG_TIDY "Run clang-tidy" OFF)
option(EVEREST_ENABLE_JS_SUPPORT "Enable everestjs for JavaScript modules" ON)
option(EVEREST_ENABLE_PY_SUPPORT "Enable everestpy for Python modules" ON)
option(EVEREST_ENABLE_RS_SUPPORT "Enable everestrs for Rust modules" ON)
option(EVEREST_ENABLE_RS_SUPPORT "Enable everestrs for Rust modules" OFF)

# make own cmake modules available
list(INSERT CMAKE_MODULE_PATH 0 "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
Expand Down
98 changes: 0 additions & 98 deletions everestrs/everestrs/Cargo.lock

This file was deleted.

11 changes: 8 additions & 3 deletions everestrs/everestrs/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,19 @@ fn find_everest_workspace_root() -> PathBuf {
let mut cur_dir =
PathBuf::from(env::var("CARGO_MANIFEST_DIR").expect("always set in build.rs execution"));

// A poor heuristic: We traverse the directories upwards until we find a directory called
// everest-framework and hope that this is the EVerest workspace.
while cur_dir.parent().is_some() {
cur_dir = cur_dir.parent().unwrap().to_path_buf();
// TODO(hrapp): This currently only handles the case that everest-framework is build stand
// alone - which is probably mostly unconvential. In an everest-core build, we should try
// to find the necessary libraries in dist or maybe in _deps/everest-framework-build/lib/.
if cur_dir.join("everest-framework").is_dir() {
return cur_dir;
}
}
panic!("everstrs is not build within an EVerest workspace.");
}

/// Returns the Libraries path if this is a standalone build of everest-framework or None if it is
/// not.
fn find_libs_in_qwello_framework(root: &Path) -> Option<Libraries> {
let everestrs_sys = root.join("everest-framework/build/everestrs/libeverestrs_sys.a");
let framework = root.join("everest-framework/build/lib/libframework.so");
Expand All @@ -35,6 +36,8 @@ fn find_libs_in_qwello_framework(root: &Path) -> Option<Libraries> {
}
}

/// Returns the Libraries path if this is an EVerest workspace where make install was run in
/// everest-core/build or None if not.
fn find_libs_in_qwello_core_build_dist(root: &Path) -> Option<Libraries> {
let everestrs_sys = root.join("everest-core/build/dist/lib/libeverestrs_sys.a");
let framework = root.join("everest-core/build/dist/lib/libframework.so");
Expand All @@ -48,6 +51,8 @@ fn find_libs_in_qwello_core_build_dist(root: &Path) -> Option<Libraries> {
}
}

/// Takes a path to a library like `libframework.so` and returns the name for the linker, aka
/// `framework`
fn libname_from_path(p: &Path) -> String {
let mut name = p
.file_stem()
Expand Down

0 comments on commit d0734cf

Please sign in to comment.