From bf97d7e4154030286c4e46f5bdf1dcc714cd9105 Mon Sep 17 00:00:00 2001 From: Alberto Miranda <alberto.miranda@bsc.es> Date: Tue, 14 Feb 2023 13:03:01 +0100 Subject: [PATCH] Rename API library to libscord.so --- examples/c/CMakeLists.txt | 2 +- examples/cxx/CMakeLists.txt | 2 +- src/lib/CMakeLists.txt | 14 ++++++++------ src/lib/admire.cpp | 4 ++-- tests/CMakeLists.txt | 2 +- 5 files changed, 13 insertions(+), 11 deletions(-) diff --git a/examples/c/CMakeLists.txt b/examples/c/CMakeLists.txt index 4db1d89d..d9c9d948 100644 --- a/examples/c/CMakeLists.txt +++ b/examples/c/CMakeLists.txt @@ -52,7 +52,7 @@ target_link_libraries(c_examples_common common::api::types) foreach(example IN LISTS examples_c) add_executable(${example}_c) target_sources(${example}_c PRIVATE ${example}.c) - target_link_libraries(${example}_c PUBLIC adm_iosched c_examples_common) + target_link_libraries(${example}_c PUBLIC libscord c_examples_common) set_target_properties(${example}_c PROPERTIES OUTPUT_NAME ${example}) endforeach() diff --git a/examples/cxx/CMakeLists.txt b/examples/cxx/CMakeLists.txt index 24d14c57..a06c06b3 100644 --- a/examples/cxx/CMakeLists.txt +++ b/examples/cxx/CMakeLists.txt @@ -53,7 +53,7 @@ foreach(example IN LISTS examples_cxx) add_executable(${example}_cxx) target_sources(${example}_cxx PRIVATE ${example}.cpp) target_link_libraries(${example}_cxx - PUBLIC fmt::fmt adm_iosched cxx_examples_common) + PUBLIC fmt::fmt libscord cxx_examples_common) set_target_properties(${example}_cxx PROPERTIES OUTPUT_NAME ${example}) endforeach() diff --git a/src/lib/CMakeLists.txt b/src/lib/CMakeLists.txt index e3817f51..ba5a496d 100644 --- a/src/lib/CMakeLists.txt +++ b/src/lib/CMakeLists.txt @@ -22,23 +22,25 @@ # SPDX-License-Identifier: GPL-3.0-or-later # ################################################################################ -add_library(adm_iosched SHARED) +add_library(libscord SHARED) -target_sources(adm_iosched +target_sources(libscord PUBLIC admire.h admire.hpp PRIVATE admire.cpp c_wrapper.cpp detail/impl.hpp detail/impl.cpp env.hpp) -set_target_properties(adm_iosched PROPERTIES PUBLIC_HEADER "admire.h;admire.hpp") +set_target_properties(libscord PROPERTIES PUBLIC_HEADER "admire.h;admire.hpp") -target_include_directories(adm_iosched PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) +target_include_directories(libscord PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) -target_link_libraries(adm_iosched PRIVATE +target_link_libraries(libscord PRIVATE common::network::rpc_client common::network::rpc_types PUBLIC tl::expected common::api::types) +set_target_properties(libscord PROPERTIES OUTPUT_NAME "scord") + install( - TARGETS adm_iosched + TARGETS libscord LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} diff --git a/src/lib/admire.cpp b/src/lib/admire.cpp index e94384b9..63a70415 100644 --- a/src/lib/admire.cpp +++ b/src/lib/admire.cpp @@ -54,10 +54,10 @@ init_logger() { if(const auto p = std::getenv(admire::env::LOG); p && !std::string{p}.empty() && std::string{p} != "0") { if(const auto log_file = std::getenv(admire::env::LOG_OUTPUT)) { - scord::logger::create_global_logger("libadm_iosched", "file", + scord::logger::create_global_logger("libscord", "file", log_file); } else { - scord::logger::create_global_logger("libadm_iosched", + scord::logger::create_global_logger("libscord", "console color"); } } diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 679503c6..62f61732 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -25,7 +25,7 @@ add_executable(tests) target_sources(tests PRIVATE test.cpp) -target_link_libraries(tests PRIVATE Catch2::Catch2WithMain adm_iosched) +target_link_libraries(tests PRIVATE Catch2::Catch2WithMain libscord) include(Catch) catch_discover_tests(tests) -- GitLab