Skip to content

Commit 0f01bad

Browse files
raspopovobgm
authored andcommitted
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.
1 parent 431079d commit 0f01bad

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ target_sources(tinydtls PRIVATE
7575
target_include_directories(tinydtls PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
7676
target_compile_definitions(tinydtls PUBLIC DTLSv12 WITH_SHA256 SHA2_USE_INTTYPES_H DTLS_CHECK_CONTENTTYPE)
7777

78-
if(CMAKE_GENERATOR MATCHES "Visual Studio")
78+
if(MSVC)
7979
option(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS "Export all symbols when compiling to a .dll" ON)
8080
target_compile_options(tinydtls PRIVATE -Wall)
8181
if(${WARNING_TO_ERROR})

0 commit comments

Comments
 (0)