mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-14 19:18:55 -07:00
Add cmake format (#4618)
* Support CMakeify operation * Run Cmakeify * Update cmakeify.sh Co-authored-by: ebbit1q <ebbit1q@gmail.com>
This commit is contained in:
parent
3e90f109a2
commit
a95b338c80
20 changed files with 1132 additions and 815 deletions
|
|
@ -2,7 +2,7 @@
|
|||
#
|
||||
# provides the protobuf interfaces
|
||||
|
||||
SET(PROTO_FILES
|
||||
set(PROTO_FILES
|
||||
admin_commands.proto
|
||||
card_attributes.proto
|
||||
color.proto
|
||||
|
|
@ -162,21 +162,21 @@ SET(PROTO_FILES
|
|||
|
||||
include_directories(${PROTOBUF_INCLUDE_DIRS})
|
||||
include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
||||
PROTOBUF_GENERATE_CPP(PROTO_SRCS PROTO_HDRS ${PROTO_FILES})
|
||||
protobuf_generate_cpp(PROTO_SRCS PROTO_HDRS ${PROTO_FILES})
|
||||
|
||||
add_library(cockatrice_protocol ${PROTO_SRCS} ${PROTO_HDRS})
|
||||
set(cockatrice_protocol_LIBS ${PROTOBUF_LIBRARIES})
|
||||
if (UNIX)
|
||||
set(cockatrice_protocol_LIBS ${cockatrice_protocol_LIBS} -lpthread)
|
||||
endif (UNIX)
|
||||
if(UNIX)
|
||||
set(cockatrice_protocol_LIBS ${cockatrice_protocol_LIBS} -lpthread)
|
||||
endif(UNIX)
|
||||
target_link_libraries(cockatrice_protocol ${cockatrice_protocol_LIBS})
|
||||
|
||||
# ubuntu uses an outdated package for protobuf, 3.1.0 is required
|
||||
if(${Protobuf_VERSION} VERSION_LESS "3.1.0")
|
||||
# remove unused parameter and misleading indentation warnings when compiling to avoid errors
|
||||
set(CMAKE_CXX_FLAGS_DEBUG
|
||||
"${CMAKE_CXX_FLAGS_DEBUG} -Wno-unused-parameter -Wno-misleading-indentation")
|
||||
message(WARNING "Older protobuf version found (${Protobuf_VERSION} < 3.1.0), "
|
||||
"disabled the warnings 'unused-parameter' and 'misleading-indentation' for protobuf generated code "
|
||||
"to avoid compilation errors.")
|
||||
# remove unused parameter and misleading indentation warnings when compiling to avoid errors
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wno-unused-parameter -Wno-misleading-indentation")
|
||||
message(WARNING "Older protobuf version found (${Protobuf_VERSION} < 3.1.0), "
|
||||
"disabled the warnings 'unused-parameter' and 'misleading-indentation' for protobuf generated code "
|
||||
"to avoid compilation errors."
|
||||
)
|
||||
endif()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue