@@ -25,28 +25,6 @@ else()
25
25
set (VCPKG_PREFIX ${CMAKE_BINARY_DIR} /vcpkg )
26
26
endif ()
27
27
28
- # Define custom triplets for vcpkg
29
- if (APPLE )
30
- # On Mac, there is a conflict between libcurl and the version in MATLAB, so
31
- # use libcurl as a shared library and load the MATLAB version at runtime
32
- # run uname -m to determine whether arm64 or x86_64
33
- exec_program (uname ARGS -m OUTPUT_VARIABLE MAC_HOST_SYSTEM )
34
- set (VCPKG_OTEL_TRIPLET ${MAC_HOST_SYSTEM} -osx-otel-matlab )
35
- set (VCPKG_OVERLAY_TRIPLETS ${CMAKE_SOURCE_DIR} /cmake/vcpkg_triplets )
36
- set (VCPKG_TARGET_TRIPLET ${VCPKG_OTEL_TRIPLET} )
37
- set (TRIPLET_DEFINITIONS -DVCPKG_OVERLAY_TRIPLETS= "${VCPKG_OVERLAY_TRIPLETS} " -DVCPKG_TARGET_TRIPLET=${VCPKG_TARGET_TRIPLET} )
38
- elseif (WIN32 )
39
- # On Windows, we use a custom triplet to work around two issues.
40
- # First, there is a conflict between abseil_dll.dll and the version used by Simulink.
41
- # The shared library doesn't seem ABI stable and different versions cannot be used interchangeably.
42
- # To sidestep the problem, use static library.
43
- # Second, define a preprocessor macro _DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR to work around an invalid MEX file issue on GitHub
44
- # See https://github.com/mathworks/OpenTelemetry-Matlab/issues/130
45
- set (VCPKG_OVERLAY_TRIPLETS ${CMAKE_SOURCE_DIR} /cmake/vcpkg_triplets )
46
- set (VCPKG_TARGET_TRIPLET x64-windows-otel-matlab )
47
- set (TRIPLET_DEFINITIONS -DVCPKG_OVERLAY_TRIPLETS= "${VCPKG_OVERLAY_TRIPLETS} " -DVCPKG_TARGET_TRIPLET=${VCPKG_TARGET_TRIPLET} )
48
- endif ()
49
-
50
28
set (VCPKG_FETCH_CONTENT_NAME vcpkg )
51
29
set (VCPKG_GIT_REPOSITORY "https://github.com/microsoft/vcpkg.git" )
52
30
set (VCPKG_GIT_TAG "fba75d0" )
@@ -71,6 +49,28 @@ if(NOT DEFINED VCPKG_INSTALLED_DIR)
71
49
set (VCPKG_INSTALLED_DIR ${CMAKE_BINARY_DIR} /vcpkg_installed )
72
50
endif ()
73
51
52
+ # Define custom triplets for vcpkg
53
+ if (APPLE )
54
+ # On Mac, there is a conflict between libcurl and the version in MATLAB, so
55
+ # use libcurl as a shared library and load the MATLAB version at runtime
56
+ # run uname -m to determine whether arm64 or x86_64
57
+ exec_program (uname ARGS -m OUTPUT_VARIABLE MAC_HOST_SYSTEM )
58
+ set (VCPKG_OTEL_TRIPLET ${MAC_HOST_SYSTEM} -osx-otel-matlab )
59
+ set (VCPKG_OVERLAY_TRIPLETS ${CMAKE_SOURCE_DIR} /cmake/vcpkg_triplets )
60
+ set (VCPKG_TARGET_TRIPLET ${VCPKG_OTEL_TRIPLET} )
61
+ set (TRIPLET_DEFINITIONS -DVCPKG_OVERLAY_TRIPLETS= "${VCPKG_OVERLAY_TRIPLETS} " -DVCPKG_TARGET_TRIPLET=${VCPKG_TARGET_TRIPLET} )
62
+ elseif (WIN32 )
63
+ # On Windows, we use a custom triplet to work around two issues.
64
+ # First, there is a conflict between abseil_dll.dll and the version used by Simulink.
65
+ # The shared library doesn't seem ABI stable and different versions cannot be used interchangeably.
66
+ # To sidestep the problem, use static library.
67
+ # Second, define a preprocessor macro _DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR to work around an invalid MEX file issue on GitHub
68
+ # See https://github.com/mathworks/OpenTelemetry-Matlab/issues/130
69
+ set (VCPKG_OVERLAY_TRIPLETS ${CMAKE_SOURCE_DIR} /cmake/vcpkg_triplets )
70
+ set (VCPKG_TARGET_TRIPLET x64-windows-otel-matlab )
71
+ set (TRIPLET_DEFINITIONS -DVCPKG_OVERLAY_TRIPLETS= "${VCPKG_OVERLAY_TRIPLETS} " -DVCPKG_TARGET_TRIPLET=${VCPKG_TARGET_TRIPLET} )
72
+ endif ()
73
+
74
74
# ######################################
75
75
# Options
76
76
# ######################################
0 commit comments