-
Notifications
You must be signed in to change notification settings - Fork 1
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
Layout set_property("cmake_build_modules") #1
Open
memsharded
wants to merge
1
commit into
vasama:main
Choose a base branch
from
memsharded:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
message(STATUS "Adding target_sources() in add_visualizers.cmake") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I moved this here, so the relative position of |
||
target_sources(my::lib INTERFACE ${CMAKE_CURRENT_LIST_DIR}/../visualizers/my/lib.natvis) |
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.
One of the issues is that the same file with the fixed path cannot work for 2 different layouts, the "build/editable" layout, and the "package" layout.
I moved this to the "source" tree, so I could keep the same relative position of the
add_visualizers.cmake
file and thelib.natvis
file. Another strategy would be to have different files: one file written at "build" time, but then, do not copy that file as-is to the package folder atinstall()
time but instead generate a new one with an updated relative position.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.
This doesn't quite solve my problem, because now I have to define the
add_visualizers.cmake
script manually. Instead I would like to automate the process. That was what the CMake scriptfile
invocation represents. In reality the scripts to generate it are somewhat more involved. I can generate the file using Conan too if that's more appropriate, but it seemed to me that I probably shouldn't generate files inpackage_info
.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 guessed that the process could be more complicated, this is why I suggested the above. The main issue is that the relative path between the
add_visualizers.cmake
and thenat.vis
file should be correct in both places, and this cannot happen if you use exactly the same file copied atinstall()
time. So the automated solution, if you want to support both thecreate
and theeditable
different layouts, would be to make sure that 2 different files are generated:add_visualizers.cmake
that you create atbuild()
time, with the relative path in the "build" or editable layoutadd_visualizers.cmake
that you create atpackage()
time, with the relative path of the "package" layoutpackage_info()
only inbuild()
andpackage()
add_visualizers.cmake
could be "patched" atpackage()
time, doing a copy to the package folder, then patching the relative paths (it could be already an easy to patch variable that is reused in the script)Please let me know if this helps.