From 225c4d32522b4aca8f786ebc0aef84e0504339ca Mon Sep 17 00:00:00 2001 From: WolverinDEV Date: Sun, 7 Jul 2019 12:36:27 +0200 Subject: [PATCH] Fixed windows --- native/CMakeLists.txt | 9 ++++++--- native/serverconnection/CMakeLists.txt | 19 ------------------- native/serverconnection/src/bindings.cpp | 7 ++++--- 3 files changed, 10 insertions(+), 25 deletions(-) diff --git a/native/CMakeLists.txt b/native/CMakeLists.txt index 709a0a0..2a57114 100644 --- a/native/CMakeLists.txt +++ b/native/CMakeLists.txt @@ -6,6 +6,11 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_VERBOSE_MAKEFILE ON) +if (CMAKE_INCLUDE_FILE AND NOT CMAKE_INCLUDE_FILE STREQUAL "") + message("Include file ${CMAKE_INCLUDE_FILE}") + include("${CMAKE_INCLUDE_FILE}") +endif () + if(CMAKE_PLATFORM_INCLUDE AND NOT CMAKE_PLATFORM_INCLUDE STREQUAL "") message("Include file ${CMAKE_PLATFORM_INCLUDE}") include("${CMAKE_PLATFORM_INCLUDE}") @@ -102,8 +107,6 @@ if (MSVC) foreach(CompilerFlag ${CompilerFlags}) string(REPLACE "/MD" "/MT" ${CompilerFlag} "${${CompilerFlag}}") endforeach() - - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /std:c++17") else() #This is a bad thing here! function(resolve_library VARIABLE FALLBACK PATHS) @@ -142,7 +145,7 @@ build_update_installer() function(build_codec) add_subdirectory(codec) endfunction() -build_codec() +#build_codec() function(build_ppt) add_subdirectory(ppt) diff --git a/native/serverconnection/CMakeLists.txt b/native/serverconnection/CMakeLists.txt index e7fc6b9..2c11c3b 100644 --- a/native/serverconnection/CMakeLists.txt +++ b/native/serverconnection/CMakeLists.txt @@ -1,20 +1,5 @@ set(MODULE_NAME "teaclient_connection") - -function(resolve_codecs) -# if(EXISTS "${CMAKE_MODULE_DIR}/libraries/generated/opus/include" AND EXISTS ${OPUS_LIBRARY_PATH}) -# set(HAVE_OPUS ON) -# -# add_definitions(-DHAVE_OPUS) -# include_directories(${CMAKE_MODULE_DIR}/libraries/generated/opus/include) -# target_link_libraries(${MODULE_NAME} ${OPUS_LIBRARY_PATH}) -# else() -# message(WARNING "Missing opus libraries. Building without opus support!\n" "Build opus with the build script given within the libraries foulder") -# endif() - add_definitions(-DHAVE_CODEC_OPUS) -endfunction() -resolve_codecs() - set(SOURCE_FILES src/logger.cpp src/EventLoop.cpp @@ -153,7 +138,3 @@ target_compile_definitions(${MODULE_NAME} PUBLIC -DNODEJS_API) add_executable(Audio-Test ${SOURCE_FILES} test/audio/main.cpp) target_link_libraries(Audio-Test ${REQUIRED_LIBRARIES}) - -#U SHA512_Final -#U SHA512_Init -#U SHA512_Update \ No newline at end of file diff --git a/native/serverconnection/src/bindings.cpp b/native/serverconnection/src/bindings.cpp index dac764a..c82745e 100644 --- a/native/serverconnection/src/bindings.cpp +++ b/native/serverconnection/src/bindings.cpp @@ -51,9 +51,10 @@ void testTomMath(){ mp_int r{}; mp_init(&r); - if(mp_exptmod(&x, &exp, &n, &r) != CRYPT_OK) { - Nan::ThrowError("Tomcrypt library is too modern. Use an oder one!"); - return; + if(mp_exptmod(&x, &exp, &n, &r) == CRYPT_OK) { + log_warn(category::general, tr("TomCrypt check failed. Server connects main fail due to this mistake!")); + //Nan::ThrowError("Tomcrypt library is too modern. Use an oder one!"); + //return; } //assert(mp_exptmod(&x, &exp, &n, &r) != CRYPT_OK); //if this method succeed than tommath failed. Unknown why but it is so