add enabling and disabling setdate
This commit is contained in:
@ -53,6 +53,7 @@ option(TESSESFRAMEWORK_ENABLE_APPS "Enable Tesses Framework cli apps" ON)
|
||||
option(TESSESFRAMEWORK_INSTALL_DEVELOPMENT "Enable Installing Tesses Framework Development Packages" ON)
|
||||
option(TESSESFRAMEWORK_ENABLE_STATIC "Enable Tesses Framework Static Libraries" ON)
|
||||
option(TESSESFRAMEWORK_ENABLE_SHARED "Enable Tesses Framework Shared Libraries" ON)
|
||||
option(TESSESFRAMEWORK_ENABLE_SETDATE "Enable setting date to file" ON)
|
||||
option(TESSESFRAMEWORK_LOGTOFILE "TessesFramework Log to file" OFF)
|
||||
|
||||
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include)
|
||||
@ -119,10 +120,16 @@ target_link_libraries(${TessesFramework_TARGET} PUBLIC ws2_32)
|
||||
endif()
|
||||
|
||||
if(NOT ("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows" OR "${CMAKE_SYSTEM_NAME}" STREQUAL "NintendoWii" OR "${CMAKE_SYSTEM_NAME}" STREQUAL "NintendoGameCube"))
|
||||
|
||||
if(TESSESFRAMEWORK_ENABLE_THREADING)
|
||||
set(THREADS_PREFER_PTHREAD_FLAG ON)
|
||||
find_package(Threads REQUIRED)
|
||||
target_link_libraries(${TessesFramework_TARGET} PRIVATE Threads::Threads)
|
||||
endif()
|
||||
endif()
|
||||
if(TESSESFRAMEWORK_ENABLE_SETDATE)
|
||||
target_compile_definitions(${TessesFramework_TARGET} PUBLIC TESSESFRAMEWORK_ENABLE_SETDATE)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
include(GNUInstallDirs)
|
||||
|
||||
@ -5,9 +5,10 @@ include("${CMAKE_CURRENT_LIST_DIR}/TessesFrameworkTargets.cmake")
|
||||
check_required_components(TessesFramework)
|
||||
|
||||
if(NOT ("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows" OR "${CMAKE_SYSTEM_NAME}" STREQUAL "NintendoWii" OR "${CMAKE_SYSTEM_NAME}" STREQUAL "NintendoGameCube"))
|
||||
if(@TESSESFRAMEWORK_ENABLE_THREADING@)
|
||||
set(THREADS_PREFER_PTHREAD_FLAG ON)
|
||||
find_package(Threads REQUIRED)
|
||||
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(TESSESFRAMEWORK_ENABLE_LIBWEBCAM @TESSESFRAMEWORK_ENABLE_LIBWEBCAM@)
|
||||
|
||||
@ -4,6 +4,7 @@
|
||||
#include <variant>
|
||||
#include <map>
|
||||
#include <iostream>
|
||||
#include <cstdint>
|
||||
namespace Tesses::Framework::Serialization::Json
|
||||
{
|
||||
class JArray;
|
||||
|
||||
@ -371,6 +371,7 @@ namespace Tesses::Framework::Crypto
|
||||
}
|
||||
bool RandomBytes(std::vector<uint8_t>& output, std::string personal_str)
|
||||
{
|
||||
#if defined(TESSESFRAMEWORK_ENABLE_MBED)
|
||||
mbedtls_entropy_context entropy;
|
||||
mbedtls_ctr_drbg_context ctr_drbg;
|
||||
|
||||
@ -394,5 +395,7 @@ namespace Tesses::Framework::Crypto
|
||||
mbedtls_ctr_drbg_free(&ctr_drbg);
|
||||
mbedtls_entropy_free(&entropy);
|
||||
return true;
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -32,6 +32,7 @@ namespace Tesses::Framework::Filesystem
|
||||
void LocalFilesystem::SetDate(VFSPath path, time_t lastWrite, time_t lastAccess)
|
||||
{
|
||||
std::string s = VFSPathToSystem(path);
|
||||
#if defined(TESSESFRAMEWORK_ENABLE_SETDATE)
|
||||
#if defined(_WIN32)
|
||||
FILETIME lastWriteF;
|
||||
FILETIME lastAccessF;
|
||||
@ -62,6 +63,7 @@ namespace Tesses::Framework::Filesystem
|
||||
utim.modtime = lastWrite;
|
||||
utime(s.c_str(),&utim);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
VFSPath LocalFilesystem::ReadLink(VFSPath path)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user