Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
jacquetc committed Aug 1, 2023
1 parent cafdd3c commit 577df64
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ rustup/*
compile_commands.json

# cmps (https://github.com/leonmatthes/cmps)
.cmps/
.cmps/
13 changes: 3 additions & 10 deletions crates/qt-build-utils/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,6 @@ impl QtBuild {
.output()
{
Err(e) if e.kind() == std::io::ErrorKind::NotFound => Err(QtBuildError::QtMissing),

Err(e) => Err(QtBuildError::QmakeFailed(e)),
Ok(output) => {
if output.status.success() {
Expand Down Expand Up @@ -236,7 +235,7 @@ impl QtBuild {

fn determine_if_has_framework_libs(qmake_executable: &String) -> bool {
let lib_path = QtBuild::static_qmake_query(qmake_executable, "QT_INSTALL_LIBS");
let target: Result<String, env::VarError> = env::var("TARGET");
let target = env::var("TARGET");

match &target {
Ok(target) => {
Expand Down Expand Up @@ -381,7 +380,7 @@ impl QtBuild {
qt_module: &str,
) -> String {
for arch in ["", "_arm64-v8a", "_armeabi-v7a", "_x86", "_x86_64"] {
let prl_path: String = format!(
let prl_path = format!(
"{}/{}Qt{}{}{}.prl",
lib_path, prefix, version_major, qt_module, arch
);
Expand All @@ -400,7 +399,7 @@ impl QtBuild {
}
}

let prl_file: String = format!(
let prl_file = format!(
"{}/{}Qt{}{}.prl",
lib_path, prefix, version_major, qt_module
);
Expand All @@ -414,7 +413,6 @@ impl QtBuild {
let lib_path = self.qmake_query("QT_INSTALL_LIBS");
println!("cargo:rustc-link-search={lib_path}");

let target: Result<String, env::VarError> = env::var("TARGET");
let prefix = match &target {
Ok(target) => {
if target.contains("windows") {
Expand Down Expand Up @@ -450,11 +448,6 @@ impl QtBuild {
)
};

println!(
"cargo:rustc-link-search=using {} from {}",
link_lib, prl_path
);

self.cargo_link_qt_library(
&format!("Qt{}{qt_module}", self.version.major),
&prefix_path,
Expand Down
1 change: 0 additions & 1 deletion crates/qt-build-utils/src/parse_cflags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,6 @@ pub(crate) fn parse_libs_cflags(name: &str, link_args: &[u8], _builder: &mut cc:
} else {
match extract_lib_from_filename(target, &file_name) {
Some(lib_basename) => {
println!("cargo:rustc-link-search=lib_from_filename :",);
println!("cargo:rustc-link-search={}", dir.display());
println!("cargo:rustc-link-lib={lib_basename}");
}
Expand Down

0 comments on commit 577df64

Please sign in to comment.