Build: Disable warnings in protobuf projects

This commit is contained in:
Naios
2017-12-19 17:22:30 +01:00
parent 1285347518
commit 95a837717b
2 changed files with 20 additions and 9 deletions

View File

@@ -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

View File

@@ -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