-
Notifications
You must be signed in to change notification settings - Fork 888
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
fatal error: 'boost/predef/other/endian.h' file not found with MSGPACK_USE_BOOST OFF #1025
Comments
Digging a bit into the code, it seems that the CMakeLists.txt#L79 is hit as expected. |
Looking at the verbose output of Adding this after CMakeLists.txt#L113 fixes the missing definition: TARGET_COMPILE_DEFINITIONS(msgpackc-cxx INTERFACE MSGPACK_NO_BOOST) # possibly add other flags as well |
I checked CMakeLists.txt but I couldn't find the problem. All CMAKE_CXX_FLAGS preserved at all places.
msgpack-c should depend on boost by default. So I think that this modification is not good. I couldn't reproduce the error. Maybe https://stackoverflow.com/help/minimal-reproducible-example is helpful. I'm not expert of cmake. If you would find the good solution, please send a pull request. |
Hi @redboltz, thank you for your reply. It does not fail as long as you have I've put together a small example that successfully reproduces the issue on our systems: |
Indeed it wasn't meant as a solution, but rather as a way of showing that the |
same for me |
could be workaround. Essential fix is not yet. |
According to the cmake document https://cmake.org/cmake/help/latest/command/add_library.html add_library is defined as follows in up to date spec: add_library(<name> INTERFACE [<source>...] [EXCLUDE_FROM_ALL]) I read the doucment but I didn't understand how it works. Should the following line TARGET_COMPILE_DEFINITIONS(msgpackc-cxx INTERFACE) be TARGET_COMPILE_DEFINITIONS(msgpackc-cxx MSGPACK_CXX11 MSGPACK_CXX14 MSGPACK_CXX17 ... MSGPACK_USE_BOOST ...) ? What does parameters followed by INTERFACE mean? msgpack-c cmake minimum requirement is v3.1 Line 1 in b4d800e
v3.1add_library definition is something different add_library(<name> INTERFACE [IMPORTED [GLOBAL]]) I got confused. |
TARGET_COMPILE_DEFINITIONS(msgpackc-cxx MSGPACK_CXX11 MSGPACK_CXX14 MSGPACK_CXX17 ... MSGPACK_USE_BOOST ...) This is wrong. I wrote cmake options as arguments. In @leocencetti example, it is C++ compiler option (macro definition by -D option). I got confuse more. I couldn't find corresponding document in cmake add_library manual... |
Little by little, I'm understanding the essential issue. The issue is: How to reflect cmake sub project's compiler options to the parent cmake project. |
I studied about that. I couldn't find a good way to do that. In order to modify msgpack-c option, you need to define configuration macro as C++ compiler options instead of cmake options. So in this case, removing boost dependency, is This is my current conclusion. If there is a proper way to reflect cmake sub project's configured C++ compiler flags to the parent project, please let me know. |
I asked this question to stackoverflow and got the answer. |
Propagate compiler options that are decided by cmake options to the parent project.
Propagate compiler options that are decided by cmake options to the parent project.
Propagate compiler options that are decided by cmake options to the parent project.
Propagate compiler options that are decided by cmake options to the parent project.
Finally, I implemented #1028 |
Fixed by #1028 |
Similar to #1005, there seems to be a dependency on
boost/predef/other/endian.h
when building withMSGPACK_USE_BOOST=OFF
.I have reproduced this issue on both Linux and Windows.
Minimal reproducible example: https://github.com/leocencetti/msgpack-c-issue-1025-example
The text was updated successfully, but these errors were encountered: