From a966044a55e5d95f8a871200ec9dec5fd2192166 Mon Sep 17 00:00:00 2001 From: raspopov Date: Mon, 6 Oct 2025 19:07:06 +0300 Subject: [PATCH] Fix MSVC compilation (CMake-based) Using the Ninja generator with the MSVC compiler leads to errors due to incorrect compiler call options. In CMake, the generator and the compiler are different entities. This fix replaces the incorrect CMake variable with the correct one that describes the current MSVC-compatible compiler. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 551282f1..cbfe4041 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -75,7 +75,7 @@ target_sources(tinydtls PRIVATE target_include_directories(tinydtls PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) target_compile_definitions(tinydtls PUBLIC DTLSv12 WITH_SHA256 SHA2_USE_INTTYPES_H DTLS_CHECK_CONTENTTYPE) -if(CMAKE_GENERATOR MATCHES "Visual Studio") +if(MSVC) option(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS "Export all symbols when compiling to a .dll" ON) target_compile_options(tinydtls PRIVATE -Wall) if(${WARNING_TO_ERROR})