mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2025-12-05 20:39:59 -08:00
[Fix-Warnings] Suppress C4100: unreferenced parameter for protobuf files (#6373)
* [Fix-Warnings] Suppress C4100: unreferenced parameter for protobuf files. * [Fix-Warnings] Compiler specific options. * [Fix-Warnings] Lint.
This commit is contained in:
@@ -165,6 +165,12 @@ set(PROTO_FILES
|
|||||||
session_event.proto
|
session_event.proto
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if(MSVC)
|
||||||
|
set(unused_warning /wd4100)
|
||||||
|
else()
|
||||||
|
set(unused_warning -Wno-unused-parameter)
|
||||||
|
endif()
|
||||||
|
|
||||||
if(${Protobuf_VERSION} VERSION_LESS "3.21.0.0")
|
if(${Protobuf_VERSION} VERSION_LESS "3.21.0.0")
|
||||||
message(STATUS "Using Protobuf Legacy Mode")
|
message(STATUS "Using Protobuf Legacy Mode")
|
||||||
include_directories(${PROTOBUF_INCLUDE_DIRS})
|
include_directories(${PROTOBUF_INCLUDE_DIRS})
|
||||||
@@ -172,6 +178,7 @@ if(${Protobuf_VERSION} VERSION_LESS "3.21.0.0")
|
|||||||
protobuf_generate_cpp(PROTO_SRCS PROTO_HDRS ${PROTO_FILES})
|
protobuf_generate_cpp(PROTO_SRCS PROTO_HDRS ${PROTO_FILES})
|
||||||
|
|
||||||
add_library(libcockatrice_protocol_pb ${PROTO_SRCS} ${PROTO_HDRS})
|
add_library(libcockatrice_protocol_pb ${PROTO_SRCS} ${PROTO_HDRS})
|
||||||
|
target_compile_options(libcockatrice_protocol_pb PRIVATE ${unused_warning})
|
||||||
set(libcockatrice_protocol_pb_LIBS ${PROTOBUF_LIBRARIES})
|
set(libcockatrice_protocol_pb_LIBS ${PROTOBUF_LIBRARIES})
|
||||||
if(UNIX)
|
if(UNIX)
|
||||||
set(libcockatrice_protocol_pb_LIBS ${libcockatrice_protocol_pb_LIBS} -lpthread)
|
set(libcockatrice_protocol_pb_LIBS ${libcockatrice_protocol_pb_LIBS} -lpthread)
|
||||||
@@ -189,6 +196,7 @@ if(${Protobuf_VERSION} VERSION_LESS "3.21.0.0")
|
|||||||
endif()
|
endif()
|
||||||
else()
|
else()
|
||||||
add_library(libcockatrice_protocol_pb ${PROTO_FILES})
|
add_library(libcockatrice_protocol_pb ${PROTO_FILES})
|
||||||
|
target_compile_options(libcockatrice_protocol_pb PRIVATE ${unused_warning})
|
||||||
target_link_libraries(libcockatrice_protocol_pb PUBLIC protobuf::libprotobuf)
|
target_link_libraries(libcockatrice_protocol_pb PUBLIC protobuf::libprotobuf)
|
||||||
set(PROTO_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}")
|
set(PROTO_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}")
|
||||||
target_include_directories(libcockatrice_protocol_pb PUBLIC "${PROTOBUF_INCLUDE_DIRS}")
|
target_include_directories(libcockatrice_protocol_pb PUBLIC "${PROTOBUF_INCLUDE_DIRS}")
|
||||||
|
|||||||
Reference in New Issue
Block a user