-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Disable CMake auto find_package+linkage with backend libraries.…
… Only link with gRPC::grpc++ by default now (instead of gRPC::grpc++_unsecure)
- Loading branch information
Showing
6 changed files
with
106 additions
and
137 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,65 +16,22 @@ include("${CMAKE_CURRENT_LIST_DIR}/@[email protected]") | |
include("${CMAKE_CURRENT_LIST_DIR}/AsioGrpcProtobufGenerator.cmake") | ||
|
||
if("${CMAKE_GENERATOR}" STRGREATER_EQUAL "Visual Studio") | ||
target_sources(@PROJECT_NAME@::asio-grpc INTERFACE "${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@.natvis") | ||
target_sources(@PROJECT_NAME@::asio-grpc-standalone-asio | ||
INTERFACE "${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@.natvis") | ||
target_sources(@PROJECT_NAME@::asio-grpc-unifex INTERFACE "${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@.natvis") | ||
target_sources(@PROJECT_NAME@::asio-grpc INTERFACE "${CMAKE_CURRENT_LIST_DIR}/asio-grpc.natvis") | ||
target_sources(@PROJECT_NAME@::asio-grpc-standalone-asio INTERFACE "${CMAKE_CURRENT_LIST_DIR}/asio-grpc.natvis") | ||
target_sources(@PROJECT_NAME@::asio-grpc-unifex INTERFACE "${CMAKE_CURRENT_LIST_DIR}/asio-grpc.natvis") | ||
target_sources(@PROJECT_NAME@::asio-grpc-stdexec INTERFACE "${CMAKE_CURRENT_LIST_DIR}/asio-grpc.natvis") | ||
endif() | ||
|
||
if(ASIO_GRPC_DISABLE_AUTOLINK) | ||
return() | ||
endif() | ||
|
||
unset(ASIO_GRPC_BOOST_ASIO_LINK_LIBRARIES) | ||
unset(ASIO_GRPC_STANDALONE_ASIO_LINK_LIBRARIES) | ||
unset(ASIO_GRPC_UNIFEX_LINK_LIBRARIES) | ||
include(CMakeFindDependencyMacro) | ||
|
||
find_package(Boost QUIET) | ||
if(TARGET "Boost::headers") | ||
list(APPEND ASIO_GRPC_BOOST_ASIO_LINK_LIBRARIES "Boost::headers") | ||
elseif(TARGET "Boost::boost") | ||
list(APPEND ASIO_GRPC_BOOST_ASIO_LINK_LIBRARIES "Boost::boost") | ||
find_dependency(gRPC) | ||
if(TARGET "gRPC::grpc++") | ||
set_target_properties(@PROJECT_NAME@::asio-grpc PROPERTIES INTERFACE_LINK_LIBRARIES "gRPC::grpc++") | ||
set_target_properties(@PROJECT_NAME@::asio-grpc-standalone-asio PROPERTIES INTERFACE_LINK_LIBRARIES "gRPC::grpc++") | ||
set_target_properties(@PROJECT_NAME@::asio-grpc-unifex PROPERTIES INTERFACE_LINK_LIBRARIES "gRPC::grpc++") | ||
set_target_properties(@PROJECT_NAME@::asio-grpc-stdexec PROPERTIES INTERFACE_LINK_LIBRARIES "gRPC::grpc++") | ||
endif() | ||
|
||
find_package(gRPC QUIET) | ||
if(TARGET "gRPC::grpc++_unsecure") | ||
list(APPEND ASIO_GRPC_BOOST_ASIO_LINK_LIBRARIES "gRPC::grpc++_unsecure") | ||
list(APPEND ASIO_GRPC_STANDALONE_ASIO_LINK_LIBRARIES "gRPC::grpc++_unsecure") | ||
list(APPEND ASIO_GRPC_UNIFEX_LINK_LIBRARIES "gRPC::grpc++_unsecure") | ||
elseif(TARGET "gRPC::grpc++") | ||
list(APPEND ASIO_GRPC_BOOST_ASIO_LINK_LIBRARIES "gRPC::grpc++") | ||
list(APPEND ASIO_GRPC_STANDALONE_ASIO_LINK_LIBRARIES "gRPC::grpc++") | ||
list(APPEND ASIO_GRPC_UNIFEX_LINK_LIBRARIES "gRPC::grpc++") | ||
endif() | ||
|
||
find_package(asio QUIET) | ||
if(TARGET "asio::asio") | ||
list(APPEND ASIO_GRPC_STANDALONE_ASIO_LINK_LIBRARIES "asio::asio") | ||
elseif(TARGET "asio::asio_headeronly") | ||
list(APPEND ASIO_GRPC_STANDALONE_ASIO_LINK_LIBRARIES "asio::asio_headeronly") | ||
endif() | ||
|
||
find_package(unifex QUIET) | ||
if(TARGET "unifex::unifex") | ||
list(APPEND ASIO_GRPC_UNIFEX_LINK_LIBRARIES "unifex::unifex") | ||
elseif(TARGET "unofficial::unifex") | ||
list(APPEND ASIO_GRPC_UNIFEX_LINK_LIBRARIES "unofficial::unifex") | ||
endif() | ||
|
||
if(DEFINED ASIO_GRPC_BOOST_ASIO_LINK_LIBRARIES) | ||
set_target_properties(@PROJECT_NAME@::asio-grpc PROPERTIES INTERFACE_LINK_LIBRARIES | ||
"${ASIO_GRPC_BOOST_ASIO_LINK_LIBRARIES}") | ||
endif() | ||
if(DEFINED ASIO_GRPC_STANDALONE_ASIO_LINK_LIBRARIES) | ||
set_target_properties(@PROJECT_NAME@::asio-grpc-standalone-asio | ||
PROPERTIES INTERFACE_LINK_LIBRARIES "${ASIO_GRPC_STANDALONE_ASIO_LINK_LIBRARIES}") | ||
endif() | ||
if(DEFINED ASIO_GRPC_UNIFEX_LINK_LIBRARIES) | ||
set_target_properties(@PROJECT_NAME@::asio-grpc-unifex PROPERTIES INTERFACE_LINK_LIBRARIES | ||
"${ASIO_GRPC_UNIFEX_LINK_LIBRARIES}") | ||
endif() | ||
|
||
unset(ASIO_GRPC_BOOST_ASIO_LINK_LIBRARIES) | ||
unset(ASIO_GRPC_STANDALONE_ASIO_LINK_LIBRARIES) | ||
unset(ASIO_GRPC_UNIFEX_LINK_LIBRARIES) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters