Skip to content

Commit

Permalink
Patches for building on AIX
Browse files Browse the repository at this point in the history
  • Loading branch information
tjcw committed Nov 5, 2024
1 parent d16f781 commit 7510860
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 1 deletion.
7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,13 @@ else()
elseif(CMAKE_SIZEOF_VOID_P EQUAL 4)
set(ARCH x86)
endif()
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "powerpc")
# AIX will report the processor as 'powerpc' even if building in 64-bit mode
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(ARCH ppc64)
else()
set(ARCH ppc32)
endif()
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES
"^(aarch64.*|AARCH64.*|arm64.*|ARM64.*)")
set(ARCH arm64)
Expand Down
3 changes: 2 additions & 1 deletion cmake/opentelemetry-proto.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,8 @@ if(WITH_OTLP_GRPC)
target_link_libraries(opentelemetry_proto_grpc PUBLIC opentelemetry_proto)

get_target_property(grpc_lib_type gRPC::grpc++ TYPE)
if(grpc_lib_type STREQUAL "SHARED_LIBRARY")
get_target_property(opentelemetry_proto_grpc_lib_type opentelemetry_proto_grpc TYPE)
if ((grpc_lib_type STREQUAL "SHARED_LIBRARY") OR (opentelemetry_proto_grpc_lib_type STREQUAL "SHARED_LIBRARY"))
target_link_libraries(opentelemetry_proto_grpc PUBLIC gRPC::grpc++)
endif()
set_target_properties(opentelemetry_proto_grpc PROPERTIES EXPORT_NAME
Expand Down
4 changes: 4 additions & 0 deletions cmake/tools.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,10 @@ function(project_build_tools_patch_default_imported_config)
if(IS_ALIAS_TARGET)
continue()
endif()
get_target_property(IS_ALIASED_TARGET ${TARGET_NAME} ALIASED_TARGET)
if (IS_ALIASED_TARGET)
continue()
endif()

if(CMAKE_VERSION VERSION_LESS "3.19.0")
get_target_property(TARGET_TYPE_NAME ${TARGET_NAME} TYPE)
Expand Down
13 changes: 13 additions & 0 deletions sdk/include/opentelemetry/sdk/resource/semantic_conventions.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,19 @@
#include "opentelemetry/common/macros.h"
#include "opentelemetry/version.h"

/*
* Special considerations for HostArchValues
*
* The sys/systemcfg.h header on AIX is known to define an IA64 macro,
* which collides with HostArchValues::IA64.
*/
#ifdef _AIX
# ifdef IA64
# pragma message "Removing define on IA64"
# undef IA64
# endif
#endif

OPENTELEMETRY_BEGIN_NAMESPACE
namespace sdk
{
Expand Down

0 comments on commit 7510860

Please sign in to comment.