-
Notifications
You must be signed in to change notification settings - Fork 27
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
[3.1] more cleanup to EosioTester.cmake to use CMAKE_INSTALL_FULL_LIBDIR instead #648
Merged
+27
−25
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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
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.
this section above could use some 👀
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
EOSIO_ROOT
is not defined, would it be likelyEOS_ROOT_DIR
not defined either? It is safer to check ifEOS_ROOT_DIR
is defined before use.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.
@EOS_ROOT_DIR@
is always defined because it's replaced as part of the file configuration -- the resulting file will always be one of two values depending of it's building the file for the in-tree-build case (former) vs the installed case (latter)mandel/CMakeLists.txt
Lines 194 to 195 in d668e01
mandel/CMakeLists.txt
Lines 199 to 200 in d668e01
So the intention seems to be if
EOSIO_ROOT
is not defined then a sensible default should be used.In-tree build
Previously
set(EOS_ROOT_DIR ${CMAKE_BINARY_DIR})
set(EOSIO_ROOT "@EOS_ROOT_DIR@")
list(APPEND CMAKE_MODULE_PATH ${EOSIO_ROOT}/lib/cmake/eosio)
list(APPEND CMAKE_MODULE_PATH ${EOSIO_ROOT}/lib64/cmake/eosio)
This ultimately meant for something like a build in
/home/moomoo/mandel/build
it'd end up adding these two paths to theCMAKE_MODULE_PATH
/home/moomoo/mandel/build/lib/cmake/eosio
/home/moomoo/mandel/build/lib64/cmake/eosio
Now
set(EOS_ROOT_DIR ${CMAKE_BINARY_DIR}/lib)
list(APPEND CMAKE_MODULE_PATH @EOS_ROOT_DIR@/cmake/eosio)
So this means only
/home/moomoo/mandel/build/lib/cmake/eosio
is added to theCMAKE_MODULE_PATH
but afaict this is fine since you'll never get a lib64 in such an in-tree case.Installed
Previously
set(EOS_ROOT_DIR ${CMAKE_INSTALL_PREFIX})
set(EOSIO_ROOT "@EOS_ROOT_DIR@")
list(APPEND CMAKE_MODULE_PATH ${EOSIO_ROOT}/lib/cmake/eosio)
list(APPEND CMAKE_MODULE_PATH ${EOSIO_ROOT}/lib64/cmake/eosio)
This ultimately meant for something like an install with
-DCMAKE_INSTALL_PREFIX=/usr
you'd end up adding these two paths to theCMAKE_MODULE_PATH
/usr/lib/cmake/eosio
/usr/lib64/cmake/eosio
But this is wrong! The files were installed to
/usr/lib/x86_64-linux-gnu/cmake/eosio
instead.Now
set(EOS_ROOT_DIR ${CMAKE_INSTALL_FULL_LIBDIR})
-- critically this matches where the actual files will beinstall()
edlist(APPEND CMAKE_MODULE_PATH @EOS_ROOT_DIR@/cmake/eosio)
This will only end up with
${CMAKE_INSTALL_FULL_LIBDIR}/cmake/eosio
as theCMAKE_MODULE_PATH
but that'll always match up the actual installed path:/usr/lib/x86_64-linux-gnu/cmake/eosio
EOSIO_ROOT?
EOSIO_ROOT
is the wild card here... I'm guessing some documentation or previous user workflow manually sets that and expects it to work. So I've decided to just keep the old behavior as-is since I'm not really sure all the different scenarios for that. Only the "automatic"/"fall back" logic whenEOSIO_ROOT
is not specified is changed.