Compare commits
1 Commits
develop
...
fix/mktime
Author | SHA1 | Date | |
---|---|---|---|
4f7fe89011 |
@ -173,13 +173,12 @@ if((NOT TILE_HAVE_GETIFADDRS) OR (NOT TILE_HAVE_FREEIFADDRS))
|
||||
list(APPEND TILE_SRCS "tile/base/net/detail/android/ifaddrs.c")
|
||||
endif()
|
||||
|
||||
if(TILE_BUILD_SHARED)
|
||||
add_library(tile SHARED ${TILE_SRCS})
|
||||
else()
|
||||
add_library(tile STATIC ${TILE_SRCS})
|
||||
endif()
|
||||
add_library(tile_static STATIC ${TILE_SRCS})
|
||||
set_target_properties(tile PROPERTIES VERSION ${PROJECT_VERSION}
|
||||
SOVERSION ${PROJECT_VERSION_MAJOR})
|
||||
set_target_properties(tile_static PROPERTIES VERSION ${PROJECT_VERSION}
|
||||
SOVERSION ${PROJECT_VERSION_MAJOR})
|
||||
|
||||
target_precompile_headers(
|
||||
tile
|
||||
@ -190,7 +189,16 @@ target_precompile_headers(
|
||||
# ${CMAKE_CURRENT_SOURCE_DIR}/third_party/inja/inja/string_view.h
|
||||
# ${CMAKE_CURRENT_SOURCE_DIR}/third_party/inja/inja/inja.h
|
||||
)
|
||||
target_precompile_headers(
|
||||
tile_static
|
||||
PUBLIC
|
||||
"$<$<COMPILE_LANGUAGE:CXX>:${CMAKE_CURRENT_SOURCE_DIR}/third_party/header_only/toml.hpp>"
|
||||
# "$<$<COMPILE_LANGUAGE:CXX>:${CMAKE_CURRENT_SOURCE_DIR}/third_party/result/result.hpp>"
|
||||
# ${CMAKE_CURRENT_SOURCE_DIR}/third_party/json/nlohann/json.hpp
|
||||
# ${CMAKE_CURRENT_SOURCE_DIR}/third_party/inja/inja/string_view.h
|
||||
# ${CMAKE_CURRENT_SOURCE_DIR}/third_party/inja/inja/inja.h
|
||||
# target_sources(tile PRIVATE ${TILE_SRCS})
|
||||
)
|
||||
target_include_directories(
|
||||
tile
|
||||
PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/third_party/mustache.hpp"
|
||||
@ -203,8 +211,21 @@ target_include_directories(
|
||||
RPIVATE
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/third_party/header_only/"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include")
|
||||
target_include_directories(
|
||||
tile_static
|
||||
PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/third_party/mustache.hpp"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/third_party/fmt/include"
|
||||
# "${CMAKE_CURRENT_BINARY_DIR}/third_party/glog"
|
||||
# "${CMAKE_CURRENT_SOURCE_DIR}/third_party/glog/src"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}"
|
||||
${THIRD_PARTY_INCLUDE_DIRS}
|
||||
RPIVATE
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/third_party/header_only/"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include")
|
||||
if(TILE_WITH_MIMALLOC)
|
||||
target_link_libraries(tile PUBLIC mimalloc-obj)
|
||||
target_link_libraries(tile_static PUBLIC mimalloc-obj)
|
||||
endif()
|
||||
|
||||
target_link_libraries(
|
||||
@ -216,10 +237,20 @@ target_link_libraries(
|
||||
# -Wl,--end-group
|
||||
libcurl
|
||||
fmt)
|
||||
target_link_libraries(
|
||||
tile_static
|
||||
PUBLIC # -Wl,--start-group nova_context
|
||||
zlib
|
||||
gflags::gflags # glog::glog
|
||||
jsoncpp_static
|
||||
# -Wl,--end-group
|
||||
libcurl
|
||||
fmt)
|
||||
if((CMAKE_SYSTEM_PROCESSOR MATCHES "riscv64") OR (CMAKE_SYSTEM_PROCESSOR MATCHES
|
||||
"mips*"))
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||
target_link_libraries(tile PUBLIC atomic)
|
||||
target_link_libraries(tile_static PUBLIC atomic)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@ -235,6 +266,7 @@ endif()
|
||||
# set(LIB_NAMES -Wl,-all_load ${LIB_NAMES}) endif()
|
||||
|
||||
add_library(tile::tile ALIAS tile)
|
||||
add_library(tile::tile_static ALIAS tile_static)
|
||||
# add_library(tile SHARED $<TARGET_OBJECTS:tile>) target_include_directories(
|
||||
# tile PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/third_party/fmt/include"
|
||||
# "${CMAKE_CURRENT_BINARY_DIR}/third_party/glog"
|
||||
|
@ -347,7 +347,7 @@ LogMessageTime::init(const std::tm &t, std::time_t timestamp, WallTime now)
|
||||
void
|
||||
LogMessageTime::CalcGmtOffset()
|
||||
{
|
||||
std::tm gmt_struct;
|
||||
std::tm gmt_struct{0};
|
||||
int isDst = 0;
|
||||
if (true) {
|
||||
localtime_r(×tamp_, &gmt_struct);
|
||||
@ -494,9 +494,13 @@ LogToSinks(LogSeverity severity,
|
||||
const LogMessageTime &time,
|
||||
const char *message,
|
||||
size_t message_len)
|
||||
{
|
||||
std::vector<LogSink::Ptr> sinks;
|
||||
{
|
||||
std::lock_guard<std::mutex> _(g_sink_mutex);
|
||||
for (auto &&sink : g_sinks_arr) {
|
||||
sinks = g_sinks_arr;
|
||||
}
|
||||
for (auto &&sink : sinks) {
|
||||
if (sink->ShouldLog(severity)) {
|
||||
try {
|
||||
sink->Send(severity, full_filename, base_filename, line, time, message, message_len);
|
||||
@ -510,9 +514,14 @@ LogToSinks(LogSeverity severity,
|
||||
|
||||
void
|
||||
WaitForSinks()
|
||||
{
|
||||
std::vector<LogSink::Ptr> sinks;
|
||||
{
|
||||
std::lock_guard<std::mutex> _(g_sink_mutex);
|
||||
for (auto &&sink : g_sinks_arr) {
|
||||
sinks = g_sinks_arr;
|
||||
}
|
||||
|
||||
for (auto &&sink : sinks) {
|
||||
try {
|
||||
sink->Flush();
|
||||
} catch (const std::exception &e) {
|
||||
|
Reference in New Issue
Block a user