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

Use generator for output directory #218

Merged
merged 3 commits into from
Oct 31, 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
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()
Loading