Skip to content

Commit

Permalink
build cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
marcalff committed Sep 11, 2023
1 parent 90bfdbb commit 14bccb5
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,9 @@ endif()

option(WITH_NO_DEPRECATED_CODE "Do not include deprecated code" OFF)

set(WITH_STL "OFF" CACHE STRING "Which version of the Standard Library for C++ to use")
set(WITH_STL
"OFF"
CACHE STRING "Which version of the Standard Library for C++ to use")

option(WITH_GSL
"Whether to use Guidelines Support Library for C++ latest features" OFF)
Expand Down
18 changes: 12 additions & 6 deletions api/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,23 +53,29 @@ endif()

if(WITH_STL STREQUAL "OFF")
message(STATUS "Building WITH_STL=OFF")
target_compile_definitions(opentelemetry_api INTERFACE OPENTELEMETRY_STL_VERSION=0)
target_compile_definitions(opentelemetry_api
INTERFACE OPENTELEMETRY_STL_VERSION=0)
elseif(WITH_STL STREQUAL "CXX11")
message(STATUS "Building WITH_STL=CXX1")
target_compile_definitions(opentelemetry_api INTERFACE OPENTELEMETRY_STL_VERSION=2011)
target_compile_definitions(opentelemetry_api
INTERFACE OPENTELEMETRY_STL_VERSION=2011)
elseif(WITH_STL STREQUAL "CXX14")
message(STATUS "Building WITH_STL=CXX14")
target_compile_definitions(opentelemetry_api INTERFACE OPENTELEMETRY_STL_VERSION=2014)
target_compile_definitions(opentelemetry_api
INTERFACE OPENTELEMETRY_STL_VERSION=2014)
elseif(WITH_STL STREQUAL "CXX17")
message(STATUS "Building WITH_STL=CXX17")
target_compile_definitions(opentelemetry_api INTERFACE OPENTELEMETRY_STL_VERSION=2017)
target_compile_definitions(opentelemetry_api
INTERFACE OPENTELEMETRY_STL_VERSION=2017)
elseif(WITH_STL STREQUAL "CXX20")
message(STATUS "Building WITH_STL=CXX20")
target_compile_definitions(opentelemetry_api INTERFACE OPENTELEMETRY_STL_VERSION=2020)
target_compile_definitions(opentelemetry_api
INTERFACE OPENTELEMETRY_STL_VERSION=2020)
elseif(WITH_STL STREQUAL "ON")
message(STATUS "Building WITH_STL=ON")
# "ON" corresponds to "CXX20" at this time.
target_compile_definitions(opentelemetry_api INTERFACE OPENTELEMETRY_STL_VERSION=2020)
target_compile_definitions(opentelemetry_api
INTERFACE OPENTELEMETRY_STL_VERSION=2020)
else()
message(FATAL_ERROR "WITH_STL must be ON, OFF, CXX11, CXX14, CXX17 or CXX20")
endif()
Expand Down
2 changes: 1 addition & 1 deletion ext/test/http/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ endif()
set(URL_PARSER_FILENAME url_parser_test)
add_executable(${URL_PARSER_FILENAME} ${URL_PARSER_FILENAME}.cc)
target_link_libraries(${URL_PARSER_FILENAME} ${GTEST_BOTH_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT})
${CMAKE_THREAD_LIBS_INIT} opentelemetry_api)
gtest_add_tests(
TARGET ${URL_PARSER_FILENAME}
TEST_PREFIX ext.http.urlparser.
Expand Down

0 comments on commit 14bccb5

Please sign in to comment.