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

[BUILD] Fix if check on environment variable and add CMake variable #2207

Merged
merged 1 commit into from
Jun 29, 2023

Conversation

ThomsonTan
Copy link
Contributor

Fixes #2206

Changes

Fix the environment variable check, and also check if the same name (OPENTELEMETRY_EXTERNAL_COMPONENT_PATH) is defined as CMake variable. I'd prefer the cmake variable as it shows in the command line and help troubleshoot and create reproducible build, and env var is also taking effect in session global scope while CMake var is only for the CMake instance which is more restricted in scope.

For significant contributions please make sure you have completed the following items:

  • CHANGELOG.md updated for non-trivial changes
  • Unit tests have been added
  • Changes in public API reviewed

@ThomsonTan ThomsonTan requested a review from a team June 28, 2023 21:10
@lalitb
Copy link
Member

lalitb commented Jun 28, 2023

Looks Good, If you would like to add a small section on this in INSTALL.md, else can be covered in separate PR.

# current project binary output directory.
add_subdirectory(${OPENTELEMETRY_EXTERNAL_COMPONENT_PATH}
${PROJECT_BINARY_DIR}/external)
elseif(DEFINED ENV{OPENTELEMETRY_EXTERNAL_COMPONENT_PATH})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for fixing this, seems I messed up this while changing the variable names as one of the comments.

Copy link
Member

@owent owent left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM and thanks.

Copy link
Member

@esigo esigo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
Thanks :)

@marcalff marcalff changed the title Fix if check on environment variable and add CMake variable [BUILD] Fix if check on environment variable and add CMake variable Jun 29, 2023
@marcalff marcalff merged commit 313b04d into open-telemetry:main Jun 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUILD] Environment variable OPENTELEMETRY_EXTERNAL_COMPONENT_PATH is checked incorrectly
5 participants