make plugin compilation settings with MSVC consistent and more compile specific

This commit is contained in:
Axel Kohlmeyer
2022-06-04 05:15:14 -04:00
parent 0dc486c90b
commit 3beb071d38
3 changed files with 23 additions and 11 deletions

View File

@ -32,9 +32,14 @@ else()
# ugly hacks for MSVC which by default always reports an old C++ standard in the __cplusplus macro
# and prints lots of pointless warnings about "unsafe" functions
if(MSVC)
add_compile_options(/Zc:__cplusplus)
add_compile_options(/wd4244)
add_compile_options(/wd4267)
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
add_compile_options(/Zc:__cplusplus)
add_compile_options(/wd4244)
add_compile_options(/wd4267)
if(LAMMPS_EXCEPTIONS)
add_compile_options(/EHsc)
endif()
endif()
add_compile_definitions(_CRT_SECURE_NO_WARNINGS)
endif()
endif()