From bdbd760c674eaee64649eaa82b9971903a38cde0 Mon Sep 17 00:00:00 2001 From: Yao Yue Date: Thu, 13 Dec 2018 15:24:54 -0800 Subject: [PATCH] Squashed 'deps/ccommon/' changes from 2ef0163..2168fec 2168fec minimize osx build config (#185) 42b24de Simplify rust options, specify fewer output targets (#183) c9fa905 update CMakeRust used to latest version, tweaks to make build work (#184) git-subtree-dir: deps/ccommon git-subtree-split: 2168feca7bd2cf9715fe2c95f5f6e6e6495f3795 --- .travis.yml | 103 +++---------------------- LICENSE | 2 +- NOTICE | 2 + ci/before-install.sh | 15 ---- ci/run.sh | 2 +- cmake/CMakeCargo.cmake | 93 ++++++++-------------- cmake/CMakeDetermineRustCompiler.cmake | 4 +- cmake/CargoLink.cmake | 64 +++++++++++++++ cmake/FindRust.cmake | 30 ++++--- rust/Cargo.toml | 4 +- rust/cc_binding/Cargo.toml | 1 - rust/ccommon_rs/CMakeLists.txt | 3 +- rust/ccommon_rs/Cargo.toml | 2 +- test/log/CMakeLists.txt | 2 +- 14 files changed, 130 insertions(+), 197 deletions(-) create mode 100644 cmake/CargoLink.cmake diff --git a/.travis.yml b/.travis.yml index 41c2b344e..26a944005 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,14 +1,12 @@ sudo: false language: c +dist: xenial # using anchor to import sources into linux builds addons: apt: &apt sources: - ubuntu-toolchain-r-test - - llvm-toolchain-precise-3.6 - - llvm-toolchain-precise-3.7 - - llvm-toolchain-precise # important for allowed-to-fail matching # see https://docs.travis-ci.com/user/customizing-the-build#Rows-that-are-Allowed-to-Fail @@ -18,115 +16,34 @@ env: # travis currently does not support directly setting gcc/clang with versions # (e.g. gcc-4.8) as value for the compiler key. So we will have to manually # request these packages and use environment varibles to create the matrix. -# -# In the case of osx, use brew to install the paritcular versions, instead of -# specifying with packages. matrix: include: - # gcc 4.8 on linux - - env: - - C_COMPILER=gcc-4.8 + - name: "gcc-5 on Linux" + compiler: gcc addons: apt: <<: *apt packages: - - gcc-4.8 - libsubunit-dev - - # gcc 4.9 on linux - - env: - - C_COMPILER=gcc-4.9 - addons: - apt: - <<: *apt - packages: - - gcc-4.9 - - libsubunit-dev - - # gcc 5 on linux - - env: - - C_COMPILER=gcc-5 - addons: - apt: - <<: *apt - packages: - - gcc-5 - - libsubunit-dev - - # gcc 5 on linux - - env: - - C_COMPILER=gcc-5 + - name: "gcc-5 on Linux, Rust enabled" + compiler: gcc + env: - RUST_ENABLED=1 addons: apt: <<: *apt packages: - - gcc-5 - libsubunit-dev - # clang 3.6 on linux - - env: - - C_COMPILER=clang-3.6 - addons: - apt: - <<: *apt - packages: - - clang-3.6 - - libsubunit-dev - - # clang 3.7 on linux - - env: - - C_COMPILER=clang-3.7 - addons: - apt: - <<: *apt - packages: - - clang-3.7 - - libsubunit-dev - - ## gcc 4.8 on osx - #- os: osx - # env: FORMULA=gcc48 COMPILER=gcc C_COMPILER=gcc-4.8 - # - ## gcc 4.9 on osx - #- os: osx - # env: FORMULA=gcc49 COMPILER=gcc C_COMPILER=gcc-4.9 - # - ## gcc 5 on osx - #- os: osx - # env: FORMULA=gcc5 COMPILER=gcc C_COMPILER=gcc-5 - - # OSX 10.13 - # Apple LLVM version 9.1.0 (clang-902.0.39.2) - # Target: x86_64-apple-darwin17.6.0 - os: osx - osx_image: xcode9.4 - env: - - C_COMPILER=clang - - ALLOWED_TO_FAIL=1 - - # OSX 10.12 - # Apple LLVM version 9.0.0 (clang-900.0.39.2) - # Target: x86_64-apple-darwin16.7.0 - - os: osx - osx_image: xcode9.2 - env: - - C_COMPILER=clang - - ALLOWED_TO_FAIL=1 + osx_image: xcode10.1 + compiler: clang allow_failures: - os: osx - osx_image: xcode9.4 - env: - - C_COMPILER=clang - - ALLOWED_TO_FAIL=1 - - - os: osx - osx_image: xcode9.2 - env: - - C_COMPILER=clang - - ALLOWED_TO_FAIL=1 + osx_image: xcode10.1 + compiler: clang before_install: - ./ci/before-install.sh diff --git a/LICENSE b/LICENSE index ecc06d346..5c3aef4f8 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright 2013-2015 Twitter, Inc +Copyright 2013-2018 Twitter, Inc Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/NOTICE b/NOTICE index 2b7bb058e..e0672064d 100644 --- a/NOTICE +++ b/NOTICE @@ -22,3 +22,5 @@ * Boston, MA 02111-1307, USA. */ +We use the CMakeRust project (https://github.com/Devolutions/CMakeRust) under +the Apache 2.0 License. diff --git a/ci/before-install.sh b/ci/before-install.sh index cff9327c3..b5f49421a 100755 --- a/ci/before-install.sh +++ b/ci/before-install.sh @@ -11,21 +11,6 @@ trap cleanup EXIT TOPLEVEL="$(git -C "$(cd "$(dirname "$0")" >/dev/null || exit 1; pwd)" rev-parse --show-toplevel)" || die 'failed to find TOPLEVEL' -# for osx: 0. update brew; 1. install cmake if missing; 2. (gcc) unlink pre-installed gcc; 3. (gcc) install desired version of gcc - -if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then - brew update &>/dev/null - brew install cmake || true # xcode 8.1 is missing cmake - - if [[ "$C_COMPILER" =~ ^gcc && -n "${FORMULA:-}" ]]; then - brew unlink gcc || true - brew unlink "$FORMULA" || true - brew install "$FORMULA" - fi -fi - -export CC="$C_COMPILER" - if [[ -n "${RUST_ENABLED:-}" ]]; then curl https://sh.rustup.rs -sSf | sh -s -- -y fi diff --git a/ci/run.sh b/ci/run.sh index 588bbc0b2..3bd26d1aa 100755 --- a/ci/run.sh +++ b/ci/run.sh @@ -18,7 +18,7 @@ fi export RUST_BACKTRACE=full -mkdir -p _build && ( cd _build && "${cmake_cmd[@]}" .. && make -j && make check ) +mkdir -p _build && ( cd _build && "${cmake_cmd[@]}" .. && make && make check ) RESULT=$? egrep -r ":F:|:E:" . |grep -v 'Binary file' || true diff --git a/cmake/CMakeCargo.cmake b/cmake/CMakeCargo.cmake index 81920f8e7..2b425ce55 100644 --- a/cmake/CMakeCargo.cmake +++ b/cmake/CMakeCargo.cmake @@ -1,46 +1,36 @@ -function(cargo_set_lib_target LIB_NAME) +function(cargo_build) + cmake_parse_arguments(CARGO "" "NAME" "" ${ARGN}) + string(REPLACE "-" "_" LIB_NAME ${CARGO_NAME}) + + set(CARGO_TARGET_DIR ${CMAKE_CURRENT_BINARY_DIR}) + if(WIN32) if(CMAKE_SIZEOF_VOID_P EQUAL 8) - set(LIB_TARGET "x86_64-pc-windows-msvc" PARENT_SCOPE) + set(LIB_TARGET "x86_64-pc-windows-msvc") else() - set(LIB_TARGET "i686-pc-windows-msvc" PARENT_SCOPE) + set(LIB_TARGET "i686-pc-windows-msvc") endif() - elseif(ANDROID) + elseif(ANDROID) if(ANDROID_SYSROOT_ABI STREQUAL "x86") - set(LIB_TARGET "i686-linux-android" PARENT_SCOPE) + set(LIB_TARGET "i686-linux-android") elseif(ANDROID_SYSROOT_ABI STREQUAL "x86_64") - set(LIB_TARGET "x86_64-linux-android" PARENT_SCOPE) + set(LIB_TARGET "x86_64-linux-android") elseif(ANDROID_SYSROOT_ABI STREQUAL "arm") - set(LIB_TARGET "arm-linux-androideabi" PARENT_SCOPE) + set(LIB_TARGET "arm-linux-androideabi") elseif(ANDROID_SYSROOT_ABI STREQUAL "arm64") - set(LIB_TARGET "aarch64-linux-android" PARENT_SCOPE) + set(LIB_TARGET "aarch64-linux-android") endif() elseif(IOS) - set(LIB_TARGET "universal" PARENT_SCOPE) + set(LIB_TARGET "universal") elseif(CMAKE_SYSTEM_NAME STREQUAL Darwin) - set(LIB_TARGET "x86_64-apple-darwin" PARENT_SCOPE) - else() - if(RUST_USE_MUSL) - set(RUST_LIBC_NAME "musl") - else() - set(RUST_LIBC_NAME "gnu") - endif() - + set(LIB_TARGET "x86_64-apple-darwin") + else() if(CMAKE_SIZEOF_VOID_P EQUAL 8) - set(LIB_TARGET "x86_64-unknown-linux-${RUST_LIBC_NAME}" PARENT_SCOPE) + set(LIB_TARGET "x86_64-unknown-linux-gnu") else() - set(LIB_TARGET "i686-unknown-linux-${RUST_LIBC_NAME}" PARENT_SCOPE) + set(LIB_TARGET "i686-unknown-linux-gnu") endif() endif() -endfunction() - -function(cargo_build) - cmake_parse_arguments(CARGO "" "NAME" "" ${ARGN}) - string(REPLACE "-" "_" LIB_NAME ${CARGO_NAME}) - - get_filename_component(CARGO_TARGET_DIR "${CMAKE_CURRENT_BINARY_DIR}" ABSOLUTE) - - cargo_set_lib_target(LIB_NAME) if(NOT CMAKE_BUILD_TYPE) set(LIB_BUILD_TYPE "debug") @@ -50,24 +40,14 @@ function(cargo_build) set(LIB_BUILD_TYPE "debug") endif() - set(SHARED_LIB_FNAME "${CMAKE_SHARED_LIBRARY_PREFIX}${LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}") - set(STATIC_LIB_FNAME "${CMAKE_STATIC_LIBRARY_PREFIX}${LIB_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}") - - set(LIB_BASE_DIR "${CARGO_TARGET_DIR}/${LIB_TARGET}/${LIB_BUILD_TYPE}") + set(LIB_FILE "${CARGO_TARGET_DIR}/${LIB_TARGET}/${LIB_BUILD_TYPE}/${CMAKE_STATIC_LIBRARY_PREFIX}${LIB_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}") - get_filename_component(SHARED_LIB_FILE "${LIB_BASE_DIR}/${SHARED_LIB_FNAME}" ABSOLUTE) - get_filename_component(STATIC_LIB_FILE "${LIB_BASE_DIR}/${STATIC_LIB_FNAME}" ABSOLUTE) - - if(IOS) - set(CARGO_ARGS "lipo") - else() - set(CARGO_ARGS "build") - list(APPEND CARGO_ARGS "--target" ${LIB_TARGET}) - endif() - - if(RUST_VERBOSE_BUILD) - list(APPEND CARGO_ARGS "-vv") - endif() + if(IOS) + set(CARGO_ARGS "lipo") + else() + set(CARGO_ARGS "build") + list(APPEND CARGO_ARGS "--target" ${LIB_TARGET}) + endif() if(${LIB_BUILD_TYPE} STREQUAL "release") list(APPEND CARGO_ARGS "--release") @@ -78,24 +58,13 @@ function(cargo_build) set(CARGO_ENV_COMMAND ${CMAKE_COMMAND} -E env "CARGO_TARGET_DIR=${CARGO_TARGET_DIR}") add_custom_command( - OUTPUT ${STATIC_LIB_FILE} - COMMAND ${CARGO_ENV_COMMAND} ${CARGO_EXECUTABLE} ARGS ${CARGO_ARGS} - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - DEPENDS ${LIB_SOURCES} - COMMENT "running cargo") - add_custom_target(${CARGO_NAME}_static_target ALL DEPENDS ${STATIC_LIB_FILE}) - add_library(${CARGO_NAME}_static STATIC IMPORTED GLOBAL) - add_dependencies(${CARGO_NAME}_static ${CARGO_NAME}_static_target) - set_target_properties(${CARGO_NAME}_static PROPERTIES IMPORTED_LOCATION ${STATIC_LIB_FILE}) - - add_custom_command( - OUTPUT ${SHARED_LIB_FILE} + OUTPUT ${LIB_FILE} COMMAND ${CARGO_ENV_COMMAND} ${CARGO_EXECUTABLE} ARGS ${CARGO_ARGS} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} DEPENDS ${LIB_SOURCES} COMMENT "running cargo") - add_custom_target(${CARGO_NAME}_shared_target ALL DEPENDS ${SHARED_LIB_FILE}) - add_library(${CARGO_NAME}_shared SHARED IMPORTED GLOBAL) - add_dependencies(${CARGO_NAME}_shared ${CARGO_NAME}_shared_target) - set_target_properties(${CARGO_NAME}_shared PROPERTIES IMPORTED_LOCATION ${SHARED_LIB_FILE}) -endfunction() + add_custom_target(${CARGO_NAME}_target ALL DEPENDS ${LIB_FILE}) + add_library(${CARGO_NAME} STATIC IMPORTED GLOBAL) + add_dependencies(${CARGO_NAME} ${CARGO_NAME}_target) + set_target_properties(${CARGO_NAME} PROPERTIES IMPORTED_LOCATION ${LIB_FILE}) +endfunction() \ No newline at end of file diff --git a/cmake/CMakeDetermineRustCompiler.cmake b/cmake/CMakeDetermineRustCompiler.cmake index 33a459c0a..6d4815292 100644 --- a/cmake/CMakeDetermineRustCompiler.cmake +++ b/cmake/CMakeDetermineRustCompiler.cmake @@ -9,7 +9,7 @@ if(NOT CMAKE_Rust_COMPILER) endif() endif() -message(STATUS "Cargo Prefix: ${CARGO_PREFIX}") +message(STATUS "Cargo Home: ${CARGO_HOME}") message(STATUS "Rust Compiler Version: ${RUSTC_VERSION}") mark_as_advanced(CMAKE_Rust_COMPILER) @@ -18,7 +18,7 @@ if(CMAKE_Rust_COMPILER) set(CMAKE_Rust_COMPILER_LOADED 1) endif(CMAKE_Rust_COMPILER) -configure_file(${CMAKE_SOURCE_DIR}/cmake/CMakeRustCompiler.cmake.in +configure_file(${CMAKE_CURRENT_LIST_DIR}/CMakeRustCompiler.cmake.in ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${CMAKE_VERSION}/CMakeRustCompiler.cmake IMMEDIATE @ONLY) set(CMAKE_Rust_COMPILER_ENV_VAR "RUSTC") diff --git a/cmake/CargoLink.cmake b/cmake/CargoLink.cmake new file mode 100644 index 000000000..1db2241b1 --- /dev/null +++ b/cmake/CargoLink.cmake @@ -0,0 +1,64 @@ + +function(cargo_print) + execute_process(COMMAND ${CMAKE_COMMAND} -E echo "${ARGN}") +endfunction() + +function(cargo_link) + cmake_parse_arguments(CARGO_LINK "" "NAME" "TARGETS;EXCLUDE" ${ARGN}) + + file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/cargo-link.c" "void cargo_link() {}") + add_library(${CARGO_LINK_NAME} "${CMAKE_CURRENT_BINARY_DIR}/cargo-link.c") + target_link_libraries(${CARGO_LINK_NAME} ${CARGO_LINK_TARGETS}) + + get_target_property(LINK_LIBRARIES ${CARGO_LINK_NAME} LINK_LIBRARIES) + + foreach(LINK_LIBRARY ${LINK_LIBRARIES}) + get_target_property(_INTERFACE_LINK_LIBRARIES ${LINK_LIBRARY} INTERFACE_LINK_LIBRARIES) + list(APPEND LINK_LIBRARIES ${_INTERFACE_LINK_LIBRARIES}) + endforeach() + list(REMOVE_DUPLICATES LINK_LIBRARIES) + + if(CARGO_LINK_EXCLUDE) + list(REMOVE_ITEM LINK_LIBRARIES ${CARGO_LINK_EXCLUDE}) + endif() + + set(LINK_DIRECTORIES "") + foreach(LINK_LIBRARY ${LINK_LIBRARIES}) + if(TARGET ${LINK_LIBRARY}) + get_target_property(_IMPORTED_CONFIGURATIONS ${LINK_LIBRARY} IMPORTED_CONFIGURATIONS) + list(FIND _IMPORTED_CONFIGURATIONS "RELEASE" _IMPORTED_CONFIGURATION_INDEX) + if (NOT (${_IMPORTED_CONFIGURATION_INDEX} GREATER -1)) + set(_IMPORTED_CONFIGURATION_INDEX 0) + endif() + list(GET _IMPORTED_CONFIGURATIONS ${_IMPORTED_CONFIGURATION_INDEX} _IMPORTED_CONFIGURATION) + get_target_property(_IMPORTED_LOCATION ${LINK_LIBRARY} "IMPORTED_LOCATION_${_IMPORTED_CONFIGURATION}") + get_filename_component(_IMPORTED_DIR ${_IMPORTED_LOCATION} DIRECTORY) + get_filename_component(_IMPORTED_NAME ${_IMPORTED_LOCATION} NAME_WE) + if(NOT WIN32) + string(REGEX REPLACE "^lib" "" _IMPORTED_NAME ${_IMPORTED_NAME}) + endif() + list(APPEND LINK_DIRECTORIES ${_IMPORTED_DIR}) + cargo_print("cargo:rustc-link-lib=static=${_IMPORTED_NAME}") + else() + if("${LINK_LIBRARY}" MATCHES "^.*/(.+)\\.framework$") + set(FRAMEWORK_NAME ${CMAKE_MATCH_1}) + cargo_print("cargo:rustc-link-lib=framework=${FRAMEWORK_NAME}") + elseif("${LINK_LIBRARY}" MATCHES "^(.*)/(.+)\\.so$") + set(LIBRARY_DIR ${CMAKE_MATCH_1}) + set(LIBRARY_NAME ${CMAKE_MATCH_2}) + if(NOT WIN32) + string(REGEX REPLACE "^lib" "" LIBRARY_NAME ${LIBRARY_NAME}) + endif() + list(APPEND LINK_DIRECTORIES ${LIBRARY_DIR}) + cargo_print("cargo:rustc-link-lib=${LIBRARY_NAME}") + else() + cargo_print("cargo:rustc-link-lib=${LINK_LIBRARY}") + endif() + endif() + endforeach() + list(REMOVE_DUPLICATES LINK_DIRECTORIES) + + foreach(LINK_DIRECTORY ${LINK_DIRECTORIES}) + cargo_print("cargo:rustc-link-search=native=${LINK_DIRECTORY}") + endforeach() +endfunction() diff --git a/cmake/FindRust.cmake b/cmake/FindRust.cmake index 2dbf14ddf..53127a103 100644 --- a/cmake/FindRust.cmake +++ b/cmake/FindRust.cmake @@ -4,55 +4,53 @@ set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH) set(_CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ${CMAKE_FIND_ROOT_PATH_MODE_INCLUDE}) set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE BOTH) -if(WIN32) +if(CMAKE_HOST_WIN32) set(USER_HOME "$ENV{USERPROFILE}") else() set(USER_HOME "$ENV{HOME}") endif() -# Find cargo prefix -find_path(CARGO_PREFIX ".cargo" - PATHS "${USER_HOME}") - -if(CARGO_PREFIX MATCHES "NOTFOUND") - message(FATAL_ERROR "Could not find Rust!") -else() - set(CARGO_PREFIX "${CARGO_PREFIX}/.cargo") +if(NOT DEFINED CARGO_HOME) + if("$ENV{CARGO_HOME}" STREQUAL "") + set(CARGO_HOME "${USER_HOME}/.cargo") + else() + set(CARGO_HOME "$ENV{CARGO_HOME}") + endif() endif() # Find cargo executable find_program(CARGO_EXECUTABLE cargo - HINTS "${CARGO_PREFIX}" + HINTS "${CARGO_HOME}" PATH_SUFFIXES "bin") mark_as_advanced(CARGO_EXECUTABLE) # Find rustc executable find_program(RUSTC_EXECUTABLE rustc - HINTS "${CARGO_PREFIX}" + HINTS "${CARGO_HOME}" PATH_SUFFIXES "bin") mark_as_advanced(RUSTC_EXECUTABLE) # Find rustdoc executable find_program(RUSTDOC_EXECUTABLE rustdoc - HINTS "${CARGO_PREFIX}" + HINTS "${CARGO_HOME}" PATH_SUFFIXES "bin") mark_as_advanced(RUSTDOC_EXECUTABLE) # Find rust-gdb executable find_program(RUST_GDB_EXECUTABLE rust-gdb - HINTS "${CARGO_PREFIX}" + HINTS "${CARGO_HOME}" PATH_SUFFIXES "bin") mark_as_advanced(RUST_GDB_EXECUTABLE) # Find rust-lldb executable find_program(RUST_LLDB_EXECUTABLE rust-lldb - HINTS "${CARGO_PREFIX}" + HINTS "${CARGO_HOME}" PATH_SUFFIXES "bin") mark_as_advanced(RUST_LLDB_EXECUTABLE) # Find rustup executable find_program(RUSTUP_EXECUTABLE rustup - HINTS "${CARGO_PREFIX}" + HINTS "${CARGO_HOME}" PATH_SUFFIXES "bin") mark_as_advanced(RUSTUP_EXECUTABLE) @@ -61,7 +59,7 @@ set(RUST_FOUND FALSE CACHE INTERNAL "") if(CARGO_EXECUTABLE AND RUSTC_EXECUTABLE AND RUSTDOC_EXECUTABLE) set(RUST_FOUND TRUE CACHE INTERNAL "") - set(CARGO_PREFIX "${CARGO_PREFIX}" CACHE PATH "Rust Cargo prefix") + set(CARGO_HOME "${CARGO_HOME}" CACHE PATH "Rust Cargo Home") execute_process(COMMAND ${RUSTC_EXECUTABLE} --version OUTPUT_VARIABLE RUSTC_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE) string(REGEX REPLACE "rustc ([^ ]+) .*" "\\1" RUSTC_VERSION "${RUSTC_VERSION}") diff --git a/rust/Cargo.toml b/rust/Cargo.toml index ae5821dad..ccde17a74 100644 --- a/rust/Cargo.toml +++ b/rust/Cargo.toml @@ -8,8 +8,8 @@ members = [ [profile.release] opt-level = 3 debug = true -rpath = false -lto = true +# rpath = false +# lto = true debug-assertions = false codegen-units = 1 diff --git a/rust/cc_binding/Cargo.toml b/rust/cc_binding/Cargo.toml index 0ad06b1df..4182cbc6d 100644 --- a/rust/cc_binding/Cargo.toml +++ b/rust/cc_binding/Cargo.toml @@ -9,4 +9,3 @@ failure = "~0.1.1" [lib] name = "cc_binding" -crate-type = ["rlib", "dylib", "staticlib", "lib"] diff --git a/rust/ccommon_rs/CMakeLists.txt b/rust/ccommon_rs/CMakeLists.txt index f373e0938..8d0335b2e 100644 --- a/rust/ccommon_rs/CMakeLists.txt +++ b/rust/ccommon_rs/CMakeLists.txt @@ -1,4 +1,3 @@ file(WRITE CMAKE_BINARY_DIR "${CMAKE_BINARY_DIR}\n") cargo_build(NAME ccommon_rs) -add_dependencies(ccommon_rs_static ccommon-static) -add_dependencies(ccommon_rs_shared ccommon-shared) +add_dependencies(ccommon_rs ccommon-static) diff --git a/rust/ccommon_rs/Cargo.toml b/rust/ccommon_rs/Cargo.toml index 69de89ef3..2b25168a0 100644 --- a/rust/ccommon_rs/Cargo.toml +++ b/rust/ccommon_rs/Cargo.toml @@ -5,7 +5,7 @@ authors = ["Jonathan Simms "] [lib] name = "ccommon_rs" -crate-type = ["lib", "dylib", "rlib", "staticlib"] +crate-type = ["staticlib", "rlib"] [dependencies] diff --git a/test/log/CMakeLists.txt b/test/log/CMakeLists.txt index 67848eef4..262271197 100644 --- a/test/log/CMakeLists.txt +++ b/test/log/CMakeLists.txt @@ -4,7 +4,7 @@ set(test_name check_${suite}) set(source check_${suite}.c) if(HAVE_RUST) - set(CCOMMON_LIBS ccommon_rs_static) # common_rs_static staticly links common-static + set(CCOMMON_LIBS ccommon_rs) # common_rs_static staticly links common-static else() set(CCOMMON_LIBS ccommon-static) endif()