diff --git a/CMakeLists.txt b/CMakeLists.txt index 1a87d6a43..a40c39193 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -156,8 +156,8 @@ option(BUILD_STATIC_CHIAPOS_LIBRARY "Build chiapos static library (verify-only)" IF (BUILD_STATIC_CHIAPOS_LIBRARY) message("Build chiapos static library (verify-only)") add_library(chiapos_static STATIC src/chacha8.c c-bindings/wrapper.cpp) - target_link_libraries(chiapos_static PRIVATE blake3) - target_include_directories(chiapos_static PUBLIC lib/include) + target_link_libraries(chiapos_static PRIVATE blake3 $<$:uint128>) + target_include_directories(chiapos_static PUBLIC lib/include uint128_t) set_target_properties(chiapos_static PROPERTIES ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib$<0:>") ENDIF() @@ -189,7 +189,8 @@ endif() find_package(Threads REQUIRED) add_library(uint128 STATIC uint128_t/uint128_t.cpp) -target_include_directories(uint128 PUBLIC uint128_t) +target_include_directories(uint128 PUBLIC uint128_t +set_target_properties(uint128 PROPERTIES ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib$<0:>")) target_compile_features(fse PUBLIC cxx_std_17) target_compile_features(chiapos PUBLIC cxx_std_17) @@ -213,12 +214,6 @@ target_link_libraries(RunTests PRIVATE fse Threads::Threads Catch2::Catch2WithMa $<$>:stdc++fs> ) -IF (BUILD_STATIC_CHIAPOS_LIBRARY) - target_link_libraries(chiapos_static PRIVATE # fse Threads::Threads - $<$:uint128> - # $<$>:stdc++fs> - ) -ENDIF() if (${CP_LINK_BLADEBIT_HARVESTER}) diff --git a/rust-bindings/build.rs b/rust-bindings/build.rs index 2e0e664ef..019ee7680 100644 --- a/rust-bindings/build.rs +++ b/rust-bindings/build.rs @@ -33,6 +33,10 @@ fn main() { println!("cargo:rustc-link-lib=static=chiapos_static"); println!("cargo:rustc-link-lib=static=blake3"); + if cfg!(target_os = "windows") { + println!("cargo:rustc-link-lib=static=uint128"); + } + let bindings = bindgen::Builder::default() .header( cpp_dir