mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-14 22:42:14 -07:00
Finally, CMake linting.
Took 11 minutes Took 4 minutes
This commit is contained in:
parent
ecfcc078c4
commit
33cd0098f8
16 changed files with 302 additions and 311 deletions
|
|
@ -2,16 +2,15 @@
|
|||
|
||||
add_subdirectory(pb)
|
||||
|
||||
add_library(cockatrice_protocol_wrapper STATIC
|
||||
# Optionally, you can add a dummy source if needed
|
||||
add_library(
|
||||
cockatrice_protocol_wrapper STATIC
|
||||
# Optionally, you can add a dummy source if needed
|
||||
)
|
||||
|
||||
# Link the actual generated protobuf library
|
||||
target_link_libraries(cockatrice_protocol_wrapper
|
||||
PUBLIC cockatrice_protocol
|
||||
)
|
||||
target_link_libraries(cockatrice_protocol_wrapper PUBLIC cockatrice_protocol)
|
||||
|
||||
# Expose the pb/ folder so consumers can do #include "pb/header.pb.h"
|
||||
target_include_directories(cockatrice_protocol_wrapper
|
||||
PUBLIC ${CMAKE_CURRENT_BINARY_DIR} # points to the generated headers
|
||||
target_include_directories(
|
||||
cockatrice_protocol_wrapper PUBLIC ${CMAKE_CURRENT_BINARY_DIR} # points to the generated headers
|
||||
)
|
||||
|
|
|
|||
|
|
@ -183,8 +183,8 @@ if(${Protobuf_VERSION} VERSION_LESS "3.21.0.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."
|
||||
"disabled the warnings 'unused-parameter' and 'misleading-indentation' for protobuf generated code "
|
||||
"to avoid compilation errors."
|
||||
)
|
||||
endif()
|
||||
else()
|
||||
|
|
@ -194,6 +194,6 @@ else()
|
|||
target_include_directories(cockatrice_protocol PUBLIC "${PROTOBUF_INCLUDE_DIRS}")
|
||||
|
||||
protobuf_generate(
|
||||
TARGET cockatrice_protocol IMPORT_DIRS "${CMAKE_CURRENT_LIST_DIR}" PROTOC_OUT_DIR "${PROTO_BINARY_DIR}"
|
||||
TARGET cockatrice_protocol IMPORT_DIRS "${CMAKE_CURRENT_LIST_DIR}" PROTOC_OUT_DIR "${PROTO_BINARY_DIR}"
|
||||
)
|
||||
endif()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue