-
Notifications
You must be signed in to change notification settings - Fork 446
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
Allow building as a header-only library with CMake #751
Comments
That would be a common scenario, and it would make sense to support building only the |
@lidavidm Solution suggested by you looks good - basically adding cmake options to enable/disable building projects selectively. Or just to add |
@lalitb Sorry for the delay - I would like to but I'm still working with my org to make sure I can sign the CLA. I'm hoping that'll be in the next couple days, else someone else can of course take a look. |
Thank you @lidavidm for your willingness to contribute. There is no immediate hurry, you can pick it up once CLA is signed :) |
This enables easily building/using OpenTelemetry as a header-only library. When enabled, SDK/EXT/examples are not built. Fixes open-telemetry#751
I'm working on integrating OpenTelemetry in a CMake-based project using ExternalProject. I want my project to be able to use OpenTelemetry as a header-only library, using just
api/
, or optionally directly linking to OpenTelemetry (libopentelemetry_trace etc). In the former case, I'd like to not build any of the static libraries to save build time, however, there's not a good way to do this.Is your feature request related to a problem?
No
Describe the solution you'd like
Being able to disable the build of the ext/sdk/exporters subprojects would be ideal, e.g.
-DWITH_SDK=OFF -DWITH_EXT=OFF -DWITH_EXPORTERS=OFF
.Describe alternatives you've considered
CMake kind of lets you do something like this:
However, that
--target
is specific to the Ninja CMake generator - if you're using Makefiles, it instead has to be--build <BINARY_DIR>/api --target install
not--build <BINARY_DIR> --target api/install
. Trying to embed all this logic is brittle and I'd rather have the option to configure the build itself. Is this reasonable?Additional context
N/A
The text was updated successfully, but these errors were encountered: