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

@ -135,12 +135,14 @@ set(CMAKE_CXX_EXTENSIONS OFF CACHE BOOL "Use compiler extensions")
# ugly hacks for MSVC which by default always reports an old C++ standard in the __cplusplus macro # 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 # and prints lots of pointless warnings about "unsafe" functions
if(MSVC) if(MSVC)
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
add_compile_options(/Zc:__cplusplus) add_compile_options(/Zc:__cplusplus)
add_compile_options(/wd4244) add_compile_options(/wd4244)
add_compile_options(/wd4267) add_compile_options(/wd4267)
if(LAMMPS_EXCEPTIONS) if(LAMMPS_EXCEPTIONS)
add_compile_options(/EHsc) add_compile_options(/EHsc)
endif() endif()
endif()
add_compile_definitions(_CRT_SECURE_NO_WARNINGS) add_compile_definitions(_CRT_SECURE_NO_WARNINGS)
endif() endif()

View File

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

View File

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