From a78aa26906bf544e7771c0af67fa074bd535ade9 Mon Sep 17 00:00:00 2001 From: Vitaly Chikunov Date: Sat, 4 Dec 2021 12:35:46 +0300 Subject: [PATCH] MSVC: Skip building Linux-only binaries Signed-off-by: Vitaly Chikunov --- CMakeLists.txt | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2616196..684a93d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -260,11 +260,13 @@ add_test(NAME sign/verify-with-engine COMMAND test_sign) set_tests_properties(sign/verify-with-engine PROPERTIES ENVIRONMENT "${TEST_ENVIRONMENT_ENGINE}") -add_executable(test_tls test_tls.c) -target_link_libraries(test_tls OpenSSL::SSL) -add_test(NAME TLS-with-engine COMMAND test_tls) -set_tests_properties(TLS-with-engine - PROPERTIES ENVIRONMENT "${TEST_ENVIRONMENT_ENGINE}") +if(NOT MSVC) + add_executable(test_tls test_tls.c) + target_link_libraries(test_tls OpenSSL::SSL) + add_test(NAME TLS-with-engine COMMAND test_tls) + set_tests_properties(TLS-with-engine + PROPERTIES ENVIRONMENT "${TEST_ENVIRONMENT_ENGINE}") +endif() add_executable(test_context test_context.c) target_link_libraries(test_context OpenSSL::Crypto) @@ -301,8 +303,10 @@ if(NOT SKIP_PERL_TESTS) endif() endif() -add_executable(sign benchmark/sign.c) -target_link_libraries(sign gost_core gost_err ${CLOCK_GETTIME_LIB}) +if(NOT MSVC) + add_executable(sign benchmark/sign.c) + target_link_libraries(sign gost_core gost_err ${CLOCK_GETTIME_LIB}) +endif() # All that may need to load just built engine will have path to it defined. set(BINARY_TESTS_TARGETS @@ -315,8 +319,10 @@ set(BINARY_TESTS_TARGETS test_context test_keyexpimp test_gost89 - test_tls ) +if(NOT MSVC) + list(APPEND BINARY_TESTS_TARGETS test_tls) +endif() set_property(TARGET ${BINARY_TESTS_TARGETS} APPEND PROPERTY COMPILE_DEFINITIONS ENGINE_DIR="${OUTPUT_DIRECTORY}") add_library(gost_core STATIC ${GOST_LIB_SOURCE_FILES}) -- 2.39.2