Skip to content

Commit

Permalink
Merge pull request #218 from Chia-Network/EL.output-generator
Browse files Browse the repository at this point in the history
Use generator for output directory
  • Loading branch information
emlowe authored Oct 31, 2024
2 parents 5b042d5 + 5e17829 commit f96f083
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 28 deletions.
34 changes: 9 additions & 25 deletions rust_bindings/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,23 +28,16 @@ fn main() {

println!("cargo:rustc-link-lib=static=chiavdfc");

if cfg!(target_os = "windows") {
let build_type = if cfg!(debug_assertions) {
"Debug"
} else {
"Release"
};

println!(
"cargo:rustc-link-search=native={}",
dst.join("build")
.join("lib")
.join("static")
.join(build_type)
.to_str()
.unwrap()
);
println!(
"cargo:rustc-link-search=native={}",
dst.join("build")
.join("lib")
.join("static")
.to_str()
.unwrap()
);

if cfg!(target_os = "windows") {
println!("cargo:rustc-link-lib=static=mpir");
println!(
"cargo:rustc-link-search=native={}",
Expand All @@ -56,15 +49,6 @@ fn main() {
.unwrap()
);
} else {
println!(
"cargo:rustc-link-search=native={}",
dst.join("build")
.join("lib")
.join("static")
.to_str()
.unwrap()
);

println!("cargo:rustc-link-lib=gmp");
}

Expand Down
6 changes: 3 additions & 3 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,12 @@ if(BUILD_CHIAVDFC)

set_target_properties(chiavdfc_shared PROPERTIES
OUTPUT_NAME chiavdfc
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib/shared"
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib/shared"
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib/shared$<0:>"
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib/shared$<0:>"
)

set_target_properties(chiavdfc_static PROPERTIES
OUTPUT_NAME chiavdfc
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib/static"
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib/static$<0:>"
)
endif()

0 comments on commit f96f083

Please sign in to comment.