Skip to content

Commit 1f31341

Browse files
authored
Allow to use local GSL (#915)
1 parent 950f940 commit 1f31341

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ Increment the:
1515

1616
## [Unreleased]
1717

18+
* [BUILD] Allow to use local GSL
19+
1820
## [1.0.0-rc3] 2021-07-12
1921

2022
* [DOCS] Add doxygen reference docs for SDK ([#902](https://github.com/open-telemetry/opentelemetry-cpp/pull/902))

CMakeLists.txt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,13 @@ if(WITH_STL)
118118
# Guidelines Support Library path. Used if we are not on not get C++20.
119119
#
120120
# TODO: respect WITH_ABSEIL as alternate implementation of std::span
121-
set(GSL_DIR third_party/ms-gsl)
122-
include_directories(${GSL_DIR}/include)
121+
find_package(Microsoft.GSL QUIET)
122+
if(TARGET Microsoft.GSL::GSL)
123+
list(APPEND CORE_RUNTIME_LIBS Microsoft.GSL::GSL)
124+
else()
125+
set(GSL_DIR third_party/ms-gsl)
126+
include_directories(${GSL_DIR}/include)
127+
endif()
123128

124129
# Optimize for speed to reduce the hops
125130
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")

0 commit comments

Comments
 (0)