diff --git a/CMakeLists.txt b/CMakeLists.txt index ceda1a4..ec2ff51 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/Config.cmake.in b/Config.cmake.in index 50714d7..dd0c310 100644 --- a/Config.cmake.in +++ b/Config.cmake.in @@ -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@) diff --git a/include/TessesFramework/Serialization/Json.hpp b/include/TessesFramework/Serialization/Json.hpp index bd32f36..5a95c46 100644 --- a/include/TessesFramework/Serialization/Json.hpp +++ b/include/TessesFramework/Serialization/Json.hpp @@ -4,6 +4,7 @@ #include #include #include +#include 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); }; -} \ No newline at end of file +} diff --git a/src/Crypto/MbedHelpers.cpp b/src/Crypto/MbedHelpers.cpp index 8e8dc2b..3e6b226 100644 --- a/src/Crypto/MbedHelpers.cpp +++ b/src/Crypto/MbedHelpers.cpp @@ -371,6 +371,7 @@ namespace Tesses::Framework::Crypto } bool RandomBytes(std::vector& 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; } } diff --git a/src/Filesystem/LocalFS.cpp b/src/Filesystem/LocalFS.cpp index acc3779..ae7dfff 100644 --- a/src/Filesystem/LocalFS.cpp +++ b/src/Filesystem/LocalFS.cpp @@ -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 \ No newline at end of file +// C:/Users/Jim/Joel