From d78341ef25fdb0c163e2d2be2618a18595ee2bf0 Mon Sep 17 00:00:00 2001 From: Siddharth Chandrasekaran Date: Thu, 21 Mar 2024 08:37:27 +0100 Subject: [PATCH] cmake: Fix MSVC compiler flag issue Signed-off-by: Siddharth Chandrasekaran --- CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bc76197..c76db21 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,7 +26,11 @@ include(BuildType) include(GNUInstallDirs) ## Global settings -add_compile_options(-Wall -Wextra) +if(MSVC) + add_compile_options(/W4 /WX) +else() + add_compile_options(-Wall -Wextra) +endif() set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)