diff --git a/cmake/helpers.cmake b/cmake/helpers.cmake index 2cdbce53..1421299c 100644 --- a/cmake/helpers.cmake +++ b/cmake/helpers.cmake @@ -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) @@ -34,9 +27,9 @@ function(set_common_target_options name) endif() if (UNIX OR MINGW) - target_compile_options(${name} PRIVATE - ${REPERTORY_GCC_CXX_FLAGS} - ${REPERTORY_GCC_FLAGS} + target_compile_options(${name} PRIVATE + $<$:${REPERTORY_GCC_CXX_FLAGS}> + $<$:${REPERTORY_GCC_FLAGS}> ) endif() endfunction(set_common_target_options) diff --git a/src/utils/utils.cpp b/src/utils/utils.cpp index f60629be..7c47a8ab 100644 --- a/src/utils/utils.cpp +++ b/src/utils/utils.cpp @@ -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 }