Skip to content

Commit 2516f6d

Browse files
committed
add custom triplet to vcpkg on Mac
1 parent 55ddd9a commit 2516f6d

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

CMakeLists.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,16 @@ else()
2525
set(VCPKG_PREFIX ${CMAKE_BINARY_DIR}/vcpkg)
2626
endif()
2727

28+
# On Mac, there is a conflict between libcurl and the version in MATLAB, so
29+
# use libcurl as a shared library and load the MATLAB version at runtime
30+
if(APPLE)
31+
# run uname -m to determine whether arm64 or x86_64
32+
exec_program(uname ARGS -m OUTPUT_VARIABLE MAC_HOST_SYSTEM)
33+
set(VCPKG_OTEL_TRIPLET ${MAC_HOST_SYSTEM}-osx-otel-matlab)
34+
set(VCPKG_OVERLAY_TRIPLETS ${CMAKE_SOURCE_DIR}/cmake/vcpkg_triplets)
35+
set(VCPKG_TARGET_TRIPLET ${VCPKG_OTEL_TRIPLET})
36+
endif()
37+
2838
set(VCPKG_FETCH_CONTENT_NAME vcpkg)
2939
set(VCPKG_GIT_REPOSITORY "https://github.com/microsoft/vcpkg.git")
3040
set(VCPKG_GIT_TAG "9edb1b8")

vcpkg.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@
33
"$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json",
44
"dependencies": [
55
"protobuf",
6-
"zlib"
6+
"zlib",
7+
"nlohmann-json"
78
],
89
"features": {
9-
"otlp-http": {"description": "Otlp HTTP Exporter", "dependencies": ["curl", "nlohmann-json"]},
10+
"otlp-http": {"description": "Otlp HTTP Exporter", "dependencies": ["curl"]},
1011
"otlp-grpc": {"description": "Otlp gRPC Exporter", "dependencies": ["grpc", "abseil", "c-ares", "re2", "openssl", "upb"]}
1112
}
1213
}

0 commit comments

Comments
 (0)