Skip to content

Commit

Permalink
[BUILD] Skip patch alias target (open-telemetry#2457)
Browse files Browse the repository at this point in the history
  • Loading branch information
owent authored Jan 8, 2024
1 parent f084fbc commit c4f39f2
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
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

0 comments on commit c4f39f2

Please sign in to comment.