From e9c1b0b5ea46f34b069d05e21e17bd0c046ffdf8 Mon Sep 17 00:00:00 2001 From: raspopov Date: Mon, 6 Oct 2025 18:12:15 +0300 Subject: [PATCH] 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. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8783fa08..dc300ac8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -68,7 +68,7 @@ add_compile_options( $<$,$,$>:-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})