diff options
-rw-r--r-- | dep/protobuf/CMakeLists.txt | 12 | ||||
-rw-r--r-- | src/server/proto/CMakeLists.txt | 17 |
2 files changed, 20 insertions, 9 deletions
diff --git a/dep/protobuf/CMakeLists.txt b/dep/protobuf/CMakeLists.txt index c4b5d83f45e..7bcd37da7c2 100644 --- a/dep/protobuf/CMakeLists.txt +++ b/dep/protobuf/CMakeLists.txt @@ -49,7 +49,6 @@ if (MSVC) ${protobuf_STAT_SRCS} src/google/protobuf/stubs/atomicops_internals_x86_msvc.cc ) - add_compile_options(/wd4800) else() set(protobuf_STAT_SRCS ${protobuf_STAT_SRCS} @@ -68,6 +67,7 @@ target_include_directories(protobuf target_link_libraries(protobuf PRIVATE trinity-default-interface + trinity-no-warning-interface PUBLIC threads) @@ -80,6 +80,16 @@ if (BUILD_SHARED_LIBS) -DPROTOBUF_USE_DLLS) endif() +if (MSVC) + target_compile_options(protobuf + PRIVATE + /wd4996) + + target_compile_definitions(protobuf + PRIVATE + -D_SCL_SECURE_NO_WARNINGS) +endif() + set_target_properties(protobuf PROPERTIES FOLDER diff --git a/src/server/proto/CMakeLists.txt b/src/server/proto/CMakeLists.txt index 59d51fbbbbd..12387816457 100644 --- a/src/server/proto/CMakeLists.txt +++ b/src/server/proto/CMakeLists.txt @@ -8,14 +8,6 @@ # WITHOUT ANY WARRANTY, to the extent permitted by law; without even the # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") - string(REGEX REPLACE "/W[0-4]" "/W0" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - string(REGEX REPLACE "/W[0-4]" "/W0" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") -else() - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -w") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w") -endif() - CollectSourceFiles( ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE_SOURCES @@ -47,10 +39,19 @@ target_include_directories(proto ${CMAKE_CURRENT_BINARY_DIR}) target_link_libraries(proto + PRIVATE + trinity-default-interface + trinity-no-warning-interface PUBLIC common protobuf) +if (MSVC) + target_compile_definitions(protobuf + PRIVATE + -D_SCL_SECURE_NO_WARNINGS) +endif() + set_target_properties(proto PROPERTIES FOLDER |