fixes
This commit is contained in:
parent
7705432820
commit
2ae22cdb30
@ -19,13 +19,6 @@ endfunction(copy_support_files)
|
||||
function(set_common_target_options name)
|
||||
target_compile_definitions(${name} PUBLIC ${REPERTORY_DEFINITIONS})
|
||||
|
||||
if (UNIX OR MINGW)
|
||||
target_compile_options(${name} PRIVATE
|
||||
${REPERTORY_GCC_CXX_FLAGS}
|
||||
${REPERTORY_GCC_FLAGS}
|
||||
)
|
||||
endif()
|
||||
|
||||
target_precompile_headers(${name} PRIVATE include/common.hpp)
|
||||
|
||||
if (MACOS)
|
||||
@ -35,8 +28,8 @@ function(set_common_target_options name)
|
||||
|
||||
if (UNIX OR MINGW)
|
||||
target_compile_options(${name} PRIVATE
|
||||
${REPERTORY_GCC_CXX_FLAGS}
|
||||
${REPERTORY_GCC_FLAGS}
|
||||
$<$<COMPILE_LANGUAGE:CXX>:${REPERTORY_GCC_CXX_FLAGS}>
|
||||
$<$<COMPILE_LANGUAGE:C>:${REPERTORY_GCC_FLAGS}>
|
||||
)
|
||||
endif()
|
||||
endfunction(set_common_target_options)
|
||||
|
@ -226,18 +226,12 @@ auto get_file_time_now() -> std::uint64_t {
|
||||
void get_local_time_now(struct tm &local_time) {
|
||||
memset(&local_time, 0, sizeof(local_time));
|
||||
|
||||
static std::mutex mtx{};
|
||||
mutex_lock lock{mtx};
|
||||
|
||||
const auto now =
|
||||
std::chrono::system_clock::to_time_t(std::chrono::system_clock::now());
|
||||
#ifdef _WIN32
|
||||
localtime_s(&local_time, &now);
|
||||
#else
|
||||
const auto *tmp = std::localtime(&now);
|
||||
if (tmp != nullptr) {
|
||||
memcpy(&local_time, tmp, sizeof(local_time));
|
||||
}
|
||||
localtime_r(&now, &local_time);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user