From 13c5bc2d9e01ce69c5c18cfa67169d3b565cdd28 Mon Sep 17 00:00:00 2001 From: Jon Beniston Date: Fri, 3 Mar 2023 22:28:59 +0000 Subject: [PATCH] Disable some warnings when compiling with MSVC, so more important ones aren't hidden in the noise. --- cmake/Modules/CompilerOptions.cmake | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cmake/Modules/CompilerOptions.cmake b/cmake/Modules/CompilerOptions.cmake index db0610599..75b698171 100644 --- a/cmake/Modules/CompilerOptions.cmake +++ b/cmake/Modules/CompilerOptions.cmake @@ -20,6 +20,12 @@ endif() if(NOT MSVC) add_compile_options(-Wall -Wextra -Wvla -Woverloaded-virtual -Wno-inconsistent-missing-override -ffast-math -fno-finite-math-only -ftree-vectorize) +else() + # Disable some warnings, so more useful warnings aren't hidden in the noise + # 4996 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. + # C4267: 'return': conversion from 'size_t' to 'int', possible loss of data + # C4305: 'initializing': truncation from 'double' to 'Real' + add_compile_options(/wd4996 /wd4267 /wd4305) endif() if (SANITIZE_ADDRESS)