don't stick compiler options in the definitions

develop
Myk Taylor 2022-12-11 09:42:25 +00:00
parent d12ba72a5e
commit 2ebd38e400
No known key found for this signature in database
1 changed files with 6 additions and 6 deletions

@ -75,11 +75,11 @@ set(CMAKE_CXX_EXTENSIONS OFF)
if(MSVC) if(MSVC)
# increase warning level and treat warnings as errors # increase warning level and treat warnings as errors
add_definitions("/WX") add_compile_options("/WX")
add_definitions("/W3") add_compile_options("/W3")
# disable C4819 code-page warning # disable C4819 code-page warning
add_definitions("/wd4819") add_compile_options("/wd4819")
# disable use of POSIX name warnings # disable use of POSIX name warnings
add_definitions("/D_CRT_NONSTDC_NO_WARNINGS /D_CRT_SECURE_NO_WARNINGS") add_definitions("/D_CRT_NONSTDC_NO_WARNINGS /D_CRT_SECURE_NO_WARNINGS")
@ -88,16 +88,16 @@ if(MSVC)
# weird and mysterious linking errors, you can disable this, but you'll have to # weird and mysterious linking errors, you can disable this, but you'll have to
# deal with a LOT of compiler noise over it # deal with a LOT of compiler noise over it
# see https://msdn.microsoft.com/en-us/library/074af4b6.aspx # see https://msdn.microsoft.com/en-us/library/074af4b6.aspx
add_definitions("/wd4503") add_compile_options("/wd4503")
# suppress C4267 - VC++ complains whenever we implicitly convert an integer to # suppress C4267 - VC++ complains whenever we implicitly convert an integer to
# a smaller type, and most of the time this is just conversion from 64 to 32 bits # a smaller type, and most of the time this is just conversion from 64 to 32 bits
# for things like vector sizes, which are never that big anyway. # for things like vector sizes, which are never that big anyway.
add_definitions("/wd4267") add_compile_options("/wd4267")
# MSVC panics if an object file contains more than 65,279 sections. this # MSVC panics if an object file contains more than 65,279 sections. this
# happens quite frequently with code that uses templates, such as vectors. # happens quite frequently with code that uses templates, such as vectors.
add_definitions("/bigobj") add_compile_options("/bigobj")
endif() endif()
# Automatically detect architecture based on Visual Studio generator # Automatically detect architecture based on Visual Studio generator