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