Skip to content

Commit

Permalink
Spdlog 使用系统默认参数
Browse files Browse the repository at this point in the history
  • Loading branch information
lanthora committed Feb 23, 2024
1 parent f1d3ea3 commit c04fe5d
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cmake/spdlog.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
find_package(PkgConfig REQUIRED)
pkg_check_modules(SPDLOG REQUIRED spdlog)

add_definitions(${SPDLOG_CFLAGS})

include_directories(${SPDLOG_INCLUDEDIR})
target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE ${SPDLOG_LIBRARIES})
2 changes: 2 additions & 0 deletions src/core/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
aux_source_directory(. DIR_LIB_SRCS)
add_library(core STATIC ${DIR_LIB_SRCS})

include(${CMAKE_SOURCE_DIR}/cmake/spdlog.cmake)
3 changes: 3 additions & 0 deletions src/peer/posix.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@
#include "peer/peer.h"
#include "utility/address.h"
#include <errno.h>
#include <fcntl.h>
#include <netdb.h>
#include <netinet/in.h>
#include <spdlog/spdlog.h>
#include <sys/select.h>
#include <sys/socket.h>
#include <unistd.h>

namespace Candy {

Expand Down
2 changes: 2 additions & 0 deletions src/tun/darwin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include "tun/tun.h"
#include "utility/address.h"
#include <errno.h>
#include <fcntl.h>
#include <memory>
#include <net/if.h>
#include <net/if_utun.h>
Expand All @@ -14,6 +15,7 @@
#include <string>
#include <sys/ioctl.h>
#include <sys/kern_control.h>
#include <sys/select.h>
#include <sys/socket.h>
#include <sys/sys_domain.h>
#include <sys/uio.h>
Expand Down
2 changes: 2 additions & 0 deletions src/utility/time.cc
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ struct ntp_packet {

#if defined(__linux__) || defined(__linux) || defined(__APPLE__) || defined(__MACH__)
#include <netdb.h>
#include <sys/select.h>
#include <unistd.h>

static int64_t ntpTime() {
struct addrinfo hints = {}, *info = NULL;
Expand Down

0 comments on commit c04fe5d

Please sign in to comment.