Browse Source

fix handling of built in version of spdlog and fmt

develop
Eyck Jentzsch 2 months ago
parent
commit
f0495ae868
79 changed files with 29 additions and 20 deletions
  1. 29
    18
      CMakeLists.txt
  2. 0
    2
      src/report.cpp
  3. 0
    0
      third_party/spdlog/async.h
  4. 0
    0
      third_party/spdlog/async_logger-inl.h
  5. 0
    0
      third_party/spdlog/async_logger.h
  6. 0
    0
      third_party/spdlog/common-inl.h
  7. 0
    0
      third_party/spdlog/common.h
  8. 0
    0
      third_party/spdlog/details/backtracer-inl.h
  9. 0
    0
      third_party/spdlog/details/backtracer.h
  10. 0
    0
      third_party/spdlog/details/circular_q.h
  11. 0
    0
      third_party/spdlog/details/console_globals.h
  12. 0
    0
      third_party/spdlog/details/file_helper-inl.h
  13. 0
    0
      third_party/spdlog/details/file_helper.h
  14. 0
    0
      third_party/spdlog/details/fmt_helper.h
  15. 0
    0
      third_party/spdlog/details/log_msg-inl.h
  16. 0
    0
      third_party/spdlog/details/log_msg.h
  17. 0
    0
      third_party/spdlog/details/log_msg_buffer-inl.h
  18. 0
    0
      third_party/spdlog/details/log_msg_buffer.h
  19. 0
    0
      third_party/spdlog/details/mpmc_blocking_q.h
  20. 0
    0
      third_party/spdlog/details/null_mutex.h
  21. 0
    0
      third_party/spdlog/details/os-inl.h
  22. 0
    0
      third_party/spdlog/details/os.h
  23. 0
    0
      third_party/spdlog/details/pattern_formatter-inl.h
  24. 0
    0
      third_party/spdlog/details/pattern_formatter.h
  25. 0
    0
      third_party/spdlog/details/periodic_worker-inl.h
  26. 0
    0
      third_party/spdlog/details/periodic_worker.h
  27. 0
    0
      third_party/spdlog/details/registry-inl.h
  28. 0
    0
      third_party/spdlog/details/registry.h
  29. 0
    0
      third_party/spdlog/details/synchronous_factory.h
  30. 0
    0
      third_party/spdlog/details/thread_pool-inl.h
  31. 0
    0
      third_party/spdlog/details/thread_pool.h
  32. 0
    0
      third_party/spdlog/fmt/bin_to_hex.h
  33. 0
    0
      third_party/spdlog/fmt/bundled/LICENSE.rst
  34. 0
    0
      third_party/spdlog/fmt/bundled/chrono.h
  35. 0
    0
      third_party/spdlog/fmt/bundled/color.h
  36. 0
    0
      third_party/spdlog/fmt/bundled/compile.h
  37. 0
    0
      third_party/spdlog/fmt/bundled/core.h
  38. 0
    0
      third_party/spdlog/fmt/bundled/format-inl.h
  39. 0
    0
      third_party/spdlog/fmt/bundled/format.h
  40. 0
    0
      third_party/spdlog/fmt/bundled/locale.h
  41. 0
    0
      third_party/spdlog/fmt/bundled/ostream.h
  42. 0
    0
      third_party/spdlog/fmt/bundled/posix.h
  43. 0
    0
      third_party/spdlog/fmt/bundled/printf.h
  44. 0
    0
      third_party/spdlog/fmt/bundled/ranges.h
  45. 0
    0
      third_party/spdlog/fmt/bundled/safe-duration-cast.h
  46. 0
    0
      third_party/spdlog/fmt/fmt.h
  47. 0
    0
      third_party/spdlog/fmt/ostr.h
  48. 0
    0
      third_party/spdlog/formatter.h
  49. 0
    0
      third_party/spdlog/logger-inl.h
  50. 0
    0
      third_party/spdlog/logger.h
  51. 0
    0
      third_party/spdlog/sinks/android_sink.h
  52. 0
    0
      third_party/spdlog/sinks/ansicolor_sink-inl.h
  53. 0
    0
      third_party/spdlog/sinks/ansicolor_sink.h
  54. 0
    0
      third_party/spdlog/sinks/base_sink-inl.h
  55. 0
    0
      third_party/spdlog/sinks/base_sink.h
  56. 0
    0
      third_party/spdlog/sinks/basic_file_sink-inl.h
  57. 0
    0
      third_party/spdlog/sinks/basic_file_sink.h
  58. 0
    0
      third_party/spdlog/sinks/daily_file_sink.h
  59. 0
    0
      third_party/spdlog/sinks/dist_sink.h
  60. 0
    0
      third_party/spdlog/sinks/dup_filter_sink.h
  61. 0
    0
      third_party/spdlog/sinks/msvc_sink.h
  62. 0
    0
      third_party/spdlog/sinks/null_sink.h
  63. 0
    0
      third_party/spdlog/sinks/ostream_sink.h
  64. 0
    0
      third_party/spdlog/sinks/rotating_file_sink-inl.h
  65. 0
    0
      third_party/spdlog/sinks/rotating_file_sink.h
  66. 0
    0
      third_party/spdlog/sinks/sink-inl.h
  67. 0
    0
      third_party/spdlog/sinks/sink.h
  68. 0
    0
      third_party/spdlog/sinks/stdout_color_sinks-inl.h
  69. 0
    0
      third_party/spdlog/sinks/stdout_color_sinks.h
  70. 0
    0
      third_party/spdlog/sinks/stdout_sinks-inl.h
  71. 0
    0
      third_party/spdlog/sinks/stdout_sinks.h
  72. 0
    0
      third_party/spdlog/sinks/syslog_sink.h
  73. 0
    0
      third_party/spdlog/sinks/systemd_sink.h
  74. 0
    0
      third_party/spdlog/sinks/wincolor_sink-inl.h
  75. 0
    0
      third_party/spdlog/sinks/wincolor_sink.h
  76. 0
    0
      third_party/spdlog/spdlog-inl.h
  77. 0
    0
      third_party/spdlog/spdlog.h
  78. 0
    0
      third_party/spdlog/tweakme.h
  79. 0
    0
      third_party/spdlog/version.h

