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.
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
Support BLOCKFACTORY_PLUGIN_PATH environment variable #32
Support BLOCKFACTORY_PLUGIN_PATH environment variable #32
Changes from all commits
9f527ea
2f4f17b
aa28a13
064c9b2
8492e65
29ceb0c
f76da67
48a9ac2
f801272
f90ae60
57c50ef
3f1b197
c8adc06
04b9bed
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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 am a bit confused by this. Why is
"lib" + library + ".dll"
is included and"lib" + library + "d.dll"
not?Furthermore, if the order of the vector indicates the order in which the candidates are searched for, I think that depending on whether
BlockFactory
is compiled in release or in debug, the order needs to be changed to make sure that in Debug builds thelibrary + "d.dll"
is searched first. It could make sense to still have the normal one as a fallback, but if both are found and BlockFactory is compiled in debug, for surelibrary + "d.dll"
is the one to load.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.
Because this case happens only if you don't use the VS generator. This is for instance the case with Ninja, and since it is not a multi-config generator the debug suffix is not used.
For what concern the order, yes, on windows it actually makes sense to define it wrt to the
CMAKE_BUILD_TYPE
. There's always the caveat of linking Release code to Release code, and I think this applies also to plugin libraries.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.
Cool. So if you use Ninja and compile BlockFactory in Debug, the libraries are compiled with the
lib
prefix and without thed
suffix, even ifCMAKE_DEBUG_POSTFIX
is set tod
inblockfactory/CMakeLists.txt
Line 95 in 5a0b977
Ack then, even if it really seems to be a CMake+Ninja+MSVC bug.
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.
Nitpick:
CMAKE_BUILD_TYPE
is ignored for multiple config generator. Do you have any idea of where this logic in YARP? As far as I know, in YARP that logic is is working fine.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.
In my tests I was using g++ with Ninja (check travis). I am not 100% sure of the outcome of the combo of MSVC compiler + Ninja generator. I guess it generates the same things of using just MSVC.
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.
Ahh, sorry I did not understand we wanted to support Mingw.
In that case, in that case it make sense, the
CMAKE_DEBUG_POSTFIX
is only set forMSVC
, not forWIN32
.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.
You mean in
shlibpp
? I didn't find it, I think that this portion of code already handles it:blockfactory/deps/sharedlibpp/src/SharedLibrary.cpp
Lines 56 to 69 in 7b9033c
In the example of
shlibpp
you must pass the OS-specific name (see test). I added the support of doing it automatically in this PR.Actually, I just realized that if the library is not in the extended search path, I pass only the libname. This case would cover the case where the library is in the linker search path, and I'm not sure
dlopen
can be called without specifying the prefix (lib) and suffix (.so) of the library.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.
No, I meant in YARP. I found it, it is in https://github.com/robotology/yarp/blob/master/src/libYARP_OS/src/YarpPlugin.cpp#L69 .
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.
Regarding mingw, in theory the mingw would be searched first if BlockFactory is compiled with mingw, as Mingw's and MSVC's C++ ABI are not compatible. However, the trick of
<name>d.dll
,name.dll
to distinguish the various ABI is just a dirty trick (there are a few other differences that should be considered to fully determine the ABI compatibility), so I guess it is not tragic if we search it later, as in most cases Mingw-libraries and MSVC-libraries are not installed in the same prefix.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.
👍
Btw I think that YARP code does not work well with
icc
^^ I'm not sure tho if we support it.These are edge cases at this stage. We never stated the we support Mingw and the installation instructions on Windows only mention MSVC. I think we can postpone safely these cases.