Skip to content

Commit

Permalink
fix double declaration of protobuf and construction of the binary
Browse files Browse the repository at this point in the history
the link of the binary was reduced to a single line as it is more practical to reduce the number of lines and also to avoid the link_target so many times.
  • Loading branch information
sodomon2 authored and mkckr0 committed Apr 11, 2024
1 parent 41b6125 commit 60286ea
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions server-core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
set(PLATFORM_NAME "linux")
endif()

message(STATUS "PLATFORMA_NAME ${PLATFORM_NAME}")
message(STATUS "PLATFORM_NAME ${PLATFORM_NAME}")

find_package(Protobuf CONFIG REQUIRED)
include_directories(${CMAKE_CURRENT_BINARY_DIR})
Expand All @@ -47,16 +47,9 @@ if(UNIX)
endif(UNIX)

find_package(asio CONFIG REQUIRED)
target_link_libraries(server-cmd PRIVATE asio::asio)

find_package(spdlog CONFIG REQUIRED)
target_link_libraries(server-cmd PRIVATE spdlog::spdlog)

find_package(Protobuf CONFIG REQUIRED)
target_link_libraries(server-cmd PRIVATE protobuf::libprotobuf)

find_package(cxxopts CONFIG REQUIRED)
target_link_libraries(server-cmd PRIVATE cxxopts::cxxopts)
target_link_libraries(server-cmd PRIVATE asio::asio spdlog::spdlog protobuf::libprotobuf cxxopts::cxxopts)

if(${PLATFORM_NAME} STREQUAL "linux")
find_package(PkgConfig REQUIRED)
Expand Down

0 comments on commit 60286ea

Please sign in to comment.