feat add tile_static, init struct tm
Some checks failed
android / build (arm64-v8a) (push) Failing after 3m23s
android / build (armeabi-v7a) (push) Failing after 3m34s
android / build (x86) (push) Failing after 3m29s
android / build (x86_64) (push) Failing after 3m24s
linux-aarch64-cpu-gcc / linux-gcc-aarch64 (Debug) (push) Failing after 3m9s
linux-aarch64-cpu-gcc / linux-gcc-aarch64 (Release) (push) Failing after 2m56s
linux-arm-gcc / linux-gcc-arm (Debug) (push) Failing after 1m24s
linux-arm-gcc / linux-gcc-arm (Release) (push) Failing after 3m29s
linux-arm-gcc / linux-gcc-armhf (Debug) (push) Failing after 1m31s
linux-arm-gcc / linux-gcc-armhf (Release) (push) Failing after 3m18s
linux-mips-gcc / linux-gcc-mipsel (Debug) (push) Failing after 3m16s
linux-mips-gcc / linux-gcc-mipsel (Release) (push) Failing after 3m30s
linux-mips64-gcc / linux-gcc-mips64el (Debug) (push) Failing after 3m49s
linux-mips64-gcc / linux-gcc-mips64el (Release) (push) Failing after 3m43s
linux-riscv64-gcc / linux-gcc-riscv64 (Debug) (push) Failing after 3m51s
linux-riscv64-gcc / linux-gcc-riscv64 (Release) (push) Failing after 3m2s
linux-x64-clang / linux-clang (Debug) (push) Failing after 3m20s
linux-x64-clang / linux-clang (Release) (push) Failing after 1m25s
linux-x64-gcc / linux-gcc (Debug) (push) Failing after 3m24s
linux-x64-gcc / linux-gcc (Release) (push) Failing after 2m59s
linux-x86-gcc / linux-gcc (Debug) (push) Failing after 3m27s
linux-x86-gcc / linux-gcc (Release) (push) Failing after 3m3s
Some checks failed
android / build (arm64-v8a) (push) Failing after 3m23s
android / build (armeabi-v7a) (push) Failing after 3m34s
android / build (x86) (push) Failing after 3m29s
android / build (x86_64) (push) Failing after 3m24s
linux-aarch64-cpu-gcc / linux-gcc-aarch64 (Debug) (push) Failing after 3m9s
linux-aarch64-cpu-gcc / linux-gcc-aarch64 (Release) (push) Failing after 2m56s
linux-arm-gcc / linux-gcc-arm (Debug) (push) Failing after 1m24s
linux-arm-gcc / linux-gcc-arm (Release) (push) Failing after 3m29s
linux-arm-gcc / linux-gcc-armhf (Debug) (push) Failing after 1m31s
linux-arm-gcc / linux-gcc-armhf (Release) (push) Failing after 3m18s
linux-mips-gcc / linux-gcc-mipsel (Debug) (push) Failing after 3m16s
linux-mips-gcc / linux-gcc-mipsel (Release) (push) Failing after 3m30s
linux-mips64-gcc / linux-gcc-mips64el (Debug) (push) Failing after 3m49s
linux-mips64-gcc / linux-gcc-mips64el (Release) (push) Failing after 3m43s
linux-riscv64-gcc / linux-gcc-riscv64 (Debug) (push) Failing after 3m51s
linux-riscv64-gcc / linux-gcc-riscv64 (Release) (push) Failing after 3m2s
linux-x64-clang / linux-clang (Debug) (push) Failing after 3m20s
linux-x64-clang / linux-clang (Release) (push) Failing after 1m25s
linux-x64-gcc / linux-gcc (Debug) (push) Failing after 3m24s
linux-x64-gcc / linux-gcc (Release) (push) Failing after 2m59s
linux-x86-gcc / linux-gcc (Debug) (push) Failing after 3m27s
linux-x86-gcc / linux-gcc (Release) (push) Failing after 3m3s
This commit is contained in:
@ -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 SHARED ${TILE_SRCS})
|
||||
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);
|
||||
@ -495,8 +495,12 @@ LogToSinks(LogSeverity severity,
|
||||
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);
|
||||
@ -511,8 +515,13 @@ 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