1
0
mirror of https://github.com/obgm/libcoap.git synced 2025-10-14 02:19:34 +08:00

Fix MSVC compilation

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.
This commit is contained in:
raspopov
2025-10-06 18:12:15 +03:00
committed by Jon Shallow
parent fb77750ad3
commit e9c1b0b5ea

View File

@@ -68,7 +68,7 @@ add_compile_options(
$<$<OR:$<CXX_COMPILER_ID:GNU>,$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>>:-Werror>)
endif()
if(CMAKE_GENERATOR MATCHES "Visual Studio")
if(MSVC)
option(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS "Export all symbols when compiling to a .dll" ON)
# add_compile_options(/Wall /wd4100 /wd4820 /wd4668 /wd4061)
if(${WARNING_TO_ERROR})