You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I created CMakeLists.txt based off the one in the repo (some changes made to fix minor errors which probably should be discussed in a separate issue), and still it won't build because of unresolved include paths.
# Changes I made are marked with <<<.
include(ThriftLibrary.cmake) # <<< ThriftLibrary.cmake copied to the same dir
set(EXAMPLE_IF_HOME ${CMAKE_CURRENT_SOURCE_DIR})
# Example to test linking
thrift_library(
"chatroom" #file_name
"ChatRoomService;Echo" #services
"cpp2" #language
"" #options
"${EXAMPLE_IF_HOME}" #file_path
"${CMAKE_CURRENT_BINARY_DIR}" #output_path # <<<
".." #include_prefix # <<<
)
Invoking cmake with the above file, I got an error complaining:
In file included from /path/to/fbthrift/thrift/example/build/if/gen-cpp2/chatroom_data.cpp:8:
/path/to/fbthrift/thrift/example/build/if/gen-cpp2/../gen-cpp2/chatroom_data.h:9:10: fatal error: 'thrift/lib/cpp2/gen/module_data_h.h' file not found
#include <thrift/lib/cpp2/gen/module_data_h.h>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
make[2]: *** [if/CMakeFiles/chatroom-cpp2-obj.dir/gen-cpp2/chatroom_data.o] Error 1
make[1]: *** [if/CMakeFiles/chatroom-cpp2-obj.dir/all] Error 2
make: *** [all] Error 2
This could be resolved by adding lines of include_directories(), but this is a significant amount of manual work (which I have not tried), because the include/ directories in /my/custom/path/installed/ are installed like:
Hello,
I tried to build the chatroom example in C++ on M1 MacOS and got into a problem with resolving include paths.
How I built fbthrift
Following the top-level README, I built fbthrift with a custom --scratch-path.
What I tried to build
I created CMakeLists.txt based off the one in the repo (some changes made to fix minor errors which probably should be discussed in a separate issue), and still it won't build because of unresolved include paths.
Invoking cmake with the above file, I got an error complaining:
This could be resolved by adding lines of
include_directories()
, but this is a significant amount of manual work (which I have not tried), because theinclude/
directories in/my/custom/path/installed/
are installed like:rather than
which I was expecting (in which case only one
include_directories()
is needed).Have I done anything wrong in the build process?
The text was updated successfully, but these errors were encountered: