From dc5ba1bf148a1a86cc6527c7eb7cd9d2cb3090d5 Mon Sep 17 00:00:00 2001 From: Stephen Seo Date: Mon, 22 Apr 2019 18:27:34 +0900 Subject: [PATCH] Fix c_impl not installing to lib/ for Debug --- c_impl/CMakeLists.txt | 2 +- rust_binding/build.rs | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/c_impl/CMakeLists.txt b/c_impl/CMakeLists.txt index b4edbb5..4f5b6e8 100644 --- a/c_impl/CMakeLists.txt +++ b/c_impl/CMakeLists.txt @@ -40,7 +40,7 @@ if(CMAKE_BUILD_TYPE MATCHES "Debug") target_include_directories(NetworkTest PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src) endif() -install(TARGETS UDPConnection CONFIGURATIONS Release DESTINATION lib) +install(TARGETS UDPConnection DESTINATION lib) install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/UDPConnection.h ${CMAKE_CURRENT_SOURCE_DIR}/src/UDPC_Defines.h diff --git a/rust_binding/build.rs b/rust_binding/build.rs index 8388d16..197c169 100644 --- a/rust_binding/build.rs +++ b/rust_binding/build.rs @@ -6,16 +6,13 @@ use std::path::PathBuf; fn main() { let mut config = Config::new("../c_impl"); - let mut dst: PathBuf; if env::var("PROFILE").unwrap().eq("release") { config.define("CMAKE_BUILD_TYPE", "Release"); - dst = config.build(); - dst.push("lib"); } else { config.define("CMAKE_BUILD_TYPE", "Debug"); - dst = config.build(); - dst.push("build"); } + let mut dst = config.build(); + dst.push("lib"); println!("cargo:rustc-link-search=native={}", dst.display()); println!("cargo:rustc-link-lib=static=UDPConnection");