Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add WITH_API_ONLY CMake option #778

Merged
merged 5 commits into from
May 21, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 15 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ if(WIN32)
endif(WITH_ETW)
endif(WIN32)

option(WITH_API_ONLY
"Only build the API (use as a header-only library). Overrides WITH_EXAMPLES"
OFF)
option(WITH_EXAMPLES "Whether to build examples" ON)

option(WITH_METRICS_PREVIEW "Whether to build metrics preview" OFF)
Expand Down Expand Up @@ -206,17 +209,21 @@ endif()
include(CMakePackageConfigHelpers)

include_directories(api/include)
include_directories(sdk/include)
include_directories(sdk)
include_directories(ext/include)

add_subdirectory(api)
add_subdirectory(sdk)
add_subdirectory(exporters)
if(WITH_EXAMPLES)
add_subdirectory(examples)

if(NOT WITH_API_ONLY)
include_directories(sdk/include)
include_directories(sdk)
include_directories(ext/include)

add_subdirectory(sdk)
add_subdirectory(exporters)
if (WITH_EXAMPLES)
add_subdirectory(examples)
endif()
add_subdirectory(ext)
endif()
add_subdirectory(ext)

# Add nlohmann/json submodule to include directories
include_directories(third_party/nlohmann-json/single_include)
Expand Down