Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUILD] Skip patch alias target #2457

Merged
merged 9 commits into from
Jan 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions cmake/patch-imported-config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,11 @@ if(TARGET c-ares::cares)
endif()

# curl targets
if(TARGET CURL::libcurl)
project_build_tools_patch_default_imported_config(CURL::libcurl)
if(TARGET CURL::libcurl
OR TARGET CURL::libcurl_static
OR TARGET CURL::libcurl_shared)
project_build_tools_patch_default_imported_config(
CURL::libcurl CURL::libcurl_static CURL::libcurl_shared)
endif()

# abseil targets
Expand Down
16 changes: 15 additions & 1 deletion cmake/tools.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,16 @@ endmacro()
if(NOT PATCH_PROTOBUF_SOURCES_OPTIONS_SET)
if(MSVC)
unset(PATCH_PROTOBUF_SOURCES_OPTIONS CACHE)
set(PATCH_PROTOBUF_SOURCES_OPTIONS /wd4244 /wd4251 /wd4267 /wd4309 /wd4668 /wd4946 /wd6001 /wd6244 /wd6246)
set(PATCH_PROTOBUF_SOURCES_OPTIONS
/wd4244
/wd4251
/wd4267
/wd4309
/wd4668
/wd4946
/wd6001
/wd6244
/wd6246)

if(MSVC_VERSION GREATER_EQUAL 1922)
# see
Expand Down Expand Up @@ -147,6 +156,11 @@ function(project_build_tools_patch_default_imported_config)
continue()
endif()

get_target_property(IS_ALIAS_TARGET ${TARGET_NAME} ALIASED_TARGET)
if(IS_ALIAS_TARGET)
continue()
endif()

if(CMAKE_VERSION VERSION_LESS "3.19.0")
get_target_property(TARGET_TYPE_NAME ${TARGET_NAME} TYPE)
if(TARGET_TYPE_NAME STREQUAL "INTERFACE_LIBRARY")
Expand Down
Loading