Skip to content

Commit aaa2949

Browse files
committed
ninja build
1 parent 617b790 commit aaa2949

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

.github/workflows/build_and_test.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ jobs:
2222
with:
2323
products: MATLAB_Compiler
2424
- name: Build OpenTelemetry-Matlab
25+
working-directory: opentelemetry-matlab
2526
run: |
26-
cd opentelemetry-matlab
2727
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DWITH_EXAMPLES=ON -DCMAKE_INSTALL_PREFIX=${{ env.OPENTELEMETRY_MATLAB_INSTALL }}
2828
cmake --build build --config Release --target install
2929
- name: Run tests
@@ -48,9 +48,10 @@ jobs:
4848
with:
4949
products: MATLAB_Compiler
5050
- name: Build OpenTelemetry-Matlab
51+
working-directory: opentelemetry-matlab
5152
run: |
52-
cd opentelemetry-matlab
53-
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${{ env.OPENTELEMETRY_MATLAB_INSTALL }}
53+
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
54+
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${{ env.OPENTELEMETRY_MATLAB_INSTALL }}
5455
cmake --build build --config Release --target install
5556
- name: Run tests
5657
env:
@@ -76,8 +77,8 @@ jobs:
7677
with:
7778
products: MATLAB_Compiler
7879
- name: Build OpenTelemetry-Matlab
80+
working-directory: opentelemetry-matlab
7981
run: |
80-
cd opentelemetry-matlab
8182
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DWITH_EXAMPLES=ON -DCMAKE_INSTALL_PREFIX=${{ env.OPENTELEMETRY_MATLAB_INSTALL }}
8283
cmake --build build --config Release --target install
8384
- name: Run tests

CMakeLists.txt

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -124,14 +124,17 @@ FetchContent_MakeAvailable(
124124

125125
# Determine OTEL_CPP_PREFIX
126126
if(DEFINED OTEL_CPP_INSTALLED_DIR)
127-
# OTEL_CPP_INSTALLED_DIR should point to an installed location of OpenTelemetry-cpp
127+
# Set OTEL_CPP_INSTALLED_DIR to use a pre-installed OpenTelemetry-cpp
128+
# It should point to the installed location
128129
string(REPLACE "\\" "/" OTEL_CPP_PREFIX ${OTEL_CPP_INSTALLED_DIR})
130+
elseif(DEFINED OTEL_CPP_PREFIX)
131+
# Set OTEL_CPP_PREFIX to specify an install location of the automatically
132+
# downloaded and built OpenTelemetry-cpp, instead of using the default
133+
# location with the build directory. This can preserve the OpenTelemetry-cpp
134+
# install even if the build directory is removed.
135+
string(REPLACE "\\" "/" OTEL_CPP_PREFIX ${OTEL_CPP_PREFIX})
129136
else()
130-
if(DEFINED OTEL_CPP_PREFIX)
131-
string(REPLACE "\\" "/" OTEL_CPP_PREFIX ${OTEL_CPP_PREFIX})
132-
else()
133-
set(OTEL_CPP_PREFIX ${CMAKE_BINARY_DIR}/otel-cpp)
134-
endif()
137+
set(OTEL_CPP_PREFIX ${CMAKE_BINARY_DIR}/otel-cpp)
135138
endif()
136139

137140
if(WIN32)

0 commit comments

Comments
 (0)