add enabling and disabling setdate

This commit is contained in:
2025-04-29 05:00:39 -05:00
parent 82a3131e1b
commit b4ad435aab
5 changed files with 18 additions and 4 deletions

View File

@ -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)

View File

@ -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@)

View File

@ -4,6 +4,7 @@
#include <variant>
#include <map>
#include <iostream>
#include <cstdint>
namespace Tesses::Framework::Serialization::Json
{
class JArray;
@ -71,4 +72,4 @@ namespace Tesses::Framework::Serialization::Json
static JToken Decode(std::string str);
static std::string Encode(JToken tkn, bool indent=true);
};
}
}

View File

@ -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;
}
}

View File

@ -32,7 +32,8 @@ namespace Tesses::Framework::Filesystem
void LocalFilesystem::SetDate(VFSPath path, time_t lastWrite, time_t lastAccess)
{
std::string s = VFSPathToSystem(path);
#if defined(_WIN32)
#if defined(TESSESFRAMEWORK_ENABLE_SETDATE)
#if defined(_WIN32)
FILETIME lastWriteF;
FILETIME lastAccessF;
TimetToFileTime(lastWrite,&lastWriteF);
@ -62,6 +63,7 @@ namespace Tesses::Framework::Filesystem
utim.modtime = lastWrite;
utime(s.c_str(),&utim);
#endif
#endif
}
VFSPath LocalFilesystem::ReadLink(VFSPath path)
{
@ -191,4 +193,4 @@ namespace Tesses::Framework::Filesystem
LocalFilesystem LocalFS;
}
// C:/Users/Jim/Joel
// C:/Users/Jim/Joel