Skip to content

Commit 1e942a2

Browse files
committed
fix a abseil build failure on Windows in GitHub
1 parent 390eb73 commit 1e942a2

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

.github/workflows/build_and_test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656
shell: cmd
5757
run: |
5858
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
59-
cmake -S . -B build -G Ninja -DCMAKE_CXX_COMPILER="cl.exe" -DCMAKE_C_COMPILER="cl.exe" -DCMAKE_BUILD_TYPE=Release -DWITH_EXAMPLES=ON -DWITH_OTLP_GRPC=ON -DUSE_BATCH_FOR_MCC=ON -DCMAKE_INSTALL_PREFIX=${{ env.OPENTELEMETRY_MATLAB_INSTALL }}
59+
cmake -S . -B build -G Ninja -DCMAKE_CXX_COMPILER="cl.exe" -DCMAKE_C_COMPILER="cl.exe" -DCMAKE_BUILD_TYPE=Release -DWITH_EXAMPLES=ON -DWITH_OTLP_GRPC=ON -DUSE_BATCH_FOR_MCC=ON -DFETCH_VCPKG -DCMAKE_INSTALL_PREFIX=${{ env.OPENTELEMETRY_MATLAB_INSTALL }}
6060
cmake --build build --config Release --target install
6161
- name: Run tests
6262
env:

.github/workflows/publish_mltbx.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ jobs:
5454
shell: cmd
5555
run: |
5656
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
57-
cmake -S . -B build -G Ninja -DCMAKE_CXX_COMPILER="cl.exe" -DCMAKE_C_COMPILER="cl.exe" -DCMAKE_BUILD_TYPE=Release -DWITH_OTLP_GRPC=ON -DCMAKE_INSTALL_PREFIX=${{ env.OPENTELEMETRY_MATLAB_INSTALL }}
57+
cmake -S . -B build -G Ninja -DCMAKE_CXX_COMPILER="cl.exe" -DCMAKE_C_COMPILER="cl.exe" -DCMAKE_BUILD_TYPE=Release -DWITH_OTLP_GRPC=ON -DFETCH_VCPKG -DCMAKE_INSTALL_PREFIX=${{ env.OPENTELEMETRY_MATLAB_INSTALL }}
5858
cmake --build build --config Release --target install
5959
- name: Compress into single artifact
6060
working-directory: ${{ github.workspace }}

CMakeLists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,16 @@ cmake_policy(SET CMP0074 NEW)
1010
include(FetchContent)
1111

1212
# check if VCPKG_ROOT is defined, which should point to an existing installation
13-
if(DEFINED ENV{VCPKG_ROOT})
13+
# FETCH_VCPKG is a switch that can be defined to ignore VCPKG_ROOT
14+
if(DEFINED ENV{VCPKG_ROOT} AND NOT DEFINED FETCH_VCPKG)
1415
# Autodetect vcpkg toolchain
1516
if(NOT DEFINED CMAKE_TOOLCHAIN_FILE)
1617
string(REPLACE "\\" "/" CMAKE_TOOLCHAIN_FILE "$ENV{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake")
1718
endif()
1819
else()
1920
# VCPKG_ROOT not defined, get it using FetchContent
2021

21-
if(DEFINED VCPKG_PREFIX})
22+
if(DEFINED VCPKG_PREFIX)
2223
# download location specified
2324
string(REPLACE "\\" "/" VCPKG_PREFIX "${VCPKG_PREFIX}")
2425
else()

0 commit comments

Comments
 (0)