+ 29
- 18
CMakeLists.txt View File

@@ -70,14 +70,30 @@ if(CCI_FOUND)
)
endif()

if(TARGET spdlog::spdlog)
set(SPDLOG_TARGET spdlog::spdlog)
elseif(TARGET CONAN_PKG::spdlog)
set(SPDLOG_TARGET CONAN_PKG::spdlog)
else()
add_library(spdlog_local INTERFACE)
target_compile_definitions(spdlog_local SPDLOG_HEADER_ONLY)
target_include_directories(fmt_local INTERFACE third_party)
set(SPDLOG_TARGET spdlog_local)
message("Using built-in version of spdlog")
endif()

if(TARGET fmt::fmt)
set(FMT_TARGET fmt::fmt)
elseif(TARGET CONAN_PKG::fmt)
set(FMT_TARGET CONAN_PKG::fmt)
else()
add_library(fmt_local INTERFACE)
target_include_directories(fmt_local INTERFACE third_party/spdlog)
set(FMT_TARGET fmt_local)
message("Using built-in version of fmt")
endif()

if(SCV_FOUND)
if(TARGET fmt::fmt)
set(FMT_TGT fmt::fmt)
elseif(TARGET CONAN_PKG::fmt)
set(FMT_TGT CONAN_PKG::fmt)
else()
set(FMT_TGT "")
endif()
if(ZLIB_FOUND)
set(LIB_SOURCES ${LIB_SOURCES} src/scv_tr_compressed.cpp)
endif(ZLIB_FOUND)
@@ -87,9 +103,7 @@ if(SCV_FOUND)
set(LIB_SOURCES ${LIB_SOURCES} src/scv_tr_ldb/scv_tr_ldb.cpp )
endif()
endif()
if(NOT FMT_TGT STREQUAL "")
set(LIB_SOURCES ${LIB_SOURCES} src/scv_tr_sqlite/scv_tr_sqlite.cpp src/scv_tr_sqlite/sqlite3.c )
endif()
set(LIB_SOURCES ${LIB_SOURCES} src/scv_tr_sqlite/scv_tr_sqlite.cpp src/scv_tr_sqlite/sqlite3.c )
endif(SCV_FOUND)

# Define two variables in order not to repeat ourselves.
@@ -110,12 +124,9 @@ set_target_properties(scc PROPERTIES
PUBLIC_HEADER "incl/scc.h" # specify the public headers
)

target_link_libraries(scc scc-util ${FMT_TGT} ${CMAKE_DL_LIBS})
if(${CMAKE_VERSION} VERSION_LESS "3.2.0")
target_link_libraries(scc ${CMAKE_THREAD_LIBS_INIT})
else()
target_link_libraries(scc Threads::Threads)
endif()
target_link_libraries(scc PUBLIC scc-util ${CMAKE_DL_LIBS})
target_link_libraries(scc PRIVATE ${FMT_TARGET} ${SPDLOG_TARGET})
target_link_libraries(scc PUBLIC Threads::Threads)

if(CCI_FOUND)
target_compile_definitions(scc PUBLIC -DWITH_CCI)
@@ -136,11 +147,11 @@ if(SCV_FOUND)
endif()

if(ZLIB_FOUND)
target_link_libraries (scc ${ZLIB_LIBRARIES})
target_link_libraries (scc PUBLIC ${ZLIB_LIBRARIES})
endif(ZLIB_FOUND)

target_include_directories (scc PUBLIC ${SystemC_INCLUDE_DIRS})
target_link_libraries(scc ${SystemC_LIBRARIES} )
target_link_libraries(scc PUBLIC ${SystemC_LIBRARIES} )
if(NOT ${CMAKE_VERSION} VERSION_LESS "3.13.0")
target_link_directories(scc PUBLIC ${SystemC_LIBRARY_DIRS})
endif()

+ 0
- 2
src/report.cpp View File

@@ -24,12 +24,10 @@
#include <chrono>
#include <fstream>
#include <scc/report.h>
#define SPDLOG_HEADER_ONLY
#include "spdlog/spdlog.h"
#include "spdlog/async.h"
#include "spdlog/sinks/basic_file_sink.h"
#include "spdlog/sinks/stdout_color_sinks.h"
#undef SPDLOG_HEADER_ONLY
#include <thread>
#include <tuple>
#ifdef __GNUC__

src/spdlog/async.h → third_party/spdlog/async.h View File


src/spdlog/async_logger-inl.h → third_party/spdlog/async_logger-inl.h View File


src/spdlog/async_logger.h → third_party/spdlog/async_logger.h View File


src/spdlog/common-inl.h → third_party/spdlog/common-inl.h View File


src/spdlog/common.h → third_party/spdlog/common.h View File


src/spdlog/details/backtracer-inl.h → third_party/spdlog/details/backtracer-inl.h View File


src/spdlog/details/backtracer.h → third_party/spdlog/details/backtracer.h View File


src/spdlog/details/circular_q.h → third_party/spdlog/details/circular_q.h View File


src/spdlog/details/console_globals.h → third_party/spdlog/details/console_globals.h View File


src/spdlog/details/file_helper-inl.h → third_party/spdlog/details/file_helper-inl.h View File


src/spdlog/details/file_helper.h → third_party/spdlog/details/file_helper.h View File


src/spdlog/details/fmt_helper.h → third_party/spdlog/details/fmt_helper.h View File


src/spdlog/details/log_msg-inl.h → third_party/spdlog/details/log_msg-inl.h View File


src/spdlog/details/log_msg.h → third_party/spdlog/details/log_msg.h View File


src/spdlog/details/log_msg_buffer-inl.h → third_party/spdlog/details/log_msg_buffer-inl.h View File


src/spdlog/details/log_msg_buffer.h → third_party/spdlog/details/log_msg_buffer.h View File


src/spdlog/details/mpmc_blocking_q.h → third_party/spdlog/details/mpmc_blocking_q.h View File


src/spdlog/details/null_mutex.h → third_party/spdlog/details/null_mutex.h View File


src/spdlog/details/os-inl.h → third_party/spdlog/details/os-inl.h View File


src/spdlog/details/os.h → third_party/spdlog/details/os.h View File


src/spdlog/details/pattern_formatter-inl.h → third_party/spdlog/details/pattern_formatter-inl.h View File


src/spdlog/details/pattern_formatter.h → third_party/spdlog/details/pattern_formatter.h View File


src/spdlog/details/periodic_worker-inl.h → third_party/spdlog/details/periodic_worker-inl.h View File


src/spdlog/details/periodic_worker.h → third_party/spdlog/details/periodic_worker.h View File


src/spdlog/details/registry-inl.h → third_party/spdlog/details/registry-inl.h View File


src/spdlog/details/registry.h → third_party/spdlog/details/registry.h View File


src/spdlog/details/synchronous_factory.h → third_party/spdlog/details/synchronous_factory.h View File


src/spdlog/details/thread_pool-inl.h → third_party/spdlog/details/thread_pool-inl.h View File


src/spdlog/details/thread_pool.h → third_party/spdlog/details/thread_pool.h View File


src/spdlog/fmt/bin_to_hex.h → third_party/spdlog/fmt/bin_to_hex.h View File


src/spdlog/fmt/bundled/LICENSE.rst → third_party/spdlog/fmt/bundled/LICENSE.rst View File


src/spdlog/fmt/bundled/chrono.h → third_party/spdlog/fmt/bundled/chrono.h View File


src/spdlog/fmt/bundled/color.h → third_party/spdlog/fmt/bundled/color.h View File


src/spdlog/fmt/bundled/compile.h → third_party/spdlog/fmt/bundled/compile.h View File


src/spdlog/fmt/bundled/core.h → third_party/spdlog/fmt/bundled/core.h View File


src/spdlog/fmt/bundled/format-inl.h → third_party/spdlog/fmt/bundled/format-inl.h View File


src/spdlog/fmt/bundled/format.h → third_party/spdlog/fmt/bundled/format.h View File


src/spdlog/fmt/bundled/locale.h → third_party/spdlog/fmt/bundled/locale.h View File


src/spdlog/fmt/bundled/ostream.h → third_party/spdlog/fmt/bundled/ostream.h View File


src/spdlog/fmt/bundled/posix.h → third_party/spdlog/fmt/bundled/posix.h View File


src/spdlog/fmt/bundled/printf.h → third_party/spdlog/fmt/bundled/printf.h View File


src/spdlog/fmt/bundled/ranges.h → third_party/spdlog/fmt/bundled/ranges.h View File


src/spdlog/fmt/bundled/safe-duration-cast.h → third_party/spdlog/fmt/bundled/safe-duration-cast.h View File


src/spdlog/fmt/fmt.h → third_party/spdlog/fmt/fmt.h View File


src/spdlog/fmt/ostr.h → third_party/spdlog/fmt/ostr.h View File


src/spdlog/formatter.h → third_party/spdlog/formatter.h View File


src/spdlog/logger-inl.h → third_party/spdlog/logger-inl.h View File


src/spdlog/logger.h → third_party/spdlog/logger.h View File


src/spdlog/sinks/android_sink.h → third_party/spdlog/sinks/android_sink.h View File


src/spdlog/sinks/ansicolor_sink-inl.h → third_party/spdlog/sinks/ansicolor_sink-inl.h View File


src/spdlog/sinks/ansicolor_sink.h → third_party/spdlog/sinks/ansicolor_sink.h View File


src/spdlog/sinks/base_sink-inl.h → third_party/spdlog/sinks/base_sink-inl.h View File


src/spdlog/sinks/base_sink.h → third_party/spdlog/sinks/base_sink.h View File


src/spdlog/sinks/basic_file_sink-inl.h → third_party/spdlog/sinks/basic_file_sink-inl.h View File


src/spdlog/sinks/basic_file_sink.h → third_party/spdlog/sinks/basic_file_sink.h View File


src/spdlog/sinks/daily_file_sink.h → third_party/spdlog/sinks/daily_file_sink.h View File


src/spdlog/sinks/dist_sink.h → third_party/spdlog/sinks/dist_sink.h View File


src/spdlog/sinks/dup_filter_sink.h → third_party/spdlog/sinks/dup_filter_sink.h View File


src/spdlog/sinks/msvc_sink.h → third_party/spdlog/sinks/msvc_sink.h View File


src/spdlog/sinks/null_sink.h → third_party/spdlog/sinks/null_sink.h View File


src/spdlog/sinks/ostream_sink.h → third_party/spdlog/sinks/ostream_sink.h View File


src/spdlog/sinks/rotating_file_sink-inl.h → third_party/spdlog/sinks/rotating_file_sink-inl.h View File


src/spdlog/sinks/rotating_file_sink.h → third_party/spdlog/sinks/rotating_file_sink.h View File


src/spdlog/sinks/sink-inl.h → third_party/spdlog/sinks/sink-inl.h View File


src/spdlog/sinks/sink.h → third_party/spdlog/sinks/sink.h View File


src/spdlog/sinks/stdout_color_sinks-inl.h → third_party/spdlog/sinks/stdout_color_sinks-inl.h View File


src/spdlog/sinks/stdout_color_sinks.h → third_party/spdlog/sinks/stdout_color_sinks.h View File


src/spdlog/sinks/stdout_sinks-inl.h → third_party/spdlog/sinks/stdout_sinks-inl.h View File


src/spdlog/sinks/stdout_sinks.h → third_party/spdlog/sinks/stdout_sinks.h View File


src/spdlog/sinks/syslog_sink.h → third_party/spdlog/sinks/syslog_sink.h View File


src/spdlog/sinks/systemd_sink.h → third_party/spdlog/sinks/systemd_sink.h View File


src/spdlog/sinks/wincolor_sink-inl.h → third_party/spdlog/sinks/wincolor_sink-inl.h View File


src/spdlog/sinks/wincolor_sink.h → third_party/spdlog/sinks/wincolor_sink.h View File


src/spdlog/spdlog-inl.h → third_party/spdlog/spdlog-inl.h View File


src/spdlog/spdlog.h → third_party/spdlog/spdlog.h View File


src/spdlog/tweakme.h → third_party/spdlog/tweakme.h View File


src/spdlog/version.h → third_party/spdlog/version.h View File


Loading…
Cancel
Save