-
Notifications
You must be signed in to change notification settings - Fork 438
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] Fixing CMake to build GTest on Windows #1887
Merged
Merged
Changes from 10 commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
0d6e552
cmake breaks here because of the REQUIRED clause
bachittle 492285c
Merge branch 'main' into cmake_win_fix
bachittle 877e14c
Merge branch 'main' into cmake_win_fix
lalitb d9e8473
Merge branch 'cmake_win_fix' of https://github.com/bachittle/opentele…
bachittle 070a675
playing around with vcpkg, got it working but all tests fail (most li…
bachittle 1124c66
Merge branch 'main' into cmake_win_fix
ThomsonTan e3d8a79
cmake toolchain files can't be set inside cmakelists.txt, maybe at th…
bachittle 22caf23
Merge branch 'cmake_win_fix' of https://github.com/bachittle/opentele…
bachittle 62db735
Merge branch 'main' into cmake_win_fix
lalitb 9cfdac7
Merge branch 'main' into cmake_win_fix
lalitb 2839764
Merge branch 'main' into cmake_win_fix
ThomsonTan cbbd449
better inclusion of VCPKG_ROOT
bachittle f7de82c
fixed cmake formatting
bachittle 531f726
Merge branch 'main' into cmake_win_fix
ThomsonTan 8e62fe0
actually fix cmake format (ran the command)
bachittle f931327
Merge branch 'main' into cmake_win_fix
ThomsonTan 57a0975
Merge branch 'main' into cmake_win_fix
ThomsonTan 7b954d0
Merge branch 'main' into cmake_win_fix
ThomsonTan a2f4462
Merge branch 'main' into cmake_win_fix
ThomsonTan 0a17a07
Merge branch 'main' into cmake_win_fix
bachittle 596c2b8
Merge branch 'main' into cmake_win_fix
ThomsonTan 2bd872b
trying to include CMAKE_TOOLCHAIN_FILE, still fails...
bachittle cb439ce
fix cmake format
bachittle f6375fb
Merge branch 'main' into cmake_win_fix
ThomsonTan 7349c5b
Merge branch 'main' into cmake_win_fix
marcalff File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we print this message only when we do not set toolchain file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue is the cmakefile tries to set the CMAKE_TOOLCHAIN_FILE in the cache at the start. This does not work unless its at the very start of the build process.
So its set, but it wasn't detecting my vcpkg unless I set it manually using
cmake -DCMAKE_TOOLCHAIN_FILE=...
It may have to do with the submodules thinking the source directory is different, but gtest was not getting detected even after running install_windows_deps()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we use
cmake -DCMAKE_TOOLCHAIN_FILE=...
to set toolchain, we should also replaceNOT DEFINED CMAKE_TOOLCHAIN_FILE
by(NOT DEFINED CMAKE_TOOLCHAIN_FILE AND NOT DEFINED CACHE{CMAKE_TOOLCHAIN_FILE})
, or maybeNOT CMAKE_TOOLCHAIN_FILE
for short.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It can also just be removed entirely since it doesn't work
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for my mistake,
DEFINED <VAR NAME>
can also be used to check cached variables.LGTM after format problem is solved.Thanks for your contribution.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @bachittle, could you please also take a look at my comment here?
#1887 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry I didn't see this, will take a look. The ci format isn't failing anymore, though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these are my cmake flags that are set using cmake-gui. notice the WITH_OTLP is not set, so I am just building the tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @bachittle. This does confirm that OTLP is not enabled. Instead of commenting out the set of
CMAKE_TOOLCHAIN_FILE
, can we add a line like below in the call afterfind_package(GTest REQUIRED)
in the same file?opentelemetry-cpp/CMakeLists.txt
Line 331 in 5046443
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried this and it still failed, check latest commit: 2bd872b. Let me know if I should try putting this somewhere else.