Skip to content

Commit

Permalink
Fix issues #740 and #741 (#742)
Browse files Browse the repository at this point in the history
  • Loading branch information
owent authored May 14, 2021
1 parent 414a731 commit 0d94c01
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 5 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ endif()

if(WITH_STL)
# Require at least C++17. C++20 is needed to avoid gsl::span
add_definitions(-DHAVE_CPP_STDLIB -DHAVE_GSL)

if(CMAKE_MINOR_VERSION VERSION_GREATER "3.18")
# Ask for 20, may get anything below
set(CMAKE_CXX_STANDARD 20)
Expand Down Expand Up @@ -130,7 +128,7 @@ if(WITH_OTLP)
set(protobuf_MODULE_COMPATIBLE ON)
find_package(Protobuf)
find_package(gRPC)
if((NOT protobuf_FOUND) OR (NOT gRPC_FOUND))
if((NOT Protobuf_FOUND AND NOT PROTOBUF_FOUND) OR (NOT gRPC_FOUND))
if(WIN32 AND (NOT DEFINED CMAKE_TOOLCHAIN_FILE))
install_windows_deps()
endif()
Expand All @@ -142,7 +140,7 @@ if(WITH_OTLP)
include(${CMAKE_TOOLCHAIN_FILE})
endif()

if(NOT protobuf_FOUND)
if(NOT Protobuf_FOUND AND NOT PROTOBUF_FOUND)
find_package(Protobuf REQUIRED)
endif()
if(NOT gRPC_FOUND)
Expand All @@ -157,7 +155,9 @@ if(WITH_OTLP)
endif()
endif()
# Latest Protobuf uses mixed case instead of uppercase
set(PROTOBUF_PROTOC_EXECUTABLE ${Protobuf_PROTOC_EXECUTABLE})
if(Protobuf_PROTOC_EXECUTABLE)
set(PROTOBUF_PROTOC_EXECUTABLE ${Protobuf_PROTOC_EXECUTABLE})
endif()
endif()
message("PROTOBUF_PROTOC_EXECUTABLE=${PROTOBUF_PROTOC_EXECUTABLE}")

Expand Down
2 changes: 2 additions & 0 deletions api/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ endif()

if(WITH_STL)
message("Building with standard library types...")
target_compile_definitions(opentelemetry_api INTERFACE HAVE_CPP_STDLIB
HAVE_GSL)
else()
message("Building with nostd types...")
endif()

0 comments on commit 0d94c01

Please sign in to comment.