This commit is contained in:
akallabeth 2024-11-14 20:15:02 +01:00
parent 4a2d0f96e3
commit 2404d71d8b
4 changed files with 40 additions and 47 deletions

View File

@ -502,13 +502,8 @@ endif()
include(CTest) include(CTest)
if(BUILD_TESTING_INTERNAL OR BUILD_TESTING) if(BUILD_TESTING_INTERNAL OR BUILD_TESTING)
enable_testing() enable_testing()
set(TESTING_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/Testing")
if(MSVC)
set(TESTING_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}")
else()
set(TESTING_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/Testing")
endif()
endif() endif()
include(CommonConfigOptions) include(CommonConfigOptions)

View File

@ -1,5 +1,6 @@
#include <stdio.h> #include <stdio.h>
#include <winpr/user.h>
#include <winpr/crypto.h> #include <winpr/crypto.h>
#include <freerdp/settings.h> #include <freerdp/settings.h>

View File

@ -275,49 +275,44 @@ if(NOT WIN32 AND NOT IOS)
list(REMOVE_ITEM CMAKE_REQUIRED_LIBRARIES pthread) list(REMOVE_ITEM CMAKE_REQUIRED_LIBRARIES pthread)
endif() endif()
set(OPENSSL_FEATURE_TYPE "RECOMMENDED") set(OPENSSL_FEATURE_TYPE "RECOMMENDED")
set(OPENSSL_FEATURE_PURPOSE "cryptography") set(OPENSSL_FEATURE_PURPOSE "cryptography")
set(OPENSSL_FEATURE_DESCRIPTION "encryption, certificate validation, hashing functions") set(OPENSSL_FEATURE_DESCRIPTION "encryption, certificate validation, hashing functions")
set(MBEDTLS_FEATURE_TYPE "OPTIONAL") set(MBEDTLS_FEATURE_TYPE "OPTIONAL")
set(MBEDTLS_FEATURE_PURPOSE "cryptography") set(MBEDTLS_FEATURE_PURPOSE "cryptography")
set(MBEDTLS_FEATURE_DESCRIPTION "encryption, certificate validation, hashing functions") set(MBEDTLS_FEATURE_DESCRIPTION "encryption, certificate validation, hashing functions")
option(WITH_LIBRESSL "build with LibreSSL" OFF) option(WITH_LIBRESSL "build with LibreSSL" OFF)
if (WITH_LIBRESSL) if (WITH_LIBRESSL)
find_package(LibreSSL REQUIRED) find_package(LibreSSL REQUIRED)
set(OPENSSL_INCLUDE_DIR ${LIBRESSL_INCLUDE_DIR}) set(OPENSSL_INCLUDE_DIR ${LIBRESSL_INCLUDE_DIR})
set(OPENSSL_LIBRARIES ${LIBRESSL_LIBRARIES}) set(OPENSSL_LIBRARIES ${LIBRESSL_LIBRARIES})
set(OPENSSL_CRYPTO_LIBRARIES ${LIBRESSL_LIBRARIES}) set(OPENSSL_CRYPTO_LIBRARIES ${LIBRESSL_LIBRARIES})
set(WITH_OPENSSL ON) set(WITH_OPENSSL ON)
set(OPENSSL_FOUND ON) set(OPENSSL_FOUND ON)
add_compile_definitions("WITH_LIBRESSL") add_compile_definitions("WITH_LIBRESSL")
add_compile_definitions("WITH_OPENSSL") add_compile_definitions("WITH_OPENSSL")
else() else()
find_feature(OpenSSL ${OPENSSL_FEATURE_TYPE} ${OPENSSL_FEATURE_PURPOSE} ${OPENSSL_FEATURE_DESCRIPTION}) find_feature(OpenSSL ${OPENSSL_FEATURE_TYPE} ${OPENSSL_FEATURE_PURPOSE} ${OPENSSL_FEATURE_DESCRIPTION})
find_feature(MbedTLS ${MBEDTLS_FEATURE_TYPE} ${MBEDTLS_FEATURE_PURPOSE} ${MBEDTLS_FEATURE_DESCRIPTION}) find_feature(MbedTLS ${MBEDTLS_FEATURE_TYPE} ${MBEDTLS_FEATURE_PURPOSE} ${MBEDTLS_FEATURE_DESCRIPTION})
endif()
if (NOT OPENSSL_FOUND AND NOT MBEDTLS_FOUND AND NOT LibreSSL_FOUND)
message(FATAL_ERROR "OpenSSL or MBedTLS are required, none enabled/found")
endif()
if(WITH_OPENSSL AND OPENSSL_FOUND)
add_compile_definitions("WITH_OPENSSL")
endif()
if(WITH_MBEDTLS AND MBEDTLS_FOUND)
add_compile_definitions("WITH_MBEDTLS")
endif()
enable_testing()
if(MSVC)
set(TESTING_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}")
else()
set(TESTING_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/Testing")
endif() endif()
if (NOT OPENSSL_FOUND AND NOT MBEDTLS_FOUND AND NOT LibreSSL_FOUND)
message(FATAL_ERROR "OpenSSL or MBedTLS are required, none enabled/found")
endif()
if(WITH_OPENSSL AND OPENSSL_FOUND)
add_compile_definitions("WITH_OPENSSL")
endif()
if(WITH_MBEDTLS AND MBEDTLS_FOUND)
add_compile_definitions("WITH_MBEDTLS")
endif()
enable_testing()
set(TESTING_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/Testing")
if (NOT WIN32 AND NOT IOS AND NOT ANDROID) if (NOT WIN32 AND NOT IOS AND NOT ANDROID)
set(PKCS11_DEFAULT ON) set(PKCS11_DEFAULT ON)
else() else()

View File

@ -27,7 +27,9 @@
* Standard Clipboard Formats * Standard Clipboard Formats
*/ */
#ifndef _WIN32 #ifdef _WIN32
#include <winuser.h>
#else
#define MB_OK 0x00000000L #define MB_OK 0x00000000L
#define MB_OKCANCEL 0x00000001L #define MB_OKCANCEL 0x00000001L