Browse Source

去掉 {fmt} 库的依赖

3.0.0
tearshark 2 years ago
parent
commit
06945058fe
4 changed files with 5 additions and 14 deletions
  1. 0
    4
      CMakeLists.txt
  2. 4
    4
      librf/src/def.h
  3. 1
    1
      tutorial/CMakeLists.txt
  4. 0
    5
      tutorial/test_async_resumable.cpp

+ 0
- 4
CMakeLists.txt View File

@@ -102,10 +102,6 @@ ${PROJECT_SOURCE_DIR}/config.h.in
${PROJECT_SOURCE_DIR}/librf/src/config.h
)
#{fmt}
add_definitions(-DFMT_HEADER_ONLY=1)
find_package(fmt)
include_directories(
${PROJECT_SOURCE_DIR}/librf
)

+ 4
- 4
librf/src/def.h View File

@@ -6,10 +6,10 @@
namespace std
{
using experimental::coroutine_traits;
using experimental::coroutine_handle;
using experimental::suspend_if;
using experimental::suspend_always;
using experimental::suspend_never;
using experimental::coroutine_handle;
using experimental::suspend_if;
using experimental::suspend_always;
using experimental::suspend_never;
}
#endif

+ 1
- 1
tutorial/CMakeLists.txt View File

@@ -6,5 +6,5 @@ foreach(TUTORIAL_FILE_PATH ${TUTORIAL_FILES})
message(STATUS "Generating test target: ${TUTORIAL_FILE_NAME}")

add_executable(${TUTORIAL_FILE_NAME} ${TUTORIAL_FILE_PATH})
target_link_libraries(${TUTORIAL_FILE_NAME} PRIVATE fmt::fmt-header-only PUBLIC librf ${LIB_MIMALLOC})
target_link_libraries(${TUTORIAL_FILE_NAME} PUBLIC librf ${LIB_MIMALLOC})
endforeach(TUTORIAL_FILE_PATH)

+ 0
- 5
tutorial/test_async_resumable.cpp View File

@@ -2,7 +2,6 @@
#include <chrono>
#include <iostream>
#include <string>
#include <fmt/format.h>
#include "librf.h"
@@ -16,14 +15,10 @@ void dump(size_t idx, std::string name, T start, T end, intptr_t count)
auto ns = std::chrono::duration_cast<std::chrono::nanoseconds>(end - start).count();
fmt::print("{:>2}:{:<30}{:<10}{:>16} ns{:>8} ns/op{:>10} w/cps\n", idx, name, count, ns, ns / count, count * 100ll * 1000ll / ns);
/*
std::cout << idx << ":" << name << " ";
std::cout << count << " " << ns << " ns ";
std::cout << (ns / count) << " ns/op" << " ";
std::cout << (count * 100ll * 1000ll / ns) << "w/cps" << std::endl;
*/
lock_console.unlock();
}

Loading…
Cancel
Save