Tweak compiler warnings

This commit is contained in:
Andrew Cassidy 2022-05-24 21:33:39 -07:00
parent c57106e3b2
commit 829b5312b5
2 changed files with 3 additions and 10 deletions

View File

@ -63,14 +63,6 @@ target_compile_features(_quicktex PUBLIC cxx_std_17 c_std_11)
set_project_warnings(_quicktex)
set_simd_flags(_quicktex)
# Clang-specific
if (CMAKE_CXX_COMPILER_ID MATCHES ".*Clang")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fsanitize=undefined")
set(PROJECT_WARNINGS ${CLANG_WARNINGS})
endif ()
if (MSVC)
target_compile_options(_quicktex PUBLIC /DWIN32_LEAN_AND_MEAN=1 /DNOMINMAX=1) # prevent windows macros from stepping on everything
endif()

View File

@ -37,6 +37,7 @@ function(set_project_warnings project_name)
/w14928 # illegal copy-initialization; more than one user-defined
# conversion has been implicitly applied
/permissive- # standards conformance mode for MSVC compiler.
/wd4701 # uninitialized variable checker is trigger-happy
)
set(CLANG_WARNINGS
@ -52,7 +53,7 @@ function(set_project_warnings project_name)
-Wunused # warn on anything being unused
-Woverloaded-virtual # warn if you overload (not override) a virtual
# function
# -Wpedantic # warn if non-standard C++ is used
# -Wpedantic # warn if non-standard C++ is used
#-Wconversion # warn on type conversions that may lose data
#-Wsign-conversion # warn on sign conversions
-Wnull-dereference # warn if a null dereference is detected
@ -74,7 +75,7 @@ function(set_project_warnings project_name)
-Wduplicated-branches # warn if if / else branches have duplicated code
-Wlogical-op # warn about logical operations being used where bitwise were
# probably wanted
-Wuseless-cast # warn if you perform a cast to the same type
# -Wuseless-cast # warn if you perform a cast to the same type
)
if (MSVC